lkml.org 
[lkml]   [2021]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 7/8] Replace memset() with memzero_explicit()
Replace memset(address,0,bytes) which may be optimised
away with memzero_explicit(address,bytes) which resists
such optimisation

---
crypto/sm2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/sm2.c b/crypto/sm2.c
index db8a4a265669..58641d964671 100644
--- a/crypto/sm2.c
+++ b/crypto/sm2.c
@@ -124,7 +124,7 @@ static void sm2_ec_ctx_deinit(struct mpi_ec_ctx *ec)
{
mpi_ec_deinit(ec);

- memset(ec, 0, sizeof(*ec));
+ memzero_explicit(ec, sizeof(*ec));
}

/* RESULT must have been initialized and is set on success to the
--
\
 
 \ /
  Last update: 2021-11-16 12:41    [W:0.072 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site