summaryrefslogtreecommitdiff
path: root/etc/rc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2011-01-10 06:44:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2011-01-10 06:44:50 +0000
commit1a7c9558a28dea1703250bbce6a967f00dd2ca8c (patch)
tree8af399431719e7351031adbb0166c55d08c5cb2f /etc/rc
parentb0bcad6eb44ca87a04c97f0194780face0cb7cb1 (diff)
talk to /dev/arandom as a single read or write.
in particular a single write will result in a single re-key event, rather than 64 writes causing 64 re-keys -- wasting the kernel's time. ok guenther
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc10
1 files changed, 5 insertions, 5 deletions
diff --git a/etc/rc b/etc/rc
index a065532ae85..7b3fdb29928 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,4 +1,4 @@
-# $OpenBSD: rc,v 1.346 2010/12/22 18:13:14 deraadt Exp $
+# $OpenBSD: rc,v 1.347 2011/01/10 06:44:49 deraadt Exp $
# System startup script run by init on autoboot
# or after single-user.
@@ -102,12 +102,12 @@ wsconsctl_conf()
random_seed()
{
if [ -f /var/db/host.random -a "X$random_seed_done" = "X" ]; then
- dd if=/var/db/host.random of=/dev/arandom bs=1024 count=64 \
+ dd if=/var/db/host.random of=/dev/arandom bs=65536 count=1 \
> /dev/null 2>&1
# reset seed file, so that if a shutdown-less reboot occurs,
# the next seed is not a repeat
- dd if=/dev/arandom of=/var/db/host.random bs=1024 count=64 \
+ dd if=/dev/arandom of=/var/db/host.random bs=65536 count=1 \
> /dev/null 2>&1
random_seed_done=1
@@ -159,7 +159,7 @@ export PATH
. /etc/rc.conf
if [ X"$1" = X"shutdown" ]; then
- dd if=/dev/arandom of=/var/db/host.random bs=1024 count=64 >/dev/null 2>&1
+ dd if=/dev/arandom of=/var/db/host.random bs=65536 count=1 >/dev/null 2>&1
chmod 600 /var/db/host.random >/dev/null 2>&1
if [ $? -eq 0 -a -f /etc/rc.shutdown ]; then
echo /etc/rc.shutdown in progress...
@@ -310,7 +310,7 @@ mount -s /var >/dev/null 2>&1
# if there's no /var/db/host.random, use /dev/arandom to create one
if [ ! -f /var/db/host.random ]; then
- dd if=/dev/arandom of=/var/db/host.random bs=1024 count=64 \
+ dd if=/dev/arandom of=/var/db/host.random bs=65536 count=1 \
>/dev/null 2>&1
chmod 600 /var/db/host.random >/dev/null 2>&1
else