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