02c335c23bf5fa225a467c19f2c063fb0dc7b8c3Timo Sirainen# The patch is based on the following commit from the upstream:
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen# https://github.com/openssl/openssl/commit/4e48c77572a9a96a301e362a3646cd3cc7eca0f9
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen# The fix is patched until the new version becomes available
16f816d3f3c32ae3351834253f52ddd0212bcbf3Timo Sirainen# from the upstream.
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen--- a/apps/s_client.c
a2f250a332dfc1e6cd4ffd196c621eb9dbf7b8a1Timo Sirainen+++ b/apps/s_client.c
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen@@ -1640,8 +1640,8 @@
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen "xmlns='jabber:client' to='%s' version='1.0'>", host);
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen seen = BIO_read(sbio, mbuf, BUFSIZZ);
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen mbuf[seen] = 0;
d051664df497582e1eb75a9f238d04b65e858db8Timo Sirainen- while (!strstr
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen- (mbuf, "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'")) {
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen+ while (!strstr(mbuf, "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'") &&
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen+ !strstr(mbuf, "<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"")) {
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen if (strstr(mbuf, "/stream:features>"))
bb10ebcf076c959c752f583746d83805d7686df8Timo Sirainen goto shut;
bb10ebcf076c959c752f583746d83805d7686df8Timo Sirainen seen = BIO_read(sbio, mbuf, BUFSIZZ);
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen