Only require -iv for ciphers that use an IV!
authorBen Laurie <ben@openssl.org>
Tue, 3 Mar 2009 15:07:35 +0000 (15:07 +0000)
committerBen Laurie <ben@openssl.org>
Tue, 3 Mar 2009 15:07:35 +0000 (15:07 +0000)
apps/enc.c

index 47c6eb604dfd967a0038ff7b4f4a6b890201cea2..f4f9a4c4a4e58d0a044f8e07129b446a11213046 100644 (file)
@@ -533,7 +533,8 @@ bad:
                        BIO_printf(bio_err,"invalid hex iv value\n");
                        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
                         * during EVP_BytesToKey. Hence the IV is undefined,