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 8/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/rmd160.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/rmd160.c b/crypto/rmd160.c
index c5fe4034b153..a80f783d5a4f 100644
--- a/crypto/rmd160.c
+++ b/crypto/rmd160.c
@@ -329,7 +329,7 @@ static int rmd160_final(struct shash_desc *desc, u8 *out)
dst[i] = cpu_to_le32p(&rctx->state[i]);

/* Wipe context */
- memset(rctx, 0, sizeof(*rctx));
+ memzero_explicit(rctx, sizeof(*rctx));

return 0;
}
--
\
 
 \ /
  Last update: 2021-11-16 12:42    [W:0.031 / U:1.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site