]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
crypto: x86/glue_helper - fix storing of new IV in CBC encryption
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Wed, 19 Sep 2012 06:40:30 +0000 (09:40 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 27 Sep 2012 05:29:09 +0000 (13:29 +0800)
Glue_helper incorrectly XORs new IV over old IV at end of CBC encryption
function when it should store. This causes CBC encryption to give
incorrect output on multi-page encryption requests.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/glue_helper.c

index 4854f0f31e4fa99bc65dc555060e9c913c7e3b70..30b3927bd733b6f0c17c0d492621ee1666de2b5a 100644 (file)
@@ -110,7 +110,7 @@ static unsigned int __glue_cbc_encrypt_128bit(const common_glue_func_t fn,
                nbytes -= bsize;
        } while (nbytes >= bsize);
 
-       u128_xor((u128 *)walk->iv, (u128 *)walk->iv, iv);
+       *(u128 *)walk->iv = *iv;
        return nbytes;
 }