Always use SSLv23_{client,server}_method in s_client.c and s_server.c,
[openssl.git] / apps / s_client.c
index dbc0700ded2fc9da4d4210a2fe06f0de4dc84752..6870368ff1f2c90475963b18c5e0666850f81aaa 100644 (file)
@@ -362,7 +362,7 @@ static void sc_usage(void)
 # endif
 #endif
        BIO_printf(bio_err," -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n");
-       BIO_printf(bio_err," -use_srtp profiles - Offer SRTP key management with a colon-separated profile list");
+       BIO_printf(bio_err," -use_srtp profiles - Offer SRTP key management with a colon-separated profile list\n");
        BIO_printf(bio_err," -keymatexport label   - Export keying material using label\n");
        BIO_printf(bio_err," -keymatexportlen len  - Export len bytes of keying material (default 20)\n");
        }
@@ -622,13 +622,7 @@ int MAIN(int argc, char **argv)
        SRP_ARG srp_arg = {NULL,NULL,0,0,0,1024};
 #endif
 
-#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
        meth=SSLv23_client_method();
-#elif !defined(OPENSSL_NO_SSL3)
-       meth=SSLv3_client_method();
-#elif !defined(OPENSSL_NO_SSL2)
-       meth=SSLv2_client_method();
-#endif
 
        apps_startup();
        c_Pause=0;
@@ -2018,6 +2012,8 @@ static void print_stuff(BIO *bio, SSL *s, int full)
                        BIO_write(bio,"\n",1);
                        }
 
+               ssl_print_sigalgs(bio, s);
+
                BIO_printf(bio,"---\nSSL handshake has read %ld bytes and written %ld bytes\n",
                        BIO_number_read(SSL_get_rbio(s)),
                        BIO_number_written(SSL_get_wbio(s)));
@@ -2077,30 +2073,33 @@ static void print_stuff(BIO *bio, SSL *s, int full)
        }
  
        SSL_SESSION_print(bio,SSL_get_session(s));
-       if (keymatexportlabel != NULL) {
+       if (keymatexportlabel != NULL)
+               {
                BIO_printf(bio, "Keying material exporter:\n");
                BIO_printf(bio, "    Label: '%s'\n", keymatexportlabel);
                BIO_printf(bio, "    Length: %i bytes\n", keymatexportlen);
                exportedkeymat = OPENSSL_malloc(keymatexportlen);
-               if (exportedkeymat != NULL) {
-                       i = SSL_export_keying_material(s, exportedkeymat,
-                                                      keymatexportlen,
-                                                      keymatexportlabel,
-                                                    strlen(keymatexportlabel),
-                                                      NULL, 0, 0);
-                       if (i != keymatexportlen) {
-                               BIO_printf(bio,
-                                          "    Error: return value %i\n", i);
-                       } else {
+               if (exportedkeymat != NULL)
+                       {
+                       if (!SSL_export_keying_material(s, exportedkeymat,
+                                                       keymatexportlen,
+                                                       keymatexportlabel,
+                                                       strlen(keymatexportlabel),
+                                                       NULL, 0, 0))
+                               {
+                               BIO_printf(bio, "    Error\n");
+                               }
+                       else
+                               {
                                BIO_printf(bio, "    Keying material: ");
                                for (i=0; i<keymatexportlen; i++)
                                        BIO_printf(bio, "%02X",
                                                   exportedkeymat[i]);
                                BIO_printf(bio, "\n");
-                       }
+                               }
                        OPENSSL_free(exportedkeymat);
+                       }
                }
-       }
        BIO_printf(bio,"---\n");
        if (peer != NULL)
                X509_free(peer);