diff --git a/daemon/aux.h b/daemon/aux.h index f1b3134c5..0c6b2b2c3 100644 --- a/daemon/aux.h +++ b/daemon/aux.h @@ -18,8 +18,7 @@ #include #include #include "compat.h" - - +#include #if 0 && defined(__DEBUG) #define __THREAD_DEBUG 1 @@ -292,10 +291,8 @@ INLINE int strmemcmp(const void *mem, int len, const char *str) { return memcmp(mem, str, len); } -/* XXX replace with better source of randomness */ INLINE void random_string(unsigned char *buf, int len) { - while (len--) - *buf++ = random() % 0x100; + RAND_bytes(buf, len); }