From 4497a308d1b105200afe2b2fd35e6ebfba8b5e0f Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 21 Jul 2008 10:31:28 +0000 Subject: 1) Set stired flag after forced initialization. 2) Increase arc4_count to the limit OpenBSD use. Submitted by: Thorsten Glaser (1) Obtained from: OpenBSD (2) --- lib/libc/gen/arc4random.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libc/gen/arc4random.c b/lib/libc/gen/arc4random.c index 21dd09f..c9f1e7f 100644 --- a/lib/libc/gen/arc4random.c +++ b/lib/libc/gen/arc4random.c @@ -124,7 +124,7 @@ arc4_stir(struct arc4_stream *as) */ for (n = 0; n < 1024; n++) (void) arc4_getbyte(as); - arc4_count = 400000; + arc4_count = 1600000; } static inline u_int8_t @@ -179,6 +179,7 @@ arc4random_stir(void) THREAD_LOCK(); arc4_check_init(); arc4_stir(&rs); + rs_stired = 1; THREAD_UNLOCK(); } -- cgit v1.1