From: Dr. Stephen Henson Date: Mon, 6 Apr 2009 21:42:11 +0000 (+0000) Subject: PR: 1677 X-Git-Tag: OpenSSL_1_0_0-beta2~34 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=15671a90a9455e1909040a667557ea904692c4f4;p=oweals%2Fopenssl.git PR: 1677 Submitted by: Vennemann Approved by: steve@openssl.org Call RSA_new() after ENGINE has been set up. --- 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;