From owner-svn-src-head@FreeBSD.ORG Fri Nov 30 22:23:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 735C4D61; Fri, 30 Nov 2012 22:23:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5960F8FC15; Fri, 30 Nov 2012 22:23:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAUMNOY8066010; Fri, 30 Nov 2012 22:23:24 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAUMNOxS066009; Fri, 30 Nov 2012 22:23:24 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201211302223.qAUMNOxS066009@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 30 Nov 2012 22:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243715 - head/crypto/openssl/crypto/rand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2012 22:23:24 -0000 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)) */