Thread (5 messages) 5 messages, 2 authors, 2021-04-02

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

flat view
STALE2020d

From: Kai Ye <hidden>
Date: 2021-03-26 01:24:04
Also in: lkml
Subsystem: crypto api, qualcomm crypto drivers, the rest · Maintainers: Herbert Xu, "David S. Miller", Bartosz Golaszewski, Linus Torvalds

use memzero_explicit instead of memset to clear sensitive data.

Signed-off-by: Kai Ye <redacted>
---
 drivers/crypto/qce/sha.c | 1 +
 1 file changed, 1 insertion(+)
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);
-- 
2.8.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help