crypto: axis - use a constant time tag compare
Avoid plain memcmp() on the AEAD tag value as this could leak information through a timing side channel. Signed-off-by: Lars Persson <larper@axis.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -2201,7 +2201,7 @@ static void artpec6_crypto_complete_aead(struct crypto_async_request *req)
|
|||||||
areq->assoclen + areq->cryptlen -
|
areq->assoclen + areq->cryptlen -
|
||||||
authsize);
|
authsize);
|
||||||
|
|
||||||
if (memcmp(req_ctx->decryption_tag,
|
if (crypto_memneq(req_ctx->decryption_tag,
|
||||||
input_tag,
|
input_tag,
|
||||||
authsize)) {
|
authsize)) {
|
||||||
pr_debug("***EBADMSG:\n");
|
pr_debug("***EBADMSG:\n");
|
||||||
|
Reference in New Issue
Block a user