Author: obrien
Date: Wed Aug 22 23:37:24 2012
New Revision: 239598
URL: http://svn.freebsd.org/changeset/base/239598

Log:
  * 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 <arthurm...@gmail.com>
  Sponsored by: Juniper Networks

Modified:
  head/etc/rc.d/initrandom

Modified: head/etc/rc.d/initrandom
==============================================================================
--- head/etc/rc.d/initrandom    Wed Aug 22 22:48:50 2012        (r239597)
+++ head/etc/rc.d/initrandom    Wed Aug 22 23:37:24 2012        (r239598)
@@ -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
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to