mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Drop NSHUFF values right after srandom() to remove part of seed -> 1st
value correlation. Correlation still remains because of algorithm limits.
This commit is contained in:
parent
ddd972a9bd
commit
a36d6a59f0
1 changed files with 6 additions and 0 deletions
|
|
@ -36,13 +36,19 @@
|
|||
|
||||
#include <sys/libkern.h>
|
||||
|
||||
#define NSHUFF 100 /* to drop part of seed -> 1st value correlation */
|
||||
|
||||
static u_long randseed = 1;
|
||||
|
||||
void
|
||||
srandom(seed)
|
||||
u_long seed;
|
||||
{
|
||||
int i;
|
||||
|
||||
randseed = seed;
|
||||
for (i = 0; i < NSHUFF; i++)
|
||||
(void)random();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue