svn commit: samba r6798 - in branches/SAMBA_4_0/source/lib: .

abartlet at samba.org abartlet at samba.org
Sun May 15 23:20:59 GMT 2005


Author: abartlet
Date: 2005-05-15 23:20:58 +0000 (Sun, 15 May 2005)
New Revision: 6798

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6798

Log:
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

Modified:
   branches/SAMBA_4_0/source/lib/genrand.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/genrand.c
===================================================================
--- branches/SAMBA_4_0/source/lib/genrand.c	2005-05-15 23:15:03 UTC (rev 6797)
+++ branches/SAMBA_4_0/source/lib/genrand.c	2005-05-15 23:20:58 UTC (rev 6798)
@@ -111,8 +111,10 @@
 }
 
 /****************************************************************
- 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 @@
 	unsigned char tmp_md4[16];
 	int fd, n;
 
+	ZERO_STRUCT(tmp_md4);
+
 	fd = open(fname,O_RDONLY,0);
 	if (fd == -1)
 		return;



More information about the samba-cvs mailing list