diff options
Diffstat (limited to 'apps/genrsa.c')
-rw-r--r-- | apps/genrsa.c | 9 |
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; |