[PATCH] Include date and time when seeding the RNG.
John Denker
jsd at av8n.com
Sat Sep 11 17:04:48 UTC 2010
---
urandom | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/urandom b/urandom
index 79344cb..5e6121c 100755
--- a/urandom
+++ b/urandom
@@ -35,6 +35,15 @@ fi
case "$1" in
start|"")
[ "$VERBOSE" = no ] || log_action_begin_msg "Initializing random number generator"
+ # Seed the RNG with date and time.
+ # This is helpful in the less-than-ideal case where $SAVEDFILE
+ # is read-only.
+ # The value of this is greatly reduced if $SAVEDFILE is missing,
+ # or its contents are shared machine-to-machine or known to
+ # attackers (since they might well know at what time this
+ # machine booted up).
+ date +%s.%N > /dev/random
+
# Load and then save $POOLBYTES bytes,
# which is the size of the entropy pool
if [ -f "$SAVEDFILE" ]
--
1.5.6.5
--------------040607030603000609090008--
More information about the Pkg-sysvinit-devel
mailing list