summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2008-09-09 09:46:36 +0000
committerache <ache@FreeBSD.org>2008-09-09 09:46:36 +0000
commitc6428874f2f7ef6896f3afdd6a7531469af76033 (patch)
tree658ddc1031570a7dd374901096311629536b25bf /lib
parentc60eddf2cd4550ef2c71e9e9c660b7c03dafea92 (diff)
downloadFreeBSD-src-c6428874f2f7ef6896f3afdd6a7531469af76033.zip
FreeBSD-src-c6428874f2f7ef6896f3afdd6a7531469af76033.tar.gz
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 <tg@mirbsd.de> (2)
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/arc4random.c3
1 files changed, 2 insertions, 1 deletions
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();
}
OpenPOWER on IntegriCloud