cvs commit: src/sys/kern kern_random.c
Matthew Dillon
dillon at crater.dragonflybsd.org
Wed Apr 12 11:30:45 PDT 2006
dillon 2006/04/12 11:28:30 PDT
DragonFly src repository
Modified files:
sys/kern kern_random.c
Log:
Note: the previous rev's CVS comment was messed up due to an editor snafu.
/dev/random was almost always returning 0 bytes. This was due to several
factors, primarily the fact that the stack smash handler reads 32 bytes from
/dev/urandom every time a program is exec'd, and because /dev/random and
/dev/urandom share the same pool.
* Give /dev/random and /dev/urandom their own separate pools.
* Be slightly less conservative on the number of bits of randomness we
think we've added.
* extract_entropy() calls add_timer_randomness(), which adds entropy. This
can create a situation where entropy always appears to be available when,
in fact, it is of very low quality. Add a little hysteresis so degenerate
cases return 0 bytes instead of 1 byte.
* Also (in this commit) fix a bug in the previous commit where the randomness
added was accidently halved.
Reported-by: David Rhodus
Revision Changes Path
1.14 +11 -13 src/sys/kern/kern_random.c
http://www.dragonflybsd.org/cvsweb/src/sys/kern/kern_random.c.diff?r1=1.13&r2=1.14&f=u
More information about the Commits
mailing list