Don't ask for -iv for ciphers that need no IV.
authorBen Laurie <ben@openssl.org>
Tue, 3 Mar 2009 15:14:33 +0000 (15:14 +0000)
committerBen Laurie <ben@openssl.org>
Tue, 3 Mar 2009 15:14:33 +0000 (15:14 +0000)
apps/enc.c

index a64c654d4d2b37d8893bdbc05636b478932e60c5..53de51ad72189a0aecb16e3d96c02079a22896a7 100644 (file)
@@ -560,7 +560,8 @@ bad:
                        BIO_printf(bio_err,"invalid hex iv value\n");
                        goto end;
                        }
                        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,
                        {
                        /* No IV was explicitly set and no IV was generated
                         * during EVP_BytesToKey. Hence the IV is undefined,