diff -urpPX nopatch linux-2.4.33/crypto/cipher.c linux/crypto/cipher.c --- linux-2.4.33/crypto/cipher.c Sun Aug 8 03:26:04 2004 +++ linux/crypto/cipher.c Sun Aug 13 20:33:57 2006 @@ -147,6 +147,15 @@ static int ecb_encrypt(struct crypto_tfm ecb_process, 1, NULL); } +static int ecb_encrypt_iv(struct crypto_tfm *tfm, + struct scatterlist *dst, + struct scatterlist *src, + unsigned int nbytes, u8 *iv) +{ + ecb_encrypt(tfm, dst, src, nbytes); + return -ENOSYS; +} + static int ecb_decrypt(struct crypto_tfm *tfm, struct scatterlist *dst, struct scatterlist *src, @@ -157,6 +166,15 @@ static int ecb_decrypt(struct crypto_tfm ecb_process, 1, NULL); } +static int ecb_decrypt_iv(struct crypto_tfm *tfm, + struct scatterlist *dst, + struct scatterlist *src, + unsigned int nbytes, u8 *iv) +{ + ecb_decrypt(tfm, dst, src, nbytes); + return -ENOSYS; +} + static int cbc_encrypt(struct crypto_tfm *tfm, struct scatterlist *dst, struct scatterlist *src, @@ -235,6 +253,11 @@ int crypto_init_cipher_ops(struct crypto case CRYPTO_TFM_MODE_ECB: ops->cit_encrypt = ecb_encrypt; ops->cit_decrypt = ecb_decrypt; +/* These should have been nocrypt_iv, but patch-cryptoloop-jari-2.4.22.0 + * (and its other revisions) directly calls the *_iv() functions even in + * ECB mode and ignores their return value. */ + ops->cit_encrypt_iv = ecb_encrypt_iv; + ops->cit_decrypt_iv = ecb_decrypt_iv; break; case CRYPTO_TFM_MODE_CBC: