1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

* Reinstate r128059's consumption of our best entropy first.

r128060 for "hardware-supplied entropy" reversed this without reason,
  seems a typo.
* Isolate "better than nothing" implementation to a function.

Submitted by:	obrien & Arthur Mesh <arthurmesh@gmail.com>
Sponsored by:	Juniper Networks
This commit is contained in:
David E. O'Brien 2012-08-22 23:37:24 +00:00
parent 8634a69af0
commit b7aeb5b281
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239598

View File

@ -21,6 +21,17 @@ feed_dev_random()
fi
}
better_than_nothing()
{
# XXX temporary until we can improve the entropy
# harvesting rate.
# Entropy below is not great, but better than nothing.
# This unblocks the generator at startup
( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww ) \
| dd of=/dev/random bs=8k 2>/dev/null
cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null
}
initrandom_start()
{
soft_random_generator=`sysctl kern.random 2>/dev/null`
@ -52,14 +63,6 @@ initrandom_start()
fi
fi
# XXX temporary until we can improve the entropy
# harvesting rate.
# Entropy below is not great, but better than nothing.
# This unblocks the generator at startup
( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww ) \
| dd of=/dev/random bs=8k 2>/dev/null
cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null
# First pass at reseeding /dev/random.
#
case ${entropy_file} in
@ -72,6 +75,8 @@ initrandom_start()
;;
esac
better_than_nothing()
echo -n ' kickstart'
fi