[PATCH 2/2] rndhw: wipe temporary buffer after use

Jussi Kivilinna jussi.kivilinna at iki.fi
Sun Feb 2 23:29:32 CET 2020


* random/rndhw.c (poll_drng): Wipe buffer on exit.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
---
 random/rndhw.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/random/rndhw.c b/random/rndhw.c
index 3cf9acc3a..3c0abe7c7 100644
--- a/random/rndhw.c
+++ b/random/rndhw.c
@@ -165,6 +165,7 @@ poll_drng (add_fn_t add, enum random_origins origin, int fast)
   if (!rdrand_nlong (buffer, DIM(buffer)))
     return 0;
   (*add)((void *)buffer, nbytes, origin);
+  wipememory (buffer, nbytes);
   return nbytes;
 }
 #endif /*USE_DRNG*/




More information about the Gcrypt-devel mailing list