diff mbox series

[3/3] crypto: stm32 - use memzero_explicit() for clearing data

Message ID 1616721648-56258-4-git-send-email-yekai13@huawei.com (mailing list archive)
State Rejected
Delegated to: Herbert Xu
Headers show
Series crypto: replace memset by memzero_explicit | expand

Commit Message

yekai (A) March 26, 2021, 1:20 a.m. UTC
use memzero_explicit instead of memset to clear sensitive data

Signed-off-by: Kai Ye <yekai13@huawei.com>
---
 drivers/crypto/stm32/stm32-cryp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/crypto/stm32/stm32-cryp.c b/drivers/crypto/stm32/stm32-cryp.c
index 2a479317..c4297e80 100644
--- a/drivers/crypto/stm32/stm32-cryp.c
+++ b/drivers/crypto/stm32/stm32-cryp.c
@@ -675,7 +675,7 @@  static void stm32_cryp_finish_req(struct stm32_cryp *cryp, int err)
 		crypto_finalize_skcipher_request(cryp->engine, cryp->req,
 						   err);
 
-	memset(cryp->ctx->key, 0, cryp->ctx->keylen);
+	memzero_explicit(cryp->ctx->key, cryp->ctx->keylen);
 }
 
 static int stm32_cryp_cpu_start(struct stm32_cryp *cryp)