From: Dmitry Eremin-Solenikov Date: Fri, 19 Oct 2018 23:01:52 +0000 (+0300) Subject: crypto: cfb - fix decryption X-Git-Tag: v4.19.14~49 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99dcd45f274e10b0a4b04f2836218762ed2294d4;p=platform%2Fkernel%2Flinux-rpi.git crypto: cfb - fix decryption commit fa4600734b74f74d9169c3015946d4722f8bcf79 upstream. crypto_cfb_decrypt_segment() incorrectly XOR'ed generated keystream with IV, rather than with data stream, resulting in incorrect decryption. Test vectors will be added in the next patch. Signed-off-by: Dmitry Eremin-Solenikov Cc: stable@vger.kernel.org Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- diff --git a/crypto/cfb.c b/crypto/cfb.c index 20987d0..e81e456 100644 --- a/crypto/cfb.c +++ b/crypto/cfb.c @@ -144,7 +144,7 @@ static int crypto_cfb_decrypt_segment(struct skcipher_walk *walk, do { crypto_cfb_encrypt_one(tfm, iv, dst); - crypto_xor(dst, iv, bsize); + crypto_xor(dst, src, bsize); iv = src; src += bsize;