diff options
author | Rich Salz <rsalz@akamai.com> | 2021-02-08 14:20:01 -0500 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-02-12 08:34:17 +1000 |
commit | 03bbd346f4410c329d472cc043fb6c49f6688eba (patch) | |
tree | 4404d27a430f7a3c8a33ddd6d0633fb35d9a4065 /apps/gendsa.c | |
parent | d0190e11639956677747f6bc7bb5bcd610fd8600 (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/gendsa.c')
-rw-r--r-- | apps/gendsa.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/gendsa.c b/apps/gendsa.c index 81ab10d07c..c6c84c9a56 100644 --- a/apps/gendsa.c +++ b/apps/gendsa.c @@ -57,7 +57,7 @@ int gendsa_main(int argc, char **argv) EVP_PKEY *pkey = NULL; EVP_PKEY_CTX *ctx = NULL; const EVP_CIPHER *enc = NULL; - char *dsaparams = NULL; + char *dsaparams = NULL, *ciphername = NULL; char *outfile = NULL, *passoutarg = NULL, *passout = NULL, *prog; OPTION_CHOICE o; int ret = 1, private = 0, verbose = 0; @@ -93,8 +93,7 @@ int gendsa_main(int argc, char **argv) goto end; break; case OPT_CIPHER: - if (!opt_cipher(opt_unknown(), &enc)) - goto end; + ciphername = opt_unknown(); break; case OPT_VERBOSE: verbose = 1; @@ -107,9 +106,13 @@ int gendsa_main(int argc, char **argv) argv = opt_rest(); if (argc != 1) goto opthelp; + dsaparams = argv[0]; app_RAND_load(); - dsaparams = argv[0]; + if (ciphername != NULL) { + if (!opt_cipher(ciphername, &enc)) + goto end; + } private = 1; if (!app_passwd(NULL, passoutarg, NULL, &passout)) { |