enc: "bad decrypt" only in decryption
authorMathieu Tortuyaux <mathieu.tortuyaux@gmail.com>
Mon, 18 Sep 2023 14:02:21 +0000 (16:02 +0200)
committerPauli <pauli@openssl.org>
Tue, 19 Sep 2023 22:12:07 +0000 (08:12 +1000)
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)

apps/enc.c

index 26e009e43791cd8431b11d3009e801fe81735769..d94f5236d7bbee617230f1382369876132cf5f11 100644 (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;
     }