summaryrefslogtreecommitdiffstats
path: root/apps/genrsa.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2021-02-08 14:20:01 -0500
committerPauli <ppzgs1@gmail.com>2021-02-12 08:34:17 +1000
commit03bbd346f4410c329d472cc043fb6c49f6688eba (patch)
tree4404d27a430f7a3c8a33ddd6d0633fb35d9a4065 /apps/genrsa.c
parentd0190e11639956677747f6bc7bb5bcd610fd8600 (diff)
Fetch cipher after loading providers
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14135)
Diffstat (limited to 'apps/genrsa.c')
-rw-r--r--apps/genrsa.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/genrsa.c b/apps/genrsa.c
index 39c23e7df8..cd99b53a3b 100644
--- a/apps/genrsa.c
+++ b/apps/genrsa.c
@@ -86,7 +86,7 @@ int genrsa_main(int argc, char **argv)
int ret = 1, num = DEFBITS, private = 0, primes = DEFPRIMES;
unsigned long f4 = RSA_F4;
char *outfile = NULL, *passoutarg = NULL, *passout = NULL;
- char *prog, *hexe, *dece;
+ char *prog, *hexe, *dece, *ciphername = NULL;
OPTION_CHOICE o;
int traditional = 0;
@@ -131,8 +131,7 @@ opthelp:
passoutarg = opt_arg();
break;
case OPT_CIPHER:
- if (!opt_cipher(opt_unknown(), &enc))
- goto end;
+ ciphername = opt_unknown();
break;
case OPT_PRIMES:
if (!opt_int(opt_arg(), &primes))
@@ -166,6 +165,10 @@ opthelp:
app_RAND_load();
private = 1;
+ if (ciphername != NULL) {
+ if (!opt_cipher(ciphername, &enc))
+ goto end;
+ }
if (!app_passwd(NULL, passoutarg, NULL, &passout)) {
BIO_printf(bio_err, "Error getting password\n");
goto end;