summaryrefslogtreecommitdiff
path: root/drivers/crypto/qce
diff options
context:
space:
mode:
authorThara Gopinath <thara.gopinath@linaro.org>2021-04-29 11:07:01 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2021-05-14 19:07:55 +0800
commita9ca8eacb3204208863b9175baae8ac7ee6b2a64 (patch)
treef4a10d42c5d023894ab00f2a9ef94096239f6426 /drivers/crypto/qce
parentb7c3635e56d6561436af59b9876faa7cc8389644 (diff)
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 <bjorn.andersson@linaro.org> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/qce')
-rw-r--r--drivers/crypto/qce/common.c2
1 files changed, 2 insertions, 0 deletions
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;
}