Objective-C binding for ObjFW

Simon Josefsson simon at josefsson.org
Sat Feb 19 16:17:05 CET 2011


"Jos Kuijpers" <jos at kuijpersvof.nl> writes:

> Hi all,
>
> I am writing a library for the objective-C framework ObjFW
> (https://webkeks.org/objfw https://webkeks.org/hg/objfw), which is not
> written by me.
> The normal socket class has connect, close, bind, read and write, and I am
> just overwriting those. My library is located at
> https://webkeks.org/hg/objgnutls. 
>
> Does anyone know a (little) objective-c, enough to take a look at my code,
> and willing to do so? I would like to know whether I am doing it the right
> way.

I don't know objective-c, but some quick comments:

* GnuTLS is designed in a OO-inspired way, and in particular the
  authentication objects (X.509 cert, OpenPGP key etc) are their own
  objects, which can be associated with a session.  Thus instead of
  having a single entry point 'connectToHost' consider if you could
  split the API up to more closely match the GnuTLS API where
  credentials are there own objects and associated to each session.
  Sessions can be short lived but credentials are long-lived, especially
  for servers.  Of course, you can build connectToHost using the other
  functions, but the flexibility will be there for callers.

* Do you need to expose isResumed?  Maybe get it via the information
  dictionary?

* What's the point of mustSupportSessionResuming?

* Expose the priority string to the caller, rather than hard coding
  "NORMAL".  It is a nice way to get applications to be able to
  influence low-level stuff in GnuTLS.

/Simon




More information about the Gnutls-devel mailing list