summaryrefslogtreecommitdiffstats
path: root/apps/req.c
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2004-04-26 15:31:35 +0000
committerGeoff Thorpe <geoff@openssl.org>2004-04-26 15:31:35 +0000
commitbcfea9fb25738b007cfef48d5070376c4398675a (patch)
tree4c60cc4cb29540bf98072e95c712495a129cc646 /apps/req.c
parentf3f52d7f45967af4f70045921dfa12e6faedcc92 (diff)
Allow RSA key-generation to specify an arbitrary public exponent. Jelte
proposed the change and submitted the patch, I jiggled it slightly and adjusted the other parts of openssl that were affected. PR: 867 Submitted by: Jelte Jansen Reviewed by: Geoff Thorpe
Diffstat (limited to 'apps/req.c')
-rw-r--r--apps/req.c6
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