From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.comp.encryption.gpg.gnutls.devel,gmane.emacs.devel Subject: Re: Emacs core TLS support Date: Sun, 26 Sep 2010 01:12:13 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87k4m92fuq.fsf@lifelogs.com> References: <878wc1vfh3.fsf@lifelogs.com> <87r5ptpnz2.fsf@stupidchicken.com> <871vhsvkut.fsf@lifelogs.com> <87d41csktn.fsf@lifelogs.com> <87k4v0n0m8.fsf@lifelogs.com> <87wrrvfnc4.fsf@lifelogs.com> <87r5i2d00q.fsf@lifelogs.com> <87zkwqijye.fsf@stupidchicken.com> <878w4actmg.fsf@lifelogs.com> <877hju123h.fsf@stupidchicken.com> <8762yklrdk.fsf@lifelogs.com> <87wrqzhrjv.fsf@lifelogs.com> <87fwxmihyz.fsf@lifelogs.com> <8762ycfhqo.fsf@lifelogs.com> <87d3sf9soo.fsf@lifelogs.com> <87eicn2upl.fsf@mocca.josefsson.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1285481714 31761 80.91.229.12 (26 Sep 2010 06:15:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 26 Sep 2010 06:15:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: gnutls-devel@gnu.org Original-X-From: gnutls-devel-bounces+pgp-gnutls-dev=m.gmane.org@gnu.org Sun Sep 26 08:15:13 2010 Return-path: Envelope-to: pgp-gnutls-dev@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OzkW0-0001WW-IZ for pgp-gnutls-dev@m.gmane.org; Sun, 26 Sep 2010 08:15:13 +0200 Original-Received: from localhost ([127.0.0.1]:36729 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzkVz-0000UJ-PZ for pgp-gnutls-dev@m.gmane.org; Sun, 26 Sep 2010 02:15:11 -0400 Original-Received: from [140.186.70.92] (port=35977 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzkVv-0000UE-Tx for gnutls-devel@gnu.org; Sun, 26 Sep 2010 02:15:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzkVu-0001SO-Aa for gnutls-devel@gnu.org; Sun, 26 Sep 2010 02:15:07 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:45769) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzkVt-0001SI-UP for gnutls-devel@gnu.org; Sun, 26 Sep 2010 02:15:06 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OzkVs-0001VI-00 for gnutls-devel@gnu.org; Sun, 26 Sep 2010 08:15:04 +0200 Original-Received: from c-24-14-16-248.hsd1.il.comcast.net ([24.14.16.248]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 Sep 2010 08:15:03 +0200 Original-Received: from tzz by c-24-14-16-248.hsd1.il.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 Sep 2010 08:15:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 108 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-24-14-16-248.hsd1.il.comcast.net X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:FyH4z3L/T0TYunzCNBG+0HT92JA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: gnutls-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GnuTLS development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: gnutls-devel-bounces+pgp-gnutls-dev=m.gmane.org@gnu.org Errors-To: gnutls-devel-bounces+pgp-gnutls-dev=m.gmane.org@gnu.org Xref: news.gmane.org gmane.comp.encryption.gpg.gnutls.devel:4539 gmane.emacs.devel:130898 Archived-At: On Tue, 21 Sep 2010 13:37:42 +0200 Simon Josefsson wrote: SJ> Ted Zlatanov writes: >> +(defconst gnutls-version "0.3.1") >> + "/tmp/ca.pem" SJ> This should be removed. Done. >> + (priority-string (or priority-string >> + (cond >> + ((eq credentials 'gnutls-anon) >> + "PERFORMANCE:+ANON-DH:!ARCFOUR-128") >> + ((eq credentials 'gnutls-x509pki) >> + "PERFORMANCE")))) SJ> I think NORMAL should be used instead of PERFORMANCE here. Done. >> +(defun open-ssl-stream (name buffer host service) >> + "Open a SSL connection for a service to a host. SJ> I suggest using 'TLS' or possibly 'SSL/TLS' consistently in SJ> documentation. OK, but let's get the code working first. SJ> Is 'open-ssl-stream' for backwards compatibility? Otherwise I SJ> suggest 'open-tls-stream'. Yes, it's trying to be compatible. I'd rather get rid of the compatibility but we'll see. >> +;; (open-ssl-stream "tls" "tls-buffer" "yourserver.com" "https") SJ> Looks like debug code that should be removed? Please let it be for now. It's useful for quick testing. >> +PRIORITY-STRING is as per the GnuTLS docs. SJ> Maybe there could be an info hyperlink here? Sorry, you mean to the GnuTLS webserver? I don't know if that's necessary. >> + (gnutls-message-maybe >> + (setq ret (gnutls-boot proc priority-string credentials credentials-file)) >> + "boot: %s") SJ> How much debug code do we want to retain? I'm not sure. For now, as much as possible. We can always turn it down later. >> +DEFUN ("gnutls-global-init", Fgnutls_global_init, >> + Sgnutls_global_init, 0, 0, 0, >> + doc: /* Initializes global GNU TLS state to defaults. >> +Call `gnutls-global-deinit' when GNU TLS usage is no longer needed. >> +Returns zero on success. */) SJ> ... >> +DEFUN ("gnutls-global-deinit", Fgnutls_global_deinit, >> + Sgnutls_global_deinit, 0, 0, 0, >> + doc: /* Deinitializes global GNU TLS state. >> +See also `gnutls-global-init'. */) SJ> I think this shouldn't be exposed to Elisp, Emacs startup code could SJ> initialize GnuTLS directly. OK, done. >> +DEFUN ("gnutls-boot", Fgnutls_boot, Sgnutls_boot, 3, 6, 0, >> + doc: /* Initializes client-mode GnuTLS for process PROC. >> +Currently only client mode is supported. Returns a success/failure >> +value you can check with `gnutls-errorp'. >> + >> +PRIORITY_STRING is a string describing the priority. >> +TYPE is either `gnutls-anon' or `gnutls-x509pki'. >> +TRUSTFILE is a PEM encoded trust file for `gnutls-x509pki'. >> +KEYFILE is ... for `gnutls-x509pki' (TODO). >> +CALLBACK is ... for `gnutls-x509pki' (TODO). SJ> Two comments here: 1) The name is a bit generic..? Well, "init" is taken and I have a small vocabulary :) SJ> 2) The design makes it a bit difficult to support multiple SJ> credentials. The GnuTLS API allows clients to have several SJ> credentials (X.509, OpenPGP, etc). Perhaps copying the GnuTLS API SJ> further is more flexible. I thought of making it more flexible but I really want to get the basic case working. As I mentioned earlier I think GnuTLS should consider further extending the idea of priority strings to a full configuration (credentials especially) in a single string or file. That would make using it so much easier from Emacs Lisp. I tried to figure out the TLS handshake problem but it has stumped me. It's taken me many hours and I still don't know what I'm missing so, as I mentioned in my other message, I've checked in my current state to let others take a look. If you or other GnuTLS developers can help, it would be greatly appreciated. Once the handshake works I will work on the other improvements you mentioned and on getting the GnuTLS support into Gnus and other parts of Emacs. Thanks Ted