public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] crypto: fix cfb mode decryption
@ 2018-10-19 23:01 Dmitry Eremin-Solenikov
  2018-10-19 23:01 ` [PATCH 2/2] crypto: testmgr: add AES-CFB tests Dmitry Eremin-Solenikov
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Dmitry Eremin-Solenikov @ 2018-10-19 23:01 UTC (permalink / raw)
  To: linux-crypto; +Cc: David S. Miller, Herbert Xu, stable

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
---
 crypto/cfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-11-09 19:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-19 23:01 [PATCH 1/2] crypto: fix cfb mode decryption Dmitry Eremin-Solenikov
2018-10-19 23:01 ` [PATCH 2/2] crypto: testmgr: add AES-CFB tests Dmitry Eremin-Solenikov
2018-10-21  7:06   ` Ard Biesheuvel
2018-10-21  7:05 ` [PATCH 1/2] crypto: fix cfb mode decryption Ard Biesheuvel
2018-10-21  8:07   ` James Bottomley
2018-10-21  8:58     ` Ard Biesheuvel
2018-10-21  9:00       ` James Bottomley
2018-10-21  9:07         ` Ard Biesheuvel
2018-11-01  8:32     ` Dmitry Eremin-Solenikov
2018-11-01  8:41       ` Herbert Xu
2018-11-01  8:42         ` Dmitry Eremin-Solenikov
2018-11-09  9:52 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox