diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-07-20 14:01:14 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-07-20 14:02:47 -0700 |
commit | 73d55732df36ac4f32e7065392780a8258f5e21b (patch) | |
tree | 4aa2590d98eb96b137114113ddfe39429008dfdf /gl | |
parent | b05d02318c3dcc9f295506ba3253a18f545b16b9 (diff) | |
download | coreutils-73d55732df36ac4f32e7065392780a8258f5e21b.tar.gz |
shred: use explicit_bzero
* NEWS: Document this.
* bootstrap.conf (gnulib_modules): Add explicit_bzero.
* gl/lib/randint.c (randint_free):
* gl/lib/randread.c (randread_free):
* src/blake2/blake2-impl.h (secure_zero_memory):
* src/shred.c (dopass, do_wipefd):
Prefer explicit_bzero to memset when erasing secrets.
Diffstat (limited to 'gl')
-rw-r--r-- | gl/lib/randint.c | 2 | ||||
-rw-r--r-- | gl/lib/randread.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/gl/lib/randint.c b/gl/lib/randint.c index 4561067e8..b15982f46 100644 --- a/gl/lib/randint.c +++ b/gl/lib/randint.c @@ -198,7 +198,7 @@ randint_genmax (struct randint_source *s, randint genmax) void randint_free (struct randint_source *s) { - memset (s, 0, sizeof *s); + explicit_bzero (s, sizeof *s); free (s); } diff --git a/gl/lib/randread.c b/gl/lib/randread.c index 9c70a1875..834f8446a 100644 --- a/gl/lib/randread.c +++ b/gl/lib/randread.c @@ -341,7 +341,7 @@ int randread_free (struct randread_source *s) { FILE *source = s->source; - memset (s, 0, sizeof *s); + explicit_bzero (s, sizeof *s); free (s); return (source ? fclose (source) : 0); } |