summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/apps/enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/apps/enc.c')
-rw-r--r--crypto/openssl/apps/enc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/openssl/apps/enc.c b/crypto/openssl/apps/enc.c
index 2101b4c..ef0e872 100644
--- a/crypto/openssl/apps/enc.c
+++ b/crypto/openssl/apps/enc.c
@@ -515,6 +515,14 @@ bad:
BIO_printf(bio_err,"invalid hex iv value\n");
goto end;
}
+ if ((hiv == NULL) && (str == NULL))
+ {
+ /* No IV was explicitly set and no IV was generated
+ * during EVP_BytesToKey. Hence the IV is undefined,
+ * making correct decryption impossible. */
+ BIO_printf(bio_err, "iv undefined\n");
+ goto end;
+ }
if ((hkey != NULL) && !set_hex(hkey,key,24))
{
BIO_printf(bio_err,"invalid hex key value\n");
OpenPOWER on IntegriCloud