[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.9 and 1.10

version 1.9, 2014/12/02 19:44:49 version 1.10, 2014/12/10 15:24:01
Line 253 
Line 253 
 #ifndef OPENSSL_NO_NEXTPROTONEG  #ifndef OPENSSL_NO_NEXTPROTONEG
         BIO_printf(bio_err, " -nextprotoneg arg - enable NPN extension, considering named protocols supported (comma-separated list)\n");          BIO_printf(bio_err, " -nextprotoneg arg - enable NPN extension, considering named protocols supported (comma-separated list)\n");
 #endif  #endif
           BIO_printf(bio_err, " -alpn arg         - enable ALPN extension, considering named protocols supported (comma-separated list)\n");
 #ifndef OPENSSL_NO_SRTP  #ifndef OPENSSL_NO_SRTP
         BIO_printf(bio_err, " -use_srtp profiles - Offer SRTP key management with a colon-separated profile list\n");          BIO_printf(bio_err, " -use_srtp profiles - Offer SRTP key management with a colon-separated profile list\n");
 #endif  #endif
Line 374 
Line 375 
 #ifndef OPENSSL_NO_NEXTPROTONEG  #ifndef OPENSSL_NO_NEXTPROTONEG
         const char *next_proto_neg_in = NULL;          const char *next_proto_neg_in = NULL;
 #endif  #endif
           const char *alpn_in = NULL;
         char *sess_in = NULL;          char *sess_in = NULL;
         char *sess_out = NULL;          char *sess_out = NULL;
         struct sockaddr peer;          struct sockaddr peer;
Line 544 
Line 546 
                         next_proto_neg_in = *(++argv);                          next_proto_neg_in = *(++argv);
                 }                  }
 #endif  #endif
                 else if (strcmp(*argv, "-serverpref") == 0)                  else if (strcmp(*argv, "-alpn") == 0) {
                           if (--argc < 1)
                                   goto bad;
                           alpn_in = *(++argv);
                   } else if (strcmp(*argv, "-serverpref") == 0)
                         off |= SSL_OP_CIPHER_SERVER_PREFERENCE;                          off |= SSL_OP_CIPHER_SERVER_PREFERENCE;
                 else if (strcmp(*argv, "-legacy_renegotiation") == 0)                  else if (strcmp(*argv, "-legacy_renegotiation") == 0)
                         ; /* no-op */                          ; /* no-op */
Line 736 
Line 742 
         if (next_proto.data)          if (next_proto.data)
                 SSL_CTX_set_next_proto_select_cb(ctx, next_proto_cb, &next_proto);                  SSL_CTX_set_next_proto_select_cb(ctx, next_proto_cb, &next_proto);
 #endif  #endif
           if (alpn_in) {
                   unsigned short alpn_len;
                   unsigned char *alpn = next_protos_parse(&alpn_len, alpn_in);
   
                   if (alpn == NULL) {
                           BIO_printf(bio_err, "Error parsing -alpn argument\n");
                           goto end;
                   }
                   SSL_CTX_set_alpn_protos(ctx, alpn, alpn_len);
                   free(alpn);
           }
   
         if (state)          if (state)
                 SSL_CTX_set_info_callback(ctx, apps_ssl_info_callback);                  SSL_CTX_set_info_callback(ctx, apps_ssl_info_callback);
         if (cipher != NULL)          if (cipher != NULL)
Line 1423 
Line 1440 
                 BIO_write(bio, "\n", 1);                  BIO_write(bio, "\n", 1);
         }          }
 #endif  #endif
           {
                   const unsigned char *proto;
                   unsigned int proto_len;
                   SSL_get0_alpn_selected(s, &proto, &proto_len);
                   if (proto_len > 0) {
                           BIO_printf(bio, "ALPN protocol: ");
                           BIO_write(bio, proto, proto_len);
                           BIO_write(bio, "\n", 1);
                   } else
                           BIO_printf(bio, "No ALPN negotiated\n");
           }
   
 #ifndef OPENSSL_NO_SRTP  #ifndef OPENSSL_NO_SRTP
         {          {

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10