From c6428874f2f7ef6896f3afdd6a7531469af76033 Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 9 Sep 2008 09:46:36 +0000 Subject: Return two fixes from previous backout which does not require review by secteam@ for the reasons mentioned below. 1) Rename /dev/urandom to /dev/random since urandom marked as XXX Deprecated alias in /sys/dev/random/randomdev.c (this is our naming convention and no review by secteam@ required) 2) Set rs_stired flag after forced initialization to prevent double stearing. (this is already in OpenBSD, i.e. they don't have double stearing. It means that this change matches their code path and no additional secteam@ review required) Submitted by: Thorsten Glaser (2) --- lib/libc/gen/arc4random.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libc/gen/arc4random.c b/lib/libc/gen/arc4random.c index d702e34..56dfba9 100644 --- a/lib/libc/gen/arc4random.c +++ b/lib/libc/gen/arc4random.c @@ -54,7 +54,7 @@ struct arc4_stream { static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; -#define RANDOMDEV "/dev/urandom" +#define RANDOMDEV "/dev/random" #define KEYSIZE 128 #define THREAD_LOCK() \ do { \ @@ -193,6 +193,7 @@ arc4random_stir(void) THREAD_LOCK(); arc4_check_init(); arc4_stir(); + rs_stired = 1; THREAD_UNLOCK(); } -- cgit v1.1