]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit0bf462a318648154cea2b8d172182e6d63e1c494
tree2554d40c2df4f4b6b28b917a4d421fe31138cb2e
parentd03f2236722a509b08d5157bb959613ffaf99bfe
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