From 38ce604e3cc97706b876b0525ddff0121115456d Mon Sep 17 00:00:00 2001 From: djm <> Date: Sat, 6 Sep 2008 12:17:54 +0000 Subject: resolve conflicts --- src/lib/libcrypto/rand/randfile.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/lib/libcrypto/rand/randfile.c') diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c index d847d8ebdf..005cb38cb0 100644 --- a/src/lib/libcrypto/rand/randfile.c +++ b/src/lib/libcrypto/rand/randfile.c @@ -102,10 +102,8 @@ int RAND_load_file(const char *file, long bytes) if (file == NULL) return(0); - i=stat(file,&sb); - /* If the state fails, put some crap in anyway */ - RAND_add(&sb,sizeof(sb),0); - if (i < 0) return(0); + if (stat(file,&sb) < 0) return(0); + RAND_add(&sb,sizeof(sb),0.0); if (bytes == 0) return(ret); in=fopen(file,"rb"); @@ -128,8 +126,12 @@ int RAND_load_file(const char *file, long bytes) n = BUFSIZE; i=fread(buf,1,n,in); if (i <= 0) break; +#ifdef PURIFY + RAND_add(buf,i,(double)i); +#else /* even if n != i, use the full array */ - RAND_add(buf,n,i); + RAND_add(buf,n,(double)i); +#endif ret+=i; if (bytes > 0) { -- cgit v1.2.3-55-g6feb