1
0
Fork 0

crypto: ccree - fix AEAD decrypt auth fail

commit 2a6bc713f1 upstream.

On AEAD decryption authentication failure we are suppose to
zero out the output plaintext buffer. However, we've missed
skipping the optional associated data that may prefix the
ciphertext. This commit fixes this issue.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Fixes: e88b27c8ea ("crypto: ccree - use std api sg_zero_buffer")
Cc: stable@vger.kernel.org
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5.4-rM2-2.2.x-imx-squashed
Gilad Ben-Yossef 2020-01-16 12:14:38 +02:00 committed by Greg Kroah-Hartman
parent 80c660892c
commit 70439e8b7c
1 changed files with 1 additions and 1 deletions

View File

@ -237,7 +237,7 @@ static void cc_aead_complete(struct device *dev, void *cc_req, int err)
* revealed the decrypted message --> zero its memory.
*/
sg_zero_buffer(areq->dst, sg_nents(areq->dst),
areq->cryptlen, 0);
areq->cryptlen, areq->assoclen);
err = -EBADMSG;
}
/*ENCRYPT*/