From: Thara Gopinath Date: Thu, 29 Apr 2021 15:07:01 +0000 (-0400) Subject: crypto: qce - Add MAC failed error checking X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a9ca8eacb3204208863b9175baae8ac7ee6b2a64;p=uclinux-h8%2Flinux.git crypto: qce - Add MAC failed error checking MAC_FAILED gets set in the status register if authenthication fails for ccm algorithms(during decryption). Add support to catch and flag this error. Reviewed-by: Bjorn Andersson Signed-off-by: Thara Gopinath Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/qce/common.c b/drivers/crypto/qce/common.c index dceb9579d87a..dd76175d5c62 100644 --- a/drivers/crypto/qce/common.c +++ b/drivers/crypto/qce/common.c @@ -419,6 +419,8 @@ int qce_check_status(struct qce_device *qce, u32 *status) */ if (*status & STATUS_ERRORS || !(*status & BIT(OPERATION_DONE_SHIFT))) ret = -ENXIO; + else if (*status & BIT(MAC_FAILED_SHIFT)) + ret = -EBADMSG; return ret; }