From unknown Sun Sep 07 16:50:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14938: 24.3; open-network-stream with starttls fails with protocol that has no greeting Resent-From: Dan Starr Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Jul 2013 15:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14938 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 14938@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.137459416722582 (code B ref -1); Tue, 23 Jul 2013 15:43:01 +0000 Received: (at submit) by debbugs.gnu.org; 23 Jul 2013 15:42:47 +0000 Received: from localhost ([127.0.0.1]:44992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V1ejd-0005s9-TF for submit@debbugs.gnu.org; Tue, 23 Jul 2013 11:42:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56763) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V1cQG-0006NX-EH for submit@debbugs.gnu.org; Tue, 23 Jul 2013 09:14:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1cQ8-0002tn-58 for submit@debbugs.gnu.org; Tue, 23 Jul 2013 09:14:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1cQ8-0002tj-23 for submit@debbugs.gnu.org; Tue, 23 Jul 2013 09:14:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1cQ4-000520-Lt for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2013 09:14:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1cPx-0002rN-Cq for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2013 09:14:24 -0400 Received: from mail-pd0-x22d.google.com ([2607:f8b0:400e:c02::22d]:36245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1cPx-0002qX-2h for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2013 09:14:17 -0400 Received: by mail-pd0-f173.google.com with SMTP id bv13so847367pdb.4 for ; Tue, 23 Jul 2013 06:14:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=ZTKX//EDRQ+X/Qn2ts2thTBToymNES3y3ANMvdR/uEw=; b=hPrZ5oVUK6aqaLgWwadNWpXTjg73MUH0uGPJZkF+ySC6dnjaCVMtpCwY60TMYyN/Vb ugtETvwjY6NTxaKcKfrh3+B897ZOg8qSEZzTtWAh7Yg7DMo+SiQVg+gzLptfc45kg0Np SeKJmPyNGYqay9ZRl0OEFSuO+tGPdINwcroaAp1+VF2oW6Wxd6OesCU5YGMRMeGNzOoF nAAKpdxhUWmOCp+5H0CTZELbQCUB2/7q2VEaLpeWlC871AkfA5V5AfeSUs1koh1qyPzW BKIjQENZens9FqrE94og8q6lcl/hS19zzrVJeM3D+eLrUjfpSNW30rHCDv9oUR7JB9Lb /yIw== MIME-Version: 1.0 X-Received: by 10.66.253.195 with SMTP id ac3mr38140961pad.107.1374585255635; Tue, 23 Jul 2013 06:14:15 -0700 (PDT) Received: by 10.66.164.42 with HTTP; Tue, 23 Jul 2013 06:14:15 -0700 (PDT) Date: Tue, 23 Jul 2013 09:14:15 -0400 Message-ID: From: Dan Starr Content-Type: multipart/alternative; boundary=047d7b15b161e031cf04e22d9155 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -2.7 (--) X-Mailman-Approved-At: Tue, 23 Jul 2013 11:42:44 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) --047d7b15b161e031cf04e22d9155 Content-Type: text/plain; charset=ISO-8859-1 I have been trying to use open-network-stream in emacs 24.3 to interact with a server that runs the Infinote protocol on top of STARTTLS ( http://gobby.0x539.de/trac/wiki/Infinote/Protocol). This is my usage of open-network-stream: (setq myprocess (open-network-stream "testname" ; name "blah" ; buffer "127.0.0.1" ; host 6523 ; port :type 'starttls :starttls-function 'my-starttls-function ;; sent to server when connection initially established :capability-command "" :end-of-capability "" :end-of-command "/>" :success "proceed" :client-certificate '(/home/dstarr/key/dstarr.key /home/dstarr/key/dstarr.cert) )) (defun my-starttls-function (capabilityCommandResponse) "") The problem that I have run into is that the Infinote protocol does not emit a "greeting" upon initial connection, whereas it seems that the implementation of the function network-stream-open-starttls in lisp/net/network-stream.el expects such a greeting. Line 214 of network-stream.el reads: (greeting (network-stream-get-response stream start eoc)). For my particular protocol, I have eoc set to "/>", as I have to be able to detect the server's response to my starttls command (Line 266). Since my server does not emit a greeting, emacs hangs on Line 214 waiting for an "eoc" that never comes. If I set eoc to nil, emacs will proceed past that line, but it will fail to detect the starttls response (obviously, as it has no way to detect the end of a command). To temporarily fix my issue, I removed the 'greeting' line from network-stream.el. A more robust solution would be to perhaps allow a parameter to open-network-stream that indicates whether a greeting is expected or not. R, Dan --047d7b15b161e031cf04e22d9155 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I have been trying to use open-network-stream in emacs 24.= 3 to interact with a server that runs the Infinote protocol on top of START= TLS (http://g= obby.0x539.de/trac/wiki/Infinote/Protocol).

This is my usage of open-network-stream:

<code>

<= div>=A0 (setq myprocess (open-network-stream
=A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0"testname" ; name
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"blah" ; buffer
=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"127.0.0.1" ; host
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A06523 =A0 ; port
= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0:type 'starttls
=A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0:starttls-function 'my-starttls-func= tion
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0;; sent to server when connecti= on initially established
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0:= capability-command "<stream:stream version=3D\"1.0\" xmln= s=3D\"jabber:client\" xmlns:stream=3D\"http://etherx.jabber.org/streams\" to=3D\= "127.0.0.1\">"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0:end-of-capability "</s= tream:features>"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0:= end-of-command "/>"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0:success "proceed"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0:client-certificate '(/home/dstarr/key/dstarr.key /home/dsta= rr/key/dstarr.cert)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0))

(defun my-starttls-function (capabilityCommandResponse)
=A0 &qu= ot;<starttls xmlns=3D\"urn:ietf:params:xml:ns:xmpp-tls\"/>&= quot;)

</code>

The= problem that I have run into is that the Infinote protocol does not emit a= "greeting" upon initial connection, whereas it seems that the im= plementation of the function network-stream-open-starttls in=A0lisp/net/net= work-stream.el expects such a greeting.

Line 214 of network-stream.el reads:=A0(gre= eting (network-stream-get-response stream start eoc)).

=
For my particular protocol, I have eoc set to "/>&= quot;, as I have to be able to detect the server's response to my start= tls command (Line 266). Since my server does not emit a greeting, emacs han= gs on Line 214 waiting for an "eoc" that never comes. =A0If I set= eoc to nil, emacs will proceed past that line, but it will fail to detect = the starttls response (obviously, as it has no way to detect the end of a c= ommand).

To temporarily fix my issue, I removed the = 'greeting' line from network-stream.el. =A0A more robust solution w= ould be to perhaps allow a parameter to open-network-stream that indicates = whether a greeting is expected or not.

R,
Dan
--047d7b15b161e031cf04e22d9155-- From unknown Sun Sep 07 16:50:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14938: 24.3; open-network-stream with starttls fails with protocol that has no greeting Resent-From: Lars Magne Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Jul 2013 15:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14938 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dan Starr Cc: 14938@debbugs.gnu.org Received: via spool by 14938-submit@debbugs.gnu.org id=B14938.137519716623154 (code B ref 14938); Tue, 30 Jul 2013 15:13:01 +0000 Received: (at 14938) by debbugs.gnu.org; 30 Jul 2013 15:12:46 +0000 Received: from localhost ([127.0.0.1]:58574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V4BbR-00061K-7k for submit@debbugs.gnu.org; Tue, 30 Jul 2013 11:12:45 -0400 Received: from hermes.netfonds.no ([80.91.224.195]:46666) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V4BbP-000612-AY for 14938@debbugs.gnu.org; Tue, 30 Jul 2013 11:12:43 -0400 Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1V4BbA-0005SY-6J; Tue, 30 Jul 2013 17:12:28 +0200 From: Lars Magne Ingebrigtsen References: Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEUAAAABAQMKCgsAAAEB AQFyamYBAQQCAwZPSkcoJSS6Z0qHAAACN0lEQVQ4jXWTwW/aMBTGLbDUcYyEArutGRVwK4LdneZR 7pWyhWN2CGeYaNbjEB7OcRGR7P+279mBBdpaEJB//vz5vc9h7P3BP/oPHwguVl2Mtwou6CnC63lR /74BvJY9Nn1ugsUZPzZXfzbl2cRrgpEpRS2AC6CtwgL+HiBPV/nNvVt3UhCxoHMEGgulEeCffyfz T3GsaCS6eDFmbPZYpgNPVRwnWsaqGKtC6/1ZsbuL4+UIdYWizx/BogyteGdXOZAkuKFM9oyHVsGL GAFCmcT0+Aow8e35WhJXm6MFqhgAeJ4DbTGdCs6kfJqCwCO1wxrUSVRqh45USuTlNHMKp1IHOguI 9sSCcwbbAkvj1ATPbwAmOsWAwSTycKzyhgXjwxm1Cuf9KwBkeA14HV0aEsib5lQBrscaVhkC0bh0 AndzG1lQO6AEAUeQ1YD/dxGkyHAj69H6FXxZD9jDbMEXt36vl28CApzNVWISeZtUldFyu/2t4iLP A7Tuf0tGalgc+2qpfyqpDlVJQLD+fDeqguJoVKVffih50BYwNl8my7lcq+93fS3/qq3dakgnEQCh Rz1K/XS9wqo39lTQGpuyzMugHJtguBkGOFwdD3TJAvwag3NnwNgMugBC8JmNKM38U4EhRIB5YhSY XojN7eWuQLKn14jSFngMz88yzzYRt7EvC7YN2w5R6D+7oEhBSg4o6kKXcmpeBsobwu6ErkK+sUmA SwubHnm91MstgHsXEXEOM7o7+TOCVy4bxcsqwCjUAAAAAElFTkSuQmCC X-Now-Playing: Dead Can Dance's _Anastasis In Concert_: "Children Of The Sun" X-Hashcash: 1:23:130730:dan.starr@gmail.com::2wbNCi7VPp5/dPf2:000000000000000000000000000000000000000000MFIM X-Hashcash: 1:23:130730:14938@debbugs.gnu.org::A5iT5egsi8O9s0ZS:00000000000000000000000000000000000000014L/2 Date: Tue, 30 Jul 2013 17:12:27 +0200 In-Reply-To: (Dan Starr's message of "Tue, 23 Jul 2013 09:14:15 -0400") Message-ID: User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1V4BbA-0005SY-6J X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1375801948.82478@UGGcdDcfRrSFJlGE7bpcyw X-Spam-Status: No X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Dan Starr writes: > To temporarily fix my issue, I removed the 'greeting' line from > network-stream.el. A more robust solution would be to perhaps allow a > parameter to open-network-stream that indicates whether a greeting is > expected or not. I've now added support for a :nogreeting parameter to bzr Emacs. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/ From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 30 11:13:03 2013 Received: (at control) by debbugs.gnu.org; 30 Jul 2013 15:13:03 +0000 Received: from localhost ([127.0.0.1]:58578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V4Bbi-00062b-IP for submit@debbugs.gnu.org; Tue, 30 Jul 2013 11:13:02 -0400 Received: from hermes.netfonds.no ([80.91.224.195]:46672) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V4Bbf-000624-PY for control@debbugs.gnu.org; Tue, 30 Jul 2013 11:13:00 -0400 Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1V4BbR-0005T7-QW for control@debbugs.gnu.org; Tue, 30 Jul 2013 17:12:45 +0200 Date: Tue, 30 Jul 2013 17:12:45 +0200 Message-Id: To: control@debbugs.gnu.org From: Lars Magne Ingebrigtsen Subject: control message for bug #14938 X-MailScanner-ID: 1V4BbR-0005T7-QW X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1375801965.88961@yAClS9JwYK1TAt1CDDMRtA X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) tags 14938 fixed close 14938 24.4