diff options
-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"); |