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

diff --git a/crypto/dh.c b/crypto/dh.c
index cd4f32092e5c..ff7dc65b3b41 100644
--- a/crypto/dh.c
+++ b/crypto/dh.c
@@ -25,7 +25,7 @@ static void dh_clear_ctx(struct dh_ctx *ctx)
mpi_free(ctx->q);
mpi_free(ctx->g);
mpi_free(ctx->xa);
- memset(ctx, 0, sizeof(*ctx));
+ memzero_explicit(ctx, sizeof(*ctx));
}

/*
--
2.25.1
\
 
 \ /
  Last update: 2021-11-16 12:35    [W:0.022 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site