Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/gen use sysctl(kern.urandom) if /dev/urandom is not...



details:   https://anonhg.NetBSD.org/src/rev/0b32cc35f7d9
branches:  trunk
changeset: 533507:0b32cc35f7d9
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue Jul 02 17:10:19 2002 +0000

description:
use sysctl(kern.urandom) if /dev/urandom is not present (like chroot jail)

diffstat:

 lib/libc/gen/arc4random.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 53d3137ba94b -r 0b32cc35f7d9 lib/libc/gen/arc4random.c
--- a/lib/libc/gen/arc4random.c Tue Jul 02 17:06:17 2002 +0000
+++ b/lib/libc/gen/arc4random.c Tue Jul 02 17:10:19 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arc4random.c,v 1.3 2002/06/14 03:11:24 itojun Exp $    */
+/*     $NetBSD: arc4random.c,v 1.4 2002/07/02 17:10:19 itojun Exp $    */
 /*     $OpenBSD: arc4random.c,v 1.6 2001/06/05 05:05:38 pvalchev Exp $ */
 
 /*
@@ -103,7 +103,7 @@
                read(fd, rdat.rnd, sizeof(rdat.rnd));
                close(fd);
        }
-#ifdef KERN_ARND
+#ifdef KERN_URND
        else {
                int i, mib[2];
                size_t len;
@@ -112,7 +112,7 @@
                 * randomness from sysctl. */
 
                mib[0] = CTL_KERN;
-               mib[1] = KERN_ARND;
+               mib[1] = KERN_URND;
 
                for (i = 0; i < sizeof(rdat.rnd) / sizeof(u_int); i ++) {
                        len = sizeof(u_int);



Home | Main Index | Thread Index | Old Index