Emacs core TLS support

Ted Zlatanov tzz at lifelogs.com
Tue Sep 14 17:45:05 CEST 2010


On Sun, 12 Sep 2010 12:58:47 +0200 Stefan Monnier <monnier at iro.umontreal.ca> wrote: 

SM> Place a space *before* the open-paren and around infix operators.
...
SM> Put the comment-close at the end of the previous line.
...
SM> We use /*..*/ comments, or "#if 0 ... #endif".
...
SM> This should mention `gnutls-handshake' rather than gnutls_handshake().
...
SM> Please use an enum (and use it for the type of the gnutls_initstage
SM> field, of course).
...
SM> No need for spaces after the open and before the close paren.
...
SM> Please finish your comments with a full-stop (and follow it by 2 spaces).
...
SM> Don't overflow the 80th column.

All done.  Some were oversights, some my stupidity...  Sorry for the annoyance.

SM> BTW, for functions whose are meant to be "internal" (e.g. only expected
SM> to be used via a wrapper in gnutls.el) you can use a "gnutls--" prefix.
SM> This is not a widely used convention in Elisp, but some packages try to
SM> use it.

>> +#define GNUTLS_STAGE_CRED_SET 5
>> +#define GNUTLS_STAGE_HANDSHAKE_CANDO 5

SM> Why is that the same value as GNUTLS_STAGE_CRED_SET?

Because you can't handshake before credentials are set.  I think that's
the best way to express it (rather than a GNUTLS_CAN_HANDSHAKE macro or
some such).

>> +#ifdef HAVE_GNUTLS
>> +/* Defined in gnutls.c */
>> +extern void syms_of_gnutls (void);
>> +#endif

SM> Why here rather than in gnutls.h?
...
SM> Also gnutls.c and gnutls.h need a GPL notice at the beginning.
SM> See other files for the usual boilerplate.

Fixed.  That also removed lisp.h from the patch.

I also added a convenience gnutls-error-string function so users can
interpret GnuTLS errors.  Almost ready for the trunk commit, just need
to get the handshake working (I keep getting E_AGAIN).

Ted

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tls.patch
Type: text/x-diff
Size: 29544 bytes
Desc: not available
URL: </pipermail/attachments/20100914/ffd8dc0b/attachment.patch>


More information about the Gnutls-devel mailing list