Use srandom() to init the PRNG, not srand(), since we use random().
This is harmless because srandom() is called somewhere else, with time(NULL) as a seed, but this is more correct. Obtained from: https://bitbucket.org/mux/csup Pointyhat to: not mux, somebody else MFC after: 1 week
This commit is contained in:
parent
49329d2825
commit
d8139ed7ed
@ -293,7 +293,7 @@ auth_makechallenge(struct config *config, char *challenge)
|
||||
gettimeofday(&tv, NULL);
|
||||
pid = getpid();
|
||||
ppid = getppid();
|
||||
srand(tv.tv_usec ^ tv.tv_sec ^ pid);
|
||||
srandom(tv.tv_usec ^ tv.tv_sec ^ pid);
|
||||
addrlen = sizeof(laddr);
|
||||
error = getsockname(config->socket, (struct sockaddr *)&laddr, &addrlen);
|
||||
if (error < 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user