summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%google.com <devnull@localhost>2012-11-14 13:29:09 +0000
committerwtc%google.com <devnull@localhost>2012-11-14 13:29:09 +0000
commitd2c8e0506a7764245772e835d4d6900b018875cd (patch)
treea82cccc37ee06d1bece35fe52de052f89ea065b4
parentef049a08d35033079c78dc9da86e68e2a0a87096 (diff)
downloadnss-hg-d2c8e0506a7764245772e835d4d6900b018875cd.tar.gz
Bug 654611: Tweak the previous checkin.
-rw-r--r--security/nss/lib/freebl/win_rand.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/security/nss/lib/freebl/win_rand.c b/security/nss/lib/freebl/win_rand.c
index b0db4ef2d..0100ac446 100644
--- a/security/nss/lib/freebl/win_rand.c
+++ b/security/nss/lib/freebl/win_rand.c
@@ -8,7 +8,6 @@
#ifdef XP_WIN
#include <windows.h>
#include <shlobj.h> /* for CSIDL constants */
-
#include <time.h>
#include <io.h>
#include <sys/types.h>
@@ -41,6 +40,7 @@ size_t RNG_GetNoise(void *buf, size_t maxbuf)
DWORD dwHigh, dwLow, dwVal;
int n = 0;
int nBytes;
+ time_t sTime;
if (maxbuf <= 0)
return 0;
@@ -75,14 +75,11 @@ size_t RNG_GetNoise(void *buf, size_t maxbuf)
if (maxbuf <= 0)
return n;
- {
- time_t sTime;
// get the time in seconds since midnight Jan 1, 1970
time(&sTime);
nBytes = sizeof(sTime) > maxbuf ? maxbuf : sizeof(sTime);
memcpy(((char *)buf) + n, &sTime, nBytes);
n += nBytes;
- }
return n;
}
@@ -268,6 +265,7 @@ void RNG_SystemInfoForRNG(void)
sMem.dwLength = sizeof(sMem);
GlobalMemoryStatus(&sMem); // assorted memory stats
RNG_RandomUpdate(&sMem, sizeof(sMem));
+
dwVal = GetLogicalDrives();
RNG_RandomUpdate(&dwVal, sizeof(dwVal)); // bitfields in bits 0-25