From 00b426069b0dfa8f0d9b87308646e9684f45c515 Mon Sep 17 00:00:00 2001 From: markus <> Date: Wed, 7 Apr 2004 20:42:12 +0000 Subject: import openssl-0.9.7d --- src/lib/libcrypto/rand/rand_unix.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/lib/libcrypto/rand/rand_unix.c') diff --git a/src/lib/libcrypto/rand/rand_unix.c b/src/lib/libcrypto/rand/rand_unix.c index a776e52243..0599719dd1 100644 --- a/src/lib/libcrypto/rand/rand_unix.c +++ b/src/lib/libcrypto/rand/rand_unix.c @@ -124,6 +124,24 @@ #include #include +#ifdef __OpenBSD__ +int RAND_poll(void) +{ + u_int32_t rnd = 0, i; + unsigned char buf[ENTROPY_NEEDED]; + + for (i = 0; i < sizeof(buf); i++) { + if (i % 4 == 0) + rnd = arc4random(); + buf[i] = rnd; + rnd >>= 8; + } + RAND_add(buf, sizeof(buf), ENTROPY_NEEDED); + memset(buf, 0, sizeof(buf)); + + return 1; +} +#else int RAND_poll(void) { unsigned long l; @@ -235,6 +253,7 @@ int RAND_poll(void) #endif } +#endif #endif #if defined(OPENSSL_SYS_VXWORKS) -- cgit v1.2.3-55-g6feb