crypto: x86/cast5-avx - fix ECB encryption when long sg follows short one
authorEric Biggers <ebiggers@google.com>
Tue, 20 Feb 2018 07:48:12 +0000 (23:48 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Apr 2018 10:12:57 +0000 (12:12 +0200)
commit27bb1e0ce8c15e175867ef25f8ac111af5b2faf1
treed01d231cd756187e39a40b0348e070b27295b77e
parent7246bf30088f570aaa87b6de6bfbe3cd7510e4c6
crypto: x86/cast5-avx - fix ECB encryption when long sg follows short one

commit 8f461b1e02ed546fbd0f11611138da67fd85a30f upstream.

With ecb-cast5-avx, if a 128+ byte scatterlist element followed a
shorter one, then the algorithm accidentally encrypted/decrypted only 8
bytes instead of the expected 128 bytes.  Fix it by setting the
encryption/decryption 'fn' correctly.

Fixes: c12ab20b162c ("crypto: cast5/avx - avoid using temporary stack buffers")
Cc: <stable@vger.kernel.org> # v3.8+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/crypto/cast5_avx_glue.c