Add JPAKE.
[oweals/openssl.git] / apps / s_client.c
index f038a553238e3a1ea55b8af71d38d7872d7463ff..93c62b4386a080324d4ef79b5edd9510abcc53b0 100644 (file)
@@ -418,7 +418,6 @@ int MAIN(int argc, char **argv)
        int stdin_set = 0;
 #endif
 #endif
-
 #ifndef OPENSSL_NO_TLSEXT
        char *servername = NULL; 
         tlsextctx tlsextcbp = 
@@ -430,6 +429,7 @@ int MAIN(int argc, char **argv)
        int peerlen = sizeof(peer);
        int enable_timeouts = 0 ;
        long socket_mtu = 0;
+       char *jpake_secret = NULL;
 
 #if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3)
        meth=SSLv23_client_method();
@@ -699,6 +699,11 @@ int MAIN(int argc, char **argv)
                        /* meth=TLSv1_client_method(); */
                        }
 #endif
+               else if (strcmp(*argv,"-jpake") == 0)
+                       {
+                       if (--argc < 1) goto bad;
+                       jpake_secret = *++argv;
+                       }
                else
                        {
                        BIO_printf(bio_err,"unknown option %s\n",*argv);
@@ -974,8 +979,6 @@ re_start:
        else
                sbio=BIO_new_socket(s,BIO_NOCLOSE);
 
-
-
        if (nbio_test)
                {
                BIO *test;
@@ -1020,6 +1023,9 @@ SSL_set_tlsext_status_ids(con, ids);
                }
 #endif
 
+       if (jpake_secret)
+               jpake_client_auth(bio_c_out, sbio, jpake_secret);
+
        SSL_set_bio(con,sbio,sbio);
        SSL_set_connect_state(con);