=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/openssl/s_client.c,v retrieving revision 1.14 retrieving revision 1.15 diff -c -r1.14 -r1.15 *** src/usr.bin/openssl/s_client.c 2015/07/17 16:07:44 1.14 --- src/usr.bin/openssl/s_client.c 2015/08/11 05:01:03 1.15 *************** *** 1,4 **** ! /* $OpenBSD: s_client.c,v 1.14 2015/07/17 16:07:44 doug Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * --- 1,4 ---- ! /* $OpenBSD: s_client.c,v 1.15 2015/08/11 05:01:03 landry Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * *************** *** 237,242 **** --- 237,243 ---- BIO_printf(bio_err, " 'prot' defines which one to assume. Currently,\n"); BIO_printf(bio_err, " only \"smtp\", \"lmtp\", \"pop3\", \"imap\", \"ftp\" and \"xmpp\"\n"); BIO_printf(bio_err, " are supported.\n"); + BIO_printf(bio_err, " -xmpphost host - connect to this virtual host on the xmpp server\n"); #ifndef OPENSSL_NO_ENGINE BIO_printf(bio_err, " -engine id - Initialise and use the specified engine\n"); #endif *************** *** 334,339 **** --- 335,341 ---- char *port = PORT_STR; int full_log = 1; char *host = SSL_HOST_NAME; + char *xmpphost = NULL; char *proxy = NULL, *connect = NULL; char *cert_file = NULL, *key_file = NULL; int cert_format = FORMAT_PEM, key_format = FORMAT_PEM; *************** *** 414,419 **** --- 416,425 ---- if (--argc < 1) goto bad; proxy = *(++argv); + } else if (strcmp(*argv,"-xmpphost") == 0) { + if (--argc < 1) + goto bad; + xmpphost= *(++argv); } else if (strcmp(*argv, "-verify") == 0) { verify = SSL_VERIFY_PEER; if (--argc < 1) *************** *** 982,994 **** int seen = 0; BIO_printf(sbio, "", host); seen = BIO_read(sbio, mbuf, BUFSIZZ); mbuf[seen] = 0; ! while (!strstr(mbuf, "")) ! goto shut; seen = BIO_read(sbio, mbuf, BUFSIZZ); mbuf[seen] = 0; } BIO_printf(sbio, ""); --- 988,1007 ---- int seen = 0; BIO_printf(sbio, "", xmpphost ? xmpphost : host); seen = BIO_read(sbio, mbuf, BUFSIZZ); + + if (seen <= 0) + goto shut; + mbuf[seen] = 0; ! while (!strstr(mbuf, "");