From e08fb7998d733407336e83a299f140b0c1d2fcd3 Mon Sep 17 00:00:00 2001 From: markus <> Date: Thu, 5 Sep 2002 22:12:12 +0000 Subject: merge with 0.9.7-beta1 --- src/lib/libcrypto/rand/randfile.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 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 4b221e08f5..1c3e68ef31 100644 --- a/src/lib/libcrypto/rand/randfile.c +++ b/src/lib/libcrypto/rand/randfile.c @@ -99,12 +99,11 @@ int RAND_load_file(const char *file, long bytes) if (file == NULL) return(0); i=stat(file,&sb); - if (i < 0) { - /* If the state fails, put some crap in anyway */ - RAND_add(&sb,sizeof(sb),0); - return(0); - } + /* If the state fails, put some crap in anyway */ + RAND_add(&sb,sizeof(sb),0); + if (i < 0) return(0); if (bytes == 0) return(ret); + in=fopen(file,"rb"); if (in == NULL) goto err; if (sb.st_mode & (S_IFBLK | S_IFCHR)) { @@ -218,12 +217,12 @@ err: const char *RAND_file_name(char *buf, size_t size) { - char *s = NULL; + char *s=NULL; int ok = 0; struct stat sb; if (issetugid() == 0) - s = getenv("RANDFILE"); + s=getenv("RANDFILE"); if (s != NULL && *s && strlen(s) + 1 < size) { strlcpy(buf,s,size); @@ -272,4 +271,3 @@ const char *RAND_file_name(char *buf, size_t size) #endif return(buf); } - -- cgit v1.2.3-55-g6feb