GNU bug report logs - #14938
24.3; open-network-stream with starttls fails with protocol that has no greeting

Previous Next

Package: emacs;

Reported by: Dan Starr <dan.starr <at> gmail.com>

Date: Tue, 23 Jul 2013 15:43:01 UTC

Severity: normal

Tags: fixed

Found in version 24.3

Fixed in version 24.4

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14938 in the body.
You can then email your comments to 14938 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14938; Package emacs. (Tue, 23 Jul 2013 15:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dan Starr <dan.starr <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 23 Jul 2013 15:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dan Starr <dan.starr <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; open-network-stream with starttls fails with protocol that has
 no greeting
Date: Tue, 23 Jul 2013 09:14:15 -0400
[Message part 1 (text/plain, inline)]
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:

<code>

  (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 "<stream:stream version=\"1.0\"
xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\"
to=\"127.0.0.1\">"
                   :end-of-capability "</stream:features>"
                   :end-of-command "/>"
                   :success "proceed"
                   :client-certificate '(/home/dstarr/key/dstarr.key
/home/dstarr/key/dstarr.cert)
                   ))

(defun my-starttls-function (capabilityCommandResponse)
  "<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>")

</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
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
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14938; Package emacs. (Tue, 30 Jul 2013 15:13:01 GMT) Full text and rfc822 format available.

Message #8 received at 14938 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Dan Starr <dan.starr <at> gmail.com>
Cc: 14938 <at> debbugs.gnu.org
Subject: Re: bug#14938: 24.3;
 open-network-stream with starttls fails with protocol that has no
 greeting
Date: Tue, 30 Jul 2013 17:12:27 +0200
Dan Starr <dan.starr <at> gmail.com> 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/




Added tag(s) fixed. Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 30 Jul 2013 15:14:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 24.4, send any further explanations to 14938 <at> debbugs.gnu.org and Dan Starr <dan.starr <at> gmail.com> Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 30 Jul 2013 15:14:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 28 Aug 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 253 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.