[BACK]Return to s_client.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / openssl

Diff for /src/usr.bin/openssl/s_client.c between version 1.14 and 1.15

version 1.14, 2015/07/17 16:07:44 version 1.15, 2015/08/11 05:01:03
Line 237 
Line 237 
         BIO_printf(bio_err, "                 'prot' defines which one to assume.  Currently,\n");          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, "                 only \"smtp\", \"lmtp\", \"pop3\", \"imap\", \"ftp\" and \"xmpp\"\n");
         BIO_printf(bio_err, "                 are supported.\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  #ifndef OPENSSL_NO_ENGINE
         BIO_printf(bio_err, " -engine id    - Initialise and use the specified engine\n");          BIO_printf(bio_err, " -engine id    - Initialise and use the specified engine\n");
 #endif  #endif
Line 334 
Line 335 
         char *port = PORT_STR;          char *port = PORT_STR;
         int full_log = 1;          int full_log = 1;
         char *host = SSL_HOST_NAME;          char *host = SSL_HOST_NAME;
           char *xmpphost = NULL;
         char *proxy = NULL, *connect = NULL;          char *proxy = NULL, *connect = NULL;
         char *cert_file = NULL, *key_file = NULL;          char *cert_file = NULL, *key_file = NULL;
         int cert_format = FORMAT_PEM, key_format = FORMAT_PEM;          int cert_format = FORMAT_PEM, key_format = FORMAT_PEM;
Line 414 
Line 416 
                         if (--argc < 1)                          if (--argc < 1)
                                 goto bad;                                  goto bad;
                         proxy = *(++argv);                          proxy = *(++argv);
                   } else if (strcmp(*argv,"-xmpphost") == 0) {
                           if (--argc < 1)
                                   goto bad;
                           xmpphost= *(++argv);
                 } else if (strcmp(*argv, "-verify") == 0) {                  } else if (strcmp(*argv, "-verify") == 0) {
                         verify = SSL_VERIFY_PEER;                          verify = SSL_VERIFY_PEER;
                         if (--argc < 1)                          if (--argc < 1)
Line 982 
Line 988 
                 int seen = 0;                  int seen = 0;
                 BIO_printf(sbio, "<stream:stream "                  BIO_printf(sbio, "<stream:stream "
                     "xmlns:stream='http://etherx.jabber.org/streams' "                      "xmlns:stream='http://etherx.jabber.org/streams' "
                     "xmlns='jabber:client' to='%s' version='1.0'>", host);                      "xmlns='jabber:client' to='%s' version='1.0'>", xmpphost ? xmpphost : host);
                 seen = BIO_read(sbio, mbuf, BUFSIZZ);                  seen = BIO_read(sbio, mbuf, BUFSIZZ);
   
                   if (seen <= 0)
                           goto shut;
   
                 mbuf[seen] = 0;                  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'") &&
                         if (strstr(mbuf, "/stream:features>"))                         !strstr(mbuf, "<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"")) {
                                 goto shut;  
                         seen = BIO_read(sbio, mbuf, BUFSIZZ);                          seen = BIO_read(sbio, mbuf, BUFSIZZ);
   
                           if (seen <= 0)
                                   goto shut;
   
                         mbuf[seen] = 0;                          mbuf[seen] = 0;
                 }                  }
                 BIO_printf(sbio, "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");                  BIO_printf(sbio, "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15