From ffb8ba8cd320b7c25dabb2353d9e7245bcaefcd1 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 15 May 2005 23:20:58 +0000 Subject: r6798: Valgrind pain is not something I look forward to - if we ever fall back to the 'not /dev/urandom' method of random number generation, I don't want to be chasing down 'use of uninitialised value' though all the crypto code. Andrew Bartlett (This used to be commit 31ff2cd8e11dee36c42f82dcfd85338d3ff704d3) --- source4/lib/genrand.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/genrand.c b/source4/lib/genrand.c index e3df9f9d90..9d40e72afc 100644 --- a/source4/lib/genrand.c +++ b/source4/lib/genrand.c @@ -111,8 +111,10 @@ static void get_random_stream(unsigned char *data, size_t datasize) } /**************************************************************** - Get a 16 byte hash from the contents of a file. - Note that the hash is not initialised. + Get a 16 byte hash from the contents of a file. + + Note that the hash is initialised, because the extra entropy is not + worth the valgrind pain. *****************************************************************/ static void do_filehash(const char *fname, unsigned char *the_hash) @@ -121,6 +123,8 @@ static void do_filehash(const char *fname, unsigned char *the_hash) unsigned char tmp_md4[16]; int fd, n; + ZERO_STRUCT(tmp_md4); + fd = open(fname,O_RDONLY,0); if (fd == -1) return; -- cgit