summaryrefslogtreecommitdiff
path: root/apps/req.c
diff options
context:
space:
mode:
authorgeoff <geoff>2004-04-26 15:31:32 +0000
committergeoff <geoff>2004-04-26 15:31:32 +0000
commit4c5b46fddc04a585c7dfe85d138d8aacbc4fa4c2 (patch)
treeef7e58265b7f96e6753f1e93e1c7660c62dffc8e /apps/req.c
parent838b1cc001d2537aadaaae21a88680f4664d432c (diff)
downloadopenssl-4c5b46fddc04a585c7dfe85d138d8aacbc4fa4c2.tar.gz
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 16e27d1b3..0f3d496d4 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