Skip to content

Commit 7a4be6c

Browse files
Gilad Ben-Yossefherbertx
authored andcommitted
crypto: ccree - use the full crypt length value
In case of AEAD decryption verifcation error we were using the wrong value to zero out the plaintext buffer leaving the end of the buffer with the false plaintext. Signed-off-by: Gilad Ben-Yossef <[email protected]> Fixes: ff27e85 ("crypto: ccree - add AEAD support") CC: [email protected] # v4.17+ Signed-off-by: Herbert Xu <[email protected]>
1 parent b7a2758 commit 7a4be6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/crypto/ccree/cc_aead.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static void cc_aead_complete(struct device *dev, void *cc_req, int err)
236236
/* In case of payload authentication failure, MUST NOT
237237
* revealed the decrypted message --> zero its memory.
238238
*/
239-
cc_zero_sgl(areq->dst, areq_ctx->cryptlen);
239+
cc_zero_sgl(areq->dst, areq->cryptlen);
240240
err = -EBADMSG;
241241
}
242242
/*ENCRYPT*/

0 commit comments

Comments
 (0)