diff options
author | Lutz Jänicke <jaenicke@openssl.org> | 2001-07-03 10:31:11 +0000 |
---|---|---|
committer | Lutz Jänicke <jaenicke@openssl.org> | 2001-07-03 10:31:11 +0000 |
commit | 43f9391bcc222f0da5c0d9f8e2ab24d921e29971 (patch) | |
tree | 0c4513b43c13078e77b657f39d01c321908bd2a9 /apps/enc.c | |
parent | c1c971654b24e5917d908c9819fdb22bf58aebda (diff) | |
download | openssl-43f9391bcc222f0da5c0d9f8e2ab24d921e29971.tar.gz |
When only the key is given to "enc", the IV is undefined
(found by Andy Brown <logic@warthog.com>).
Diffstat (limited to 'apps/enc.c')
-rw-r--r-- | apps/enc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/enc.c b/apps/enc.c index 49cae7579c..3c72d05c6c 100644 --- a/apps/enc.c +++ b/apps/enc.c @@ -488,6 +488,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,sizeof key)) { BIO_printf(bio_err,"invalid hex key value\n"); |