summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2018-10-20 02:01:52 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2018-11-09 17:40:59 +0800
commitfa4600734b74f74d9169c3015946d4722f8bcf79 (patch)
tree486ab1004b79e24d6800c8a87b6f7ab8aa46276f /crypto
parent7172122be6a4712d699da4d261f92aa5ab3a78b8 (diff)
crypto: cfb - fix decryption
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 <dbaryshkov@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/cfb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/cfb.c b/crypto/cfb.c
index a0d68c09e1b9..fd4e8500e121 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;