Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
Date: 2005-02-15
Initial Package Version: 0.9.7e
Upstream Status: Not submitted
Origin: None
Description: This patch enabled the arc4random() function in OpenSSL.

Also see:
http://www.linuxfromscratch.org/hlfs/
http://www.linuxfromscratch.org/hints/downloads/files/entropy.txt

diff -Naur openssl-0.9.7e.orig/crypto/rand/rand_unix.c openssl-0.9.7e/crypto/rand/rand_unix.c
--- openssl-0.9.7e.orig/crypto/rand/rand_unix.c	2003-12-27 16:01:52.000000000 +0000
+++ openssl-0.9.7e/crypto/rand/rand_unix.c	2005-02-16 02:18:48.000000000 +0000
@@ -124,7 +124,8 @@
 #include <unistd.h>
 #include <time.h>
 
-#ifdef __OpenBSD__
+/* HAVE_ARC4RANDOM is defined in stdlib.h, which comes from cryptlib.h */
+#if defined(__OpenBSD__) || defined(HAVE_ARC4RANDOM)
 int RAND_poll(void)
 {
 	u_int32_t rnd = 0, i;
