diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-04-06 21:42:11 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-04-06 21:42:11 +0000 |
commit | 15671a90a9455e1909040a667557ea904692c4f4 (patch) | |
tree | 9fcd22ece553d91aca1dec7ac6810fd2c3ae5af5 | |
parent | 0048464449f5e72cd55fad628671e39064219e8c (diff) |
PR: 1677
Submitted by: Vennemann <rvennemann@cool.ms>
Approved by: steve@openssl.org
Call RSA_new() after ENGINE has been set up.
-rw-r--r-- | apps/genrsa.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/genrsa.c b/apps/genrsa.c index 1599bb7a69..a9f40e8adf 100644 --- a/apps/genrsa.c +++ b/apps/genrsa.c @@ -105,9 +105,9 @@ int MAIN(int argc, char **argv) char *inrand=NULL; BIO *out=NULL; BIGNUM *bn = BN_new(); - RSA *rsa = RSA_new(); + RSA *rsa = NULL; - if(!bn || !rsa) goto err; + if(!bn) goto err; apps_startup(); BN_GENCB_set(&cb, genrsa_cb, bio_err); @@ -266,6 +266,10 @@ bad: BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n", num); + rsa = RSA_new(); + if (!rsa) + goto err; + if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb)) goto err; |