Source-Changes-HG archive

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

[.joined/src/trunk]: .joined/src/usr.sbin/sysinst Now that (semi-)manual entr...



details:   https://anonhg.NetBSD.org/.joined/src/rev/05a74cfdfad9
branches:  trunk
changeset: 359413:05a74cfdfad9
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Jan 03 11:44:02 2022 +0000

description:
Now that (semi-)manual entropy setup may happen outside of the main
install/upgrade path, we need to (re-)write the entropy seed file
afterwards - the earlier written one would not have an entropy estimate
if we get here.

diffstat:

 usr.sbin/sysinst/util.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 30786dab3e02 -r 05a74cfdfad9 usr.sbin/sysinst/util.c
--- a/usr.sbin/sysinst/util.c   Mon Jan 03 08:44:10 2022 +0000
+++ b/usr.sbin/sysinst/util.c   Mon Jan 03 11:44:02 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.62 2021/10/08 15:59:55 martin Exp $ */
+/*     $NetBSD: util.c,v 1.63 2022/01/03 11:44:02 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1353,9 +1353,12 @@
 {
        int rv;
 
+       if (entropy_needed() == 0)
+               return true;
+
        for (;;) {
                if (entropy_needed() == 0)
-                       return true;
+                       break;
 
                msg_clear();
                rv = 0;
@@ -1387,6 +1390,15 @@
                        }
                }
        }
+
+       /*
+        * Save entropy (maybe again) to give the seed file a good
+        * entropy estimate.
+        */
+       run_program(RUN_SILENT | RUN_CHROOT | RUN_ERROR_OK,
+           "/etc/rc.d/random_seed stop");
+
+       return true;
 }
 #endif
 



Home | Main Index | Thread Index | Old Index