]> git.hungrycats.org Git - linux/commit
crypto: ccree - fix iv handling
authorGilad Ben-Yossef <gilad@benyossef.com>
Sun, 1 Jul 2018 07:02:36 +0000 (08:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Aug 2018 19:02:43 +0000 (21:02 +0200)
commita2a9b8b34cc83b7a21002ba021b5057ae6e6a8ee
tree4c7f34b83c60c9eb0763b6d808cda66eef304519
parent4e2befa3feeb4da592b61dc9f03b36a40c2df566
crypto: ccree - fix iv handling

commit 00904aa0cd59a36d659ec93d272309e2174bcb5b upstream.

We were copying our last cipher block into the request for use as IV for
all modes of operations. Fix this by discerning the behaviour based on
the mode of operation used: copy ciphertext for CBC, update counter for
CTR.

CC: stable@vger.kernel.org
Fixes: 63ee04c8b491 ("crypto: ccree - add skcipher support")
Reported by: Hadar Gat <hadar.gat@arm.com>
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/ccree/cc_cipher.c