Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc/rc.d If no random seed file exists on boot, create one.



details:   https://anonhg.NetBSD.org/src/rev/41c41f1c4e16
branches:  trunk
changeset: 932462:41c41f1c4e16
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu May 07 20:01:04 2020 +0000

description:
If no random seed file exists on boot, create one.

rndctl -S triggers entropy consolidation, so whatever we gathered
during kernel startup -- interrupt timings, autoconf timings, &c. --
will be incorporated into the seed and into subsequent data read from
/dev/urandom, just like if rndctl -L had run at this boot, and the
seed will carry them into the next boot too.

But it still avoids frequently consolidating entropy on any regular
schedule, in order to continue to mitigate iterative-guessing
attacks.

diffstat:

 etc/rc.d/random_seed |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r d24e21d7a432 -r 41c41f1c4e16 etc/rc.d/random_seed
--- a/etc/rc.d/random_seed      Thu May 07 20:00:38 2020 +0000
+++ b/etc/rc.d/random_seed      Thu May 07 20:01:04 2020 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: random_seed,v 1.12 2020/05/07 20:00:38 riastradh Exp $
+# $NetBSD: random_seed,v 1.13 2020/05/07 20:01:04 riastradh Exp $
 #
 
 # PROVIDE: random_seed
@@ -57,7 +57,8 @@
        local flags=
 
        if [ ! -f "${random_file}" ]; then
-               message "Not present"
+               message "Not present; creating"
+               random_save
                return
        fi
 



Home | Main Index | Thread Index | Old Index