diff options
-rw-r--r-- | src/lib/libcrypto/rand/rand_unix.c | 10 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/rand/rand_unix.c | 10 |
2 files changed, 4 insertions, 16 deletions
diff --git a/src/lib/libcrypto/rand/rand_unix.c b/src/lib/libcrypto/rand/rand_unix.c index 6c2be5cb96..964d25833c 100644 --- a/src/lib/libcrypto/rand/rand_unix.c +++ b/src/lib/libcrypto/rand/rand_unix.c | |||
@@ -136,16 +136,10 @@ | |||
136 | #ifdef __OpenBSD__ | 136 | #ifdef __OpenBSD__ |
137 | int RAND_poll(void) | 137 | int RAND_poll(void) |
138 | { | 138 | { |
139 | u_int32_t rnd = 0, i; | ||
140 | unsigned char buf[ENTROPY_NEEDED]; | 139 | unsigned char buf[ENTROPY_NEEDED]; |
141 | 140 | ||
142 | for (i = 0; i < sizeof(buf); i++) { | 141 | arc4random_buf(buf, sizeof(buf)); |
143 | if (i % 4 == 0) | 142 | RAND_add(buf, sizeof(buf), sizeof(buf)); |
144 | rnd = arc4random(); | ||
145 | buf[i] = rnd; | ||
146 | rnd >>= 8; | ||
147 | } | ||
148 | RAND_add(buf, sizeof(buf), ENTROPY_NEEDED); | ||
149 | memset(buf, 0, sizeof(buf)); | 143 | memset(buf, 0, sizeof(buf)); |
150 | 144 | ||
151 | return 1; | 145 | return 1; |
diff --git a/src/lib/libssl/src/crypto/rand/rand_unix.c b/src/lib/libssl/src/crypto/rand/rand_unix.c index 6c2be5cb96..964d25833c 100644 --- a/src/lib/libssl/src/crypto/rand/rand_unix.c +++ b/src/lib/libssl/src/crypto/rand/rand_unix.c | |||
@@ -136,16 +136,10 @@ | |||
136 | #ifdef __OpenBSD__ | 136 | #ifdef __OpenBSD__ |
137 | int RAND_poll(void) | 137 | int RAND_poll(void) |
138 | { | 138 | { |
139 | u_int32_t rnd = 0, i; | ||
140 | unsigned char buf[ENTROPY_NEEDED]; | 139 | unsigned char buf[ENTROPY_NEEDED]; |
141 | 140 | ||
142 | for (i = 0; i < sizeof(buf); i++) { | 141 | arc4random_buf(buf, sizeof(buf)); |
143 | if (i % 4 == 0) | 142 | RAND_add(buf, sizeof(buf), sizeof(buf)); |
144 | rnd = arc4random(); | ||
145 | buf[i] = rnd; | ||
146 | rnd >>= 8; | ||
147 | } | ||
148 | RAND_add(buf, sizeof(buf), ENTROPY_NEEDED); | ||
149 | memset(buf, 0, sizeof(buf)); | 143 | memset(buf, 0, sizeof(buf)); |
150 | 144 | ||
151 | return 1; | 145 | return 1; |