From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.comp.encryption.gpg.gnutls.devel,gmane.emacs.devel Subject: Re: Emacs and TLS support Date: Thu, 30 Sep 2010 12:18:26 +0200 Message-ID: <87k4m3bklp.fsf@mocca.josefsson.org> References: <4C9F70AE.3020705@alice.it> <87tylcz0aa.fsf@lifelogs.com> <87eicgyyun.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1285841957 15229 80.91.229.12 (30 Sep 2010 10:19:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 30 Sep 2010 10:19:17 +0000 (UTC) Cc: gnutls-devel@gnu.org, emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: gnutls-devel-bounces+pgp-gnutls-dev=m.gmane.org@gnu.org Thu Sep 30 12:19:15 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 1P1GEN-0000ZW-6V for pgp-gnutls-dev@m.gmane.org; Thu, 30 Sep 2010 12:19:15 +0200 Original-Received: from localhost ([127.0.0.1]:43105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1GEM-0005KL-F2 for pgp-gnutls-dev@m.gmane.org; Thu, 30 Sep 2010 06:19:14 -0400 Original-Received: from [140.186.70.92] (port=52110 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1GEG-0005JY-ME for gnutls-devel@gnu.org; Thu, 30 Sep 2010 06:19:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P1GEF-0006a0-FJ for gnutls-devel@gnu.org; Thu, 30 Sep 2010 06:19:08 -0400 Original-Received: from yxa-v.extundo.com ([83.241.177.39]:48159) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P1GE5-0006Y0-LM; Thu, 30 Sep 2010 06:18:59 -0400 Original-Received: from mocca (c80-216-27-64.bredband.comhem.se [80.216.27.64]) (authenticated bits=0) by yxa-v.extundo.com (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o8UAIWbS023521 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 30 Sep 2010 12:18:43 +0200 OpenPGP: id=B565716F; url=http://josefsson.org/key.txt X-Hashcash: 1:22:100930:tzz@lifelogs.com::pUDy/bhhuftlg4tB:6zY0 X-Hashcash: 1:22:100930:gnutls-devel@gnu.org::aLlgz63RfAamjRbW:DFOO X-Hashcash: 1:22:100930:emacs-devel@gnu.org::XDwMRezC8/Qtjyz3:XY+d In-Reply-To: <87eicgyyun.fsf@lifelogs.com> (Ted Zlatanov's message of "Sun, 26 Sep 2010 16:33:04 -0500") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) X-Virus-Scanned: clamav-milter 0.96.3 at yxa-v X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) 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:4565 gmane.emacs.devel:131100 Archived-At: Ted Zlatanov writes: > 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 Yes, it should work both in blocking and non-blocking. > 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. I don't know Emacs internals well enough, but it may be that replacing the send/recv functions could make things more reliable... I don't have a lot of time to help here alas, and when I tried building Emacs from CVS the other day it just crashed... maybe you could provide simple step-by-step instructions to get something building that I can test? With some specific CVS revision that is known working. /Simon