summaryrefslogtreecommitdiff
path: root/src/lib/libc/crypt/arc4random.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/crypt/arc4random.c')
-rw-r--r--src/lib/libc/crypt/arc4random.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/lib/libc/crypt/arc4random.c b/src/lib/libc/crypt/arc4random.c
index 843751d09e..1e338f9968 100644
--- a/src/lib/libc/crypt/arc4random.c
+++ b/src/lib/libc/crypt/arc4random.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random.c,v 1.14 2005/06/06 14:57:59 kjell Exp $ */ 1/* $OpenBSD: arc4random.c,v 1.15 2005/11/30 07:51:02 otto Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996, David Mazieres <dm@uun.org> 4 * Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -99,14 +99,7 @@ arc4_stir(struct arc4_stream *as)
99 mib[1] = KERN_ARND; 99 mib[1] = KERN_ARND;
100 100
101 len = sizeof(rnd); 101 len = sizeof(rnd);
102 if (sysctl(mib, 2, rnd, &len, NULL, 0) == -1) { 102 sysctl(mib, 2, rnd, &len, NULL, 0);
103 for (i = 0; i < sizeof(rnd) / sizeof(u_int); i ++) {
104 len = sizeof(u_int);
105 if (sysctl(mib, 2, &rnd[i * sizeof(u_int)], &len,
106 NULL, 0) == -1)
107 break;
108 }
109 }
110 103
111 arc4_stir_pid = getpid(); 104 arc4_stir_pid = getpid();
112 arc4_addrandom(as, rnd, sizeof(rnd)); 105 arc4_addrandom(as, rnd, sizeof(rnd));