summaryrefslogtreecommitdiffstats
path: root/ssl/ssltest.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 /ssl/ssltest.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 'ssl/ssltest.c')
-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);
}