crypto: ccree - don't copy zero size ciphertext
authorGilad Ben-Yossef <gilad@benyossef.com>
Tue, 15 Jan 2019 13:43:17 +0000 (15:43 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 25 Jan 2019 10:41:51 +0000 (18:41 +0800)
commit2b5ac17463dcb2411fed506edcf259a89bb538ba
tree2554d40c2df4f4b6b28b917a4d421fe31138cb2e
parent27649c39b56521a2c5d350604688f31db92bf1bc
crypto: ccree - don't copy zero size ciphertext

For decryption in CBC mode we need to save the last ciphertext block
for use as the next IV. However, we were trying to do this also with
zero sized ciphertext resulting in a panic.

Fix this by only doing the copy if the ciphertext length is at least
of IV size.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: stable@vger.kernel.org
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccree/cc_cipher.c