diff options
Diffstat (limited to 'apps/req.c')
-rw-r--r-- | apps/req.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/req.c b/apps/req.c index 16e27d1b38..0f3d496d47 100644 --- a/apps/req.c +++ b/apps/req.c @@ -748,12 +748,16 @@ bad: if (pkey_type == TYPE_RSA) { RSA *rsa = RSA_new(); - if(!rsa || !RSA_generate_key_ex(rsa, newkey, 0x10001, &cb) || + BIGNUM *bn = BN_new(); + if(!bn || !rsa || !BN_set_word(bn, 0x10001) || + !RSA_generate_key_ex(rsa, newkey, bn, &cb) || !EVP_PKEY_assign_RSA(pkey, rsa)) { + if(bn) BN_free(bn); if(rsa) RSA_free(rsa); goto end; } + BN_free(bn); } else #endif |