OSDN Git Service

crypto: ccree - fix iv handling
authorGilad Ben-Yossef <gilad@benyossef.com>
Sun, 1 Jul 2018 07:02:36 +0000 (08:02 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 8 Jul 2018 16:33:35 +0000 (00:33 +0800)
commit00904aa0cd59a36d659ec93d272309e2174bcb5b
treee9db016f31f8ff59174057779d4fb88326bc771c
parent76715095933b3a2e6082e171bc82ecd90baf9af0
crypto: ccree - fix iv handling

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>
drivers/crypto/ccree/cc_cipher.c