]> granicus.if.org Git - libevent/commitdiff
Fix arc4random_addrandom() detecting and fallback (regression)
authorAzat Khuzhin <a3at.mail@gmail.com>
Mon, 27 Mar 2017 12:50:23 +0000 (15:50 +0300)
committerAzat Khuzhin <azat@libevent.org>
Sat, 2 Feb 2019 12:13:50 +0000 (15:13 +0300)
But this is kind of hot-fix, we definitelly need more sane arc4random
compat layer.

Fixes: #488
Introduced-in: 6541168 ("Detect arch4random_addrandom() existence")
(cherry picked from commit 266f43af7798befa3d27bfabaa9ae699259c3924)

event-config.h.cmake
include/event2/util.h

index b7f0be57c79866cd0d2b82ee7b08871a3fa864b6..5c233a3d9b2a6f970451e316709879cd55ca8b3b 100644 (file)
@@ -53,6 +53,9 @@
 /* Define to 1 if you have the `arc4random_buf' function. */
 #cmakedefine EVENT__HAVE_ARC4RANDOM_BUF 1
 
+/* Define to 1 if you have the `arc4random_addrandom' function. */
+#cmakedefine EVENT__HAVE_ARC4RANDOM_ADDRANDOM 1
+
 /* Define if clock_gettime is available in libc */
 #cmakedefine EVENT__DNS_USE_CPU_CLOCK_FOR_ID 1
 
index c4af2bd608ce6eafdb0111eaa2a16fc7e7be354b..ca40489442959be3cd92c99934c9d61379906571 100644 (file)
@@ -842,7 +842,7 @@ int evutil_secure_rng_init(void);
 EVENT2_EXPORT_SYMBOL
 int evutil_secure_rng_set_urandom_device_file(char *fname);
 
-#ifdef EVENT__HAVE_ARC4RANDOM_ADDRANDOM
+#if !defined(EVENT__HAVE_ARC4RANDOM) || defined(EVENT__HAVE_ARC4RANDOM_ADDRANDOM)
 /** Seed the random number generator with extra random bytes.
 
     You should almost never need to call this function; it should be