Make gcc 2.95.2 happy here, too.
[openssl.git] / apps / s_client.c
index f09fae5f678ff6e4f3c3c89c8d2d923f401f11af..c4c3b0e94a59b6b6746bd2f061d0b719f35f2218 100644 (file)
@@ -91,10 +91,6 @@ typedef unsigned int u_int;
 #undef FIONBIO
 #endif
 
-#if defined(NO_RSA) && !defined(NO_SSL2)
-#define NO_SSL2
-#endif
-
 #undef PROG
 #define PROG   s_client_main
 
@@ -152,11 +148,13 @@ static void sc_usage(void)
        BIO_printf(bio_err," -tls1         - just use TLSv1\n");
        BIO_printf(bio_err," -no_tls1/-no_ssl3/-no_ssl2 - turn off that protocol\n");
        BIO_printf(bio_err," -bugs         - Switch on all SSL implementation bug workarounds\n");
-       BIO_printf(bio_err," -cipher       - prefered cipher to use, use the 'openssl ciphers'\n");
+       BIO_printf(bio_err," -cipher       - preferred cipher to use, use the 'openssl ciphers'\n");
        BIO_printf(bio_err,"                 command to see what is available\n");
 
        }
 
+int MAIN(int, char **);
+
 int MAIN(int argc, char **argv)
        {
        int off=0;
@@ -341,7 +339,8 @@ bad:
                        }
                }
 
-       SSLeay_add_ssl_algorithms();
+       OpenSSL_add_ssl_algorithms();
+       SSL_load_error_strings();
        ctx=SSL_CTX_new(meth);
        if (ctx == NULL)
                {
@@ -356,7 +355,11 @@ bad:
 
        if (state) SSL_CTX_set_info_callback(ctx,apps_ssl_info_callback);
        if (cipher != NULL)
-               SSL_CTX_set_cipher_list(ctx,cipher);
+               if(!SSL_CTX_set_cipher_list(ctx,cipher)) {
+               BIO_printf(bio_err,"error setting cipher list\n");
+               ERR_print_errors(bio_err);
+               goto end;
+       }
 #if 0
        else
                SSL_CTX_set_cipher_list(ctx,getenv("SSL_CIPHER"));
@@ -369,14 +372,13 @@ bad:
        if ((!SSL_CTX_load_verify_locations(ctx,CAfile,CApath)) ||
                (!SSL_CTX_set_default_verify_paths(ctx)))
                {
-               /* BIO_printf(bio_err,"error seting default verify locations\n"); */
+               /* BIO_printf(bio_err,"error setting default verify locations\n"); */
                ERR_print_errors(bio_err);
                /* goto end; */
                }
 
-       SSL_load_error_strings();
 
-       con=(SSL *)SSL_new(ctx);
+       con=SSL_new(ctx);
 /*     SSL_set_cipher_list(con,"RC4-MD5"); */
 
 re_start:
@@ -506,6 +508,7 @@ re_start:
                         * are any keypresses. Note: this is a hack, in a proper
                         * Windows application we wouldn't do this.
                         */
+                       i=0;
                        if(!write_tty) {
                                if(read_tty) {
                                        tv.tv_sec = 1;