From: Jussi Kivilinna Date: Wed, 19 Sep 2012 06:40:30 +0000 (+0300) Subject: crypto: x86/glue_helper - fix storing of new IV in CBC encryption X-Git-Tag: upstream/snapshot3+hdmi~6537^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9f97a27ceee84998999bf3341e6d5d207b05539;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git crypto: x86/glue_helper - fix storing of new IV in CBC encryption 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 Signed-off-by: Herbert Xu --- diff --git a/arch/x86/crypto/glue_helper.c b/arch/x86/crypto/glue_helper.c index 4854f0f..30b3927 100644 --- a/arch/x86/crypto/glue_helper.c +++ b/arch/x86/crypto/glue_helper.c @@ -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; }