diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2022-09-24 13:44:47 +0200 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2023-03-14 17:26:49 +0100 |
commit | 091fef4936da93deee585dadd994144b330485d4 (patch) | |
tree | 2b9eda01b41b14d48603dc47f8015de3fbde5a44 /apps | |
parent | 5ec4f45ef56dfe7733b70413f8e78426f19fb433 (diff) |
apps/{dsa,ec,rsa,pkey}.c: harmonize coding w.r.t. 'pubin' variable
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19076)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dsa.c | 4 | ||||
-rw-r--r-- | apps/ec.c | 4 | ||||
-rw-r--r-- | apps/rsa.c | 2 |
3 files changed, 3 insertions, 7 deletions
diff --git a/apps/dsa.c b/apps/dsa.c index 9dda3b2c2f..d6030c44f6 100644 --- a/apps/dsa.c +++ b/apps/dsa.c @@ -167,9 +167,7 @@ int dsa_main(int argc, char **argv) if (!opt_cipher(ciphername, &enc)) goto end; - private = pubin || pubout ? 0 : 1; - if (text && !pubin) - private = 1; + private = !pubin && (!pubout || text); if (!app_passwd(passinarg, passoutarg, &passin, &passout)) { BIO_printf(bio_err, "Error getting passwords\n"); @@ -163,9 +163,7 @@ int ec_main(int argc, char **argv) if (!opt_cipher(ciphername, &enc)) goto opthelp; - private = param_out || pubin || pubout ? 0 : 1; - if (text && !pubin) - private = 1; + private = !pubin && (text || (!param_out && !pubout)); if (!app_passwd(passinarg, passoutarg, &passin, &passout)) { BIO_printf(bio_err, "Error getting passwords\n"); diff --git a/apps/rsa.c b/apps/rsa.c index 77bab992db..09ab81d5ae 100644 --- a/apps/rsa.c +++ b/apps/rsa.c @@ -223,7 +223,7 @@ int rsa_main(int argc, char **argv) if (!opt_cipher(ciphername, &enc)) goto opthelp; - private = (text && !pubin) || (!pubout && !noout) ? 1 : 0; + private = (text && !pubin) || (!pubout && !noout); if (!app_passwd(passinarg, passoutarg, &passin, &passout)) { BIO_printf(bio_err, "Error getting passwords\n"); |