Fix XMPP code detection on s_client starttls xmpp
authorCarlos Alberto Lopez Perez <clopez@igalia.com>
Sun, 5 Aug 2012 23:45:51 +0000 (01:45 +0200)
committerBen Laurie <ben@links.org>
Thu, 5 Sep 2013 16:24:55 +0000 (17:24 +0100)
 * Some XMPP Servers (OpenFire) use double quotes.
 * This makes s_client starttls work with this servers.
 * Tested with OpenFire servers from http://xmpp.net/ ::

     openssl s_client -connect coderollers.com:5222 -starttls xmpp

apps/s_client.c

index 61ad29134ba4349d2fc20a1d52e5fc6b47846ecd..c38c42e03736f71041643c2ba95903c3c25c814c 100644 (file)
@@ -1673,7 +1673,8 @@ SSL_set_tlsext_status_ids(con, ids);
                    "xmlns='jabber:client' to='%s' version='1.0'>", host);
                seen = BIO_read(sbio,mbuf,BUFSIZZ);
                mbuf[seen] = 0;
-               while (!strstr(mbuf, "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'"))
+               while (!strstr(mbuf, "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'") &&
+                               !strstr(mbuf, "<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\""))
                        {
                        if (strstr(mbuf, "/stream:features>"))
                                goto shut;