summaryrefslogtreecommitdiff
path: root/drivers/crypto/ccree
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@benyossef.com>2020-01-16 13:14:38 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2020-01-22 11:21:09 +0300
commit2a6bc713f1cef32e39e3c4e6f2e1a9849da6379c (patch)
tree88939dded18259bcc15c533663620b04c7dd3dc6 /drivers/crypto/ccree
parent684cf266eb04911825a6de10dadd188cf801d063 (diff)
downloadlinux-2a6bc713f1cef32e39e3c4e6f2e1a9849da6379c.tar.xz
crypto: ccree - fix AEAD decrypt auth fail
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: e88b27c8eaa8 ("crypto: ccree - use std api sg_zero_buffer") Cc: stable@vger.kernel.org Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccree')
-rw-r--r--drivers/crypto/ccree/cc_aead.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/ccree/cc_aead.c b/drivers/crypto/ccree/cc_aead.c
index d014c8e063a7..754de302a3b5 100644
--- a/drivers/crypto/ccree/cc_aead.c
+++ b/drivers/crypto/ccree/cc_aead.c
@@ -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*/