summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-05-15 23:20:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:44 -0500
commitffb8ba8cd320b7c25dabb2353d9e7245bcaefcd1 (patch)
treed14399cbc8a158affcee43420d21aa24c8b23245 /source4
parent2c08639e0294ade488c2b493e25c1aeff4983cd7 (diff)
downloadsamba-ffb8ba8cd320b7c25dabb2353d9e7245bcaefcd1.tar.gz
samba-ffb8ba8cd320b7c25dabb2353d9e7245bcaefcd1.tar.bz2
samba-ffb8ba8cd320b7c25dabb2353d9e7245bcaefcd1.zip
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)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/genrand.c8
1 files changed, 6 insertions, 2 deletions
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;