提交 2a6bc713 编写于 作者: G Gilad Ben-Yossef 提交者: Herbert Xu

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: NGilad Ben-Yossef <gilad@benyossef.com>
Fixes: e88b27c8 ("crypto: ccree - use std api sg_zero_buffer")
Cc: stable@vger.kernel.org
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 684cf266
...@@ -237,7 +237,7 @@ static void cc_aead_complete(struct device *dev, void *cc_req, int err) ...@@ -237,7 +237,7 @@ static void cc_aead_complete(struct device *dev, void *cc_req, int err)
* revealed the decrypted message --> zero its memory. * revealed the decrypted message --> zero its memory.
*/ */
sg_zero_buffer(areq->dst, sg_nents(areq->dst), sg_zero_buffer(areq->dst, sg_nents(areq->dst),
areq->cryptlen, 0); areq->cryptlen, areq->assoclen);
err = -EBADMSG; err = -EBADMSG;
} }
/*ENCRYPT*/ /*ENCRYPT*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册