Only require -iv for ciphers that use an IV!

This commit is contained in:
Ben Laurie
2009-03-03 15:07:35 +00:00
parent 1eee8a4226
commit 69120ad199

View File

@@ -533,7 +533,8 @@ bad:
BIO_printf(bio_err,"invalid hex iv value\n"); BIO_printf(bio_err,"invalid hex iv value\n");
goto end; goto end;
} }
if ((hiv == NULL) && (str == NULL)) if ((hiv == NULL) && (str == NULL)
&& EVP_CIPHER_iv_length(cipher) != 0)
{ {
/* No IV was explicitly set and no IV was generated /* No IV was explicitly set and no IV was generated
* during EVP_BytesToKey. Hence the IV is undefined, * during EVP_BytesToKey. Hence the IV is undefined,