aboutsummaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssltest.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ssl/ssltest.c b/ssl/ssltest.c
index 9e95bf6a6e..aadfd899d0 100644
--- a/ssl/ssltest.c
+++ b/ssl/ssltest.c
@@ -1612,17 +1612,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);
@@ -1632,6 +1634,7 @@ end:
BIO_printf(bio_err,"\n");
(void)BIO_flush(bio_err);
}
+ if(bn) BN_free(bn);
return(rsa_tmp);
}