enc: "bad decrypt" only in decryption

CLA: trivial

Signed-off-by: Mathieu Tortuyaux <mathieu.tortuyaux@gmail.com>

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22134)
This commit is contained in:
Mathieu Tortuyaux 2023-09-18 16:02:21 +02:00 committed by Pauli
parent e40d538ad7
commit 0e138b7b59

View File

@ -701,7 +701,10 @@ int enc_main(int argc, char **argv)
break;
}
if (!BIO_flush(wbio)) {
BIO_printf(bio_err, "bad decrypt\n");
if (enc)
BIO_printf(bio_err, "bad encrypt\n");
else
BIO_printf(bio_err, "bad decrypt\n");
goto end;
}