Return-Path: Received: from mail-io1-f67.google.com ([209.85.166.67]:40199 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726975AbeJUPTT (ORCPT ); Sun, 21 Oct 2018 11:19:19 -0400 Received: by mail-io1-f67.google.com with SMTP id w16-v6so25296139iom.7 for ; Sun, 21 Oct 2018 00:06:00 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20181019230153.28201-1-dbaryshkov@gmail.com> References: <20181019230153.28201-1-dbaryshkov@gmail.com> From: Ard Biesheuvel Date: Sun, 21 Oct 2018 09:05:58 +0200 Message-ID: Subject: Re: [PATCH 1/2] crypto: fix cfb mode decryption To: Dmitry Eremin-Solenikov , James Bottomley Cc: "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , "David S. Miller" , Herbert Xu , stable Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org List-ID: (+ James) On 20 October 2018 at 01:01, Dmitry Eremin-Solenikov wrote: > 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 > --- > 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 >