diff --git a/bsd/sys/libkern/arc4random.c b/bsd/sys/libkern/arc4random.c index 1e5194738a8f95b48dbadd9e99a6421d6df68519..1ad4c35ea6b3351dad3e273f5eb429c8b0e7e33f 100644 --- a/bsd/sys/libkern/arc4random.c +++ b/bsd/sys/libkern/arc4random.c @@ -31,11 +31,14 @@ static struct mtx arc4_mtx; static u_int8_t arc4_randbyte(void); -uint8_t read_random_gen = 0; +/* FIXME: OSv - use real random */ int read_random(void* buf, int count) { + struct timeval tv; + getmicrotime(&tv); for (int i=0; i<count; i++) { - ((uint8_t *)buf)[i] = read_random_gen++; + ((uint8_t *)buf)[i] = tv.tv_usec & 0xFF; + tv.tv_usec *= 7; } return (count);