From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel,gmane.comp.encryption.gpg.gnutls.devel Subject: Re: Emacs and TLS support Date: Sun, 26 Sep 2010 16:33:04 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87eicgyyun.fsf@lifelogs.com> References: <4C9F70AE.3020705@alice.it> <87tylcz0aa.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1285536814 2512 80.91.229.12 (26 Sep 2010 21:33:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 26 Sep 2010 21:33:34 +0000 (UTC) Cc: gnutls-devel@gnu.org To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 26 23:33:32 2010 Return-path: Envelope-to: ged-emacs-devel@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 1Ozyqi-00083i-9Q for ged-emacs-devel@m.gmane.org; Sun, 26 Sep 2010 23:33:32 +0200 Original-Received: from localhost ([127.0.0.1]:54143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ozyqh-0007Gg-N4 for ged-emacs-devel@m.gmane.org; Sun, 26 Sep 2010 17:33:31 -0400 Original-Received: from [140.186.70.92] (port=55764 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ozyqb-0007GY-Ce for emacs-devel@gnu.org; Sun, 26 Sep 2010 17:33:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzyqX-0003G4-Ld for emacs-devel@gnu.org; Sun, 26 Sep 2010 17:33:25 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:51292) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzyqX-0003Fs-5Z for emacs-devel@gnu.org; Sun, 26 Sep 2010 17:33:21 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OzyqS-0007yL-BZ for emacs-devel@gnu.org; Sun, 26 Sep 2010 23:33:16 +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 23:33:16 +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 23:33:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 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:+zhNOGLRwkwrzxb5TYu9I/O+WEo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130946 gmane.comp.encryption.gpg.gnutls.devel:4541 Archived-At: On Sun, 26 Sep 2010 23:06:46 +0200 Lars Magne Ingebrigtsen wrote: LMI> Ted Zlatanov writes: >> I stepped through the GnuTLS function calls and couldn't find a problem >> with the credential structures. It's frustrating that the exact same >> code works for the example client in GnuTLS but breaks in Emacs (most of >> my time debugging this was spent double-checking that the same functions >> are called with the same parameters in both cases). LMI> I know nothing about tls, but have you confirmed that the library calls LMI> really work in non-blocking mode? It's not uncommon to write libraries LMI> that assume that socket connections are blocking... It would be great if the GnuTLS developers could comment. But these references seem to specifically confirm that non-blocking sockets should work the way I'm doing it: http://lists.gnupg.org/pipermail/gnutls-dev/2005-March/000839.html http://www.gnu.org/software/gnutls/manual/html_node/The-transport-layer.html I tried setting the low water value to 0 in `Fgnutls_handshake' after `gnutls_transport_set_ptr2' but it didn't make a difference: gnutls_transport_set_lowat (state, 0); So I removed it in the patch. I sort of suspect right now that recv/send are not working correctly so I need to provide custom versions with `gnutls_transport_set_pull_function' and `gnutls_transport_set_push_function'. But I don't know enough about the Emacs internals that set up processes, which are ridiculously complicated because of all the supported platforms. And Simon Josefsson said his patch worked when he first wrote it, so I assumed that this kind of deep surgery would not be required. Ted