diff mbox series

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

Message ID 1616721648-56258-3-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/qce/sha.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/crypto/qce/sha.c b/drivers/crypto/qce/sha.c
index 61c418c..cb9b3da 100644
--- a/drivers/crypto/qce/sha.c
+++ b/drivers/crypto/qce/sha.c
@@ -415,6 +415,7 @@  static int qce_ahash_hmac_setkey(struct crypto_ahash *tfm, const u8 *key,
 
 	ret = crypto_wait_req(crypto_ahash_digest(req), &wait);
 
+	memzero_explicit(buf, keylen + QCE_MAX_ALIGN_SIZE);
 	kfree(buf);
 err_free_req:
 	ahash_request_free(req);