diff options
author | Gilad Ben-Yossef <gilad@benyossef.com> | 2019-07-29 13:40:18 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-11 18:36:05 +0200 |
commit | 5bc113a84cf9a4aff56f444612af59d9ce2cc8e5 (patch) | |
tree | b0f38fc261a799342129676ba6c07f90c690af37 | |
parent | 2fdc737947b641d2a80edbef6499cd5da22bce3e (diff) | |
download | linux-stable-5bc113a84cf9a4aff56f444612af59d9ce2cc8e5.tar.gz linux-stable-5bc113a84cf9a4aff56f444612af59d9ce2cc8e5.tar.bz2 linux-stable-5bc113a84cf9a4aff56f444612af59d9ce2cc8e5.zip |
crypto: ccree - use the full crypt length value
commit 7a4be6c113c1f721818d1e3722a9015fe393295c upstream.
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 <gilad@benyossef.com>
Fixes: ff27e85a85bb ("crypto: ccree - add AEAD support")
CC: stable@vger.kernel.org # v4.17+
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/crypto/ccree/cc_aead.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/ccree/cc_aead.c b/drivers/crypto/ccree/cc_aead.c index 7aa4cbe19a86..29bf397cf0c1 100644 --- a/drivers/crypto/ccree/cc_aead.c +++ b/drivers/crypto/ccree/cc_aead.c @@ -236,7 +236,7 @@ static void cc_aead_complete(struct device *dev, void *cc_req, int err) /* In case of payload authentication failure, MUST NOT * revealed the decrypted message --> zero its memory. */ - cc_zero_sgl(areq->dst, areq_ctx->cryptlen); + cc_zero_sgl(areq->dst, areq->cryptlen); err = -EBADMSG; } } else { /*ENCRYPT*/ |