Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Nov 2012 22:23:24 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r243715 - head/crypto/openssl/crypto/rand
Message-ID:  <201211302223.qAUMNOxS066009@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Fri Nov 30 22:23:23 2012
New Revision: 243715
URL: http://svnweb.freebsd.org/changeset/base/243715

Log:
  Allow OpenSSL to use arc4random(3) on FreeBSD. arc4random(3) was modified
  some time ago to use sysctl instead of /dev/random to get random data,
  so is now much better choice, especially for sandboxed processes that have
  no direct access to /dev/random.
  
  Approved by:	benl
  MFC after:	2 weeks

Modified:
  head/crypto/openssl/crypto/rand/rand_unix.c

Modified: head/crypto/openssl/crypto/rand/rand_unix.c
==============================================================================
--- head/crypto/openssl/crypto/rand/rand_unix.c	Fri Nov 30 22:19:18 2012	(r243714)
+++ head/crypto/openssl/crypto/rand/rand_unix.c	Fri Nov 30 22:23:23 2012	(r243715)
@@ -216,7 +216,7 @@ int RAND_poll(void)
 	}
 	return 1;
 }
-#elif defined __OpenBSD__
+#elif defined(__FreeBSD__) || defined(__OpenBSD__)
 int RAND_poll(void)
 {
 	u_int32_t rnd = 0, i;
@@ -233,7 +233,7 @@ int RAND_poll(void)
 
 	return 1;
 }
-#else /* !defined(__OpenBSD__) */
+#else /* !defined(__FreeBSD__) && !defined(__OpenBSD__) */
 int RAND_poll(void)
 {
 	unsigned long l;
@@ -419,7 +419,7 @@ int RAND_poll(void)
 #endif
 }
 
-#endif /* defined(__OpenBSD__) */
+#endif /* defined(__FreeBSD__) || defined(__OpenBSD__) */
 #endif /* !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)) */
 
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211302223.qAUMNOxS066009>