DragonFly commits List (threaded) for 2006-04
cvs commit: src/sys/kern kern_random.c
dillon 2006/04/12 11:28:30 PDT
DragonFly src repository
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