X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2Fs_client.c;h=9cfe2b15804b842fce48e21fd1503a984850a449;hb=1532a839fc3bfd6240d56997ec0df13cbaa5b868;hp=c93531718a4eeb8d2cf8a01b314934d117309ee1;hpb=e1fee477591ee7f86300e1bd65e916cd3a2127bb;p=oweals%2Fopenssl.git diff --git a/apps/s_client.c b/apps/s_client.c index c93531718a..9cfe2b1580 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -79,6 +79,7 @@ typedef unsigned int u_int; #include #include #include +#include #include "s_apps.h" #ifdef WINDOWS @@ -152,6 +153,7 @@ static void sc_usage(void) BIO_printf(bio_err," -bugs - Switch on all SSL implementation bug workarounds\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"); + BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR); } @@ -179,6 +181,7 @@ int MAIN(int argc, char **argv) int prexit = 0; SSL_METHOD *meth=NULL; BIO *sbio; + char *inrand=NULL; #ifdef WINDOWS struct timeval tv; #endif @@ -316,6 +319,11 @@ int MAIN(int argc, char **argv) else if (strcmp(*argv,"-nbio") == 0) { c_nbio=1; } #endif + else if (strcmp(*argv,"-rand") == 0) + { + if (--argc < 1) goto bad; + inrand= *(++argv); + } else { BIO_printf(bio_err,"unknown option %s\n",*argv); @@ -332,7 +340,14 @@ bad: goto end; } - app_RAND_load_file(NULL, bio_err, 0); + if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL + && !RAND_status()) + { + BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n"); + } + if (inrand != NULL) + BIO_printf(bio_err,"%ld semi-random bytes loaded\n", + app_RAND_load_files(inrand)); if (bio_c_out == NULL) { @@ -881,5 +896,7 @@ static void print_stuff(BIO *bio, SSL *s, int full) BIO_printf(bio,"---\n"); if (peer != NULL) X509_free(peer); + /* flush, or debugging output gets mixed with http response */ + BIO_flush(bio); }