X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=ssl%2Fssltest.c;h=f0b3c93ba5f0c6b2b7085e722fb0572e182fc4b9;hp=68eb6545725e25e576fe1761684c432242585621;hb=d095b68d63ca91d8e42afb5dc46bb16ed4e4e25d;hpb=344e86645d99f8e912567a8e76ce88e9e897e58c diff --git a/ssl/ssltest.c b/ssl/ssltest.c index 68eb654572..f0b3c93ba5 100644 --- a/ssl/ssltest.c +++ b/ssl/ssltest.c @@ -138,6 +138,10 @@ #endif #include #include +#include +#include +#include +#include #define _XOPEN_SOURCE_EXTENDED 1 /* Or gethostname won't be declared properly on Compaq platforms (at least with DEC C). @@ -1609,17 +1613,19 @@ static RSA *rsa_tmp=NULL; static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int is_export, int keylength) { + BIGNUM *bn = NULL; if (rsa_tmp == NULL) { + bn = BN_new(); rsa_tmp = RSA_new(); - if(!rsa_tmp) + if(!bn || !rsa_tmp || !BN_set_word(bn, RSA_F4)) { BIO_printf(bio_err, "Memory error..."); goto end; } BIO_printf(bio_err,"Generating temp (%d bit) RSA key...",keylength); (void)BIO_flush(bio_err); - if(!RSA_generate_key_ex(rsa_tmp,keylength,RSA_F4,NULL)) + if(!RSA_generate_key_ex(rsa_tmp,keylength,bn,NULL)) { BIO_printf(bio_err, "Error generating key."); RSA_free(rsa_tmp); @@ -1629,6 +1635,7 @@ end: BIO_printf(bio_err,"\n"); (void)BIO_flush(bio_err); } + if(bn) BN_free(bn); return(rsa_tmp); }