diff mbox series

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

Message ID 1616721648-56258-2-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, such as key.

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

Patch

diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 352d80c..4a08b2a 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -1622,7 +1622,7 @@  static inline void atmel_sha_hmac_key_init(struct atmel_sha_hmac_key *hkey)
 static inline void atmel_sha_hmac_key_release(struct atmel_sha_hmac_key *hkey)
 {
 	kfree(hkey->keydup);
-	memset(hkey, 0, sizeof(*hkey));
+	memzero_explicit(hkey, sizeof(*hkey));
 }
 
 static inline int atmel_sha_hmac_key_set(struct atmel_sha_hmac_key *hkey,