diff options
author | dscho <dscho> | 2003-07-28 00:57:52 +0000 |
---|---|---|
committer | dscho <dscho> | 2003-07-28 00:57:52 +0000 |
commit | 9f0a1a3bc16d26420c703c6e6cc0f18bd4f6b81e (patch) | |
tree | 0aa185de6ff17df411ce24001954435a524a970e /vncauth.c | |
parent | b9ebdab1f255316ccb9160daa0976d57adfe2675 (diff) | |
download | libtdevnc-9f0a1a3bc16d26420c703c6e6cc0f18bd4f6b81e.tar.gz libtdevnc-9f0a1a3bc16d26420c703c6e6cc0f18bd4f6b81e.zip |
synced with TightVNC and RealVNC
Diffstat (limited to 'vncauth.c')
-rw-r--r-- | vncauth.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -142,9 +142,13 @@ void vncRandomBytes(unsigned char *bytes) { int i; - unsigned int seed = (unsigned int) time(0); + static Bool s_srandom_called = FALSE; + + if (!s_srandom_called) { + srandom((unsigned int)time(0) ^ (unsigned int)getpid()); + s_srandom_called = TRUE; + } - srandom(seed); for (i = 0; i < CHALLENGESIZE; i++) { bytes[i] = (unsigned char)(random() & 255); } |