X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2Fgenrsa.c;h=ece114c876a6e76410bc28204329028a901ec9a7;hb=4eedf86a163284478140c46edb7b462d33898c93;hp=1599bb7a69d6472bad3bf80cd7ccc78fbbf58dcf;hpb=96afc1cfd53a0ffcca8544fa751eb9bf17749133;p=oweals%2Fopenssl.git diff --git a/apps/genrsa.c b/apps/genrsa.c index 1599bb7a69..ece114c876 100644 --- a/apps/genrsa.c +++ b/apps/genrsa.c @@ -78,7 +78,7 @@ #include #include -#define DEFBITS 512 +#define DEFBITS 1024 #undef PROG #define PROG genrsa_main @@ -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); @@ -265,6 +265,13 @@ bad: BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n", num); +#ifdef OPENSSL_NO_ENGINE + rsa = RSA_new(); +#else + rsa = RSA_new_method(e); +#endif + if (!rsa) + goto err; if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb)) goto err;