diff options
Diffstat (limited to 'src/lib/libcrypto/rand/rand_unix.c')
| -rw-r--r-- | src/lib/libcrypto/rand/rand_unix.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/lib/libcrypto/rand/rand_unix.c b/src/lib/libcrypto/rand/rand_unix.c index e3a65571c8..3316388443 100644 --- a/src/lib/libcrypto/rand/rand_unix.c +++ b/src/lib/libcrypto/rand/rand_unix.c | |||
| @@ -219,16 +219,10 @@ int RAND_poll(void) | |||
| 219 | #elif defined __OpenBSD__ | 219 | #elif defined __OpenBSD__ |
| 220 | int RAND_poll(void) | 220 | int RAND_poll(void) |
| 221 | { | 221 | { |
| 222 | u_int32_t rnd = 0, i; | ||
| 223 | unsigned char buf[ENTROPY_NEEDED]; | 222 | unsigned char buf[ENTROPY_NEEDED]; |
| 224 | 223 | ||
| 225 | for (i = 0; i < sizeof(buf); i++) { | 224 | arc4random_buf(buf, sizeof(buf)); |
| 226 | if (i % 4 == 0) | 225 | RAND_add(buf, sizeof(buf), sizeof(buf)); |
| 227 | rnd = arc4random(); | ||
| 228 | buf[i] = rnd; | ||
| 229 | rnd >>= 8; | ||
| 230 | } | ||
| 231 | RAND_add(buf, sizeof(buf), ENTROPY_NEEDED); | ||
| 232 | memset(buf, 0, sizeof(buf)); | 226 | memset(buf, 0, sizeof(buf)); |
| 233 | 227 | ||
| 234 | return 1; | 228 | return 1; |
