|
| 1 | +From cadae3ab7abf45e61ecae8aac39d97d1f3cbd336 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Lawrence Nahum < [email protected]> |
| 3 | +Date: Sun, 3 Dec 2017 22:56:09 +0100 |
| 4 | +Subject: [PATCH] fixup |
| 5 | + |
| 6 | +--- |
| 7 | + configure.ac | 1 + |
| 8 | + evutil_rand.c | 3 +++ |
| 9 | + include/event2/util.h | 4 ++-- |
| 10 | + 3 files changed, 6 insertions(+), 2 deletions(-) |
| 11 | + |
| 12 | +diff --git a/configure.ac b/configure.ac |
| 13 | +index 7528d37..3bb2121 100644 |
| 14 | +--- a/configure.ac |
| 15 | ++++ b/configure.ac |
| 16 | +@@ -341,6 +341,7 @@ dnl Checks for library functions. |
| 17 | + AC_CHECK_FUNCS([ \ |
| 18 | + accept4 \ |
| 19 | + arc4random \ |
| 20 | ++ arc4random_addrandom \ |
| 21 | + arc4random_buf \ |
| 22 | + eventfd \ |
| 23 | + epoll_create1 \ |
| 24 | +diff --git a/evutil_rand.c b/evutil_rand.c |
| 25 | +index 046a14b..3f0bf2c 100644 |
| 26 | +--- a/evutil_rand.c |
| 27 | ++++ b/evutil_rand.c |
| 28 | +@@ -191,6 +191,7 @@ evutil_secure_rng_get_bytes(void *buf, size_t n) |
| 29 | + { |
| 30 | + ev_arc4random_buf(buf, n); |
| 31 | + } |
| 32 | ++#ifdef HAVE_ARC4RANDOM_ADDRANDOM |
| 33 | + |
| 34 | + void |
| 35 | + evutil_secure_rng_add_bytes(const char *buf, size_t n) |
| 36 | +@@ -199,6 +200,8 @@ evutil_secure_rng_add_bytes(const char *buf, size_t n) |
| 37 | + n>(size_t)INT_MAX ? INT_MAX : (int)n); |
| 38 | + } |
| 39 | + |
| 40 | ++#endif |
| 41 | ++ |
| 42 | + void |
| 43 | + evutil_free_secure_rng_globals_(void) |
| 44 | + { |
| 45 | +diff --git a/include/event2/util.h b/include/event2/util.h |
| 46 | +index dd4bbb6..a9a169d 100644 |
| 47 | +--- a/include/event2/util.h |
| 48 | ++++ b/include/event2/util.h |
| 49 | +@@ -841,7 +841,7 @@ int evutil_secure_rng_init(void); |
| 50 | + */ |
| 51 | + EVENT2_EXPORT_SYMBOL |
| 52 | + int evutil_secure_rng_set_urandom_device_file(char *fname); |
| 53 | +- |
| 54 | ++#ifdef HAVE_ARC4RANDOM_ADDRANDOM |
| 55 | + /** Seed the random number generator with extra random bytes. |
| 56 | + |
| 57 | + You should almost never need to call this function; it should be |
| 58 | +@@ -858,7 +858,7 @@ int evutil_secure_rng_set_urandom_device_file(char *fname); |
| 59 | + */ |
| 60 | + EVENT2_EXPORT_SYMBOL |
| 61 | + void evutil_secure_rng_add_bytes(const char *dat, size_t datlen); |
| 62 | +- |
| 63 | ++#endif |
| 64 | + #ifdef __cplusplus |
| 65 | + } |
| 66 | + #endif |
| 67 | +-- |
| 68 | +2.14.3 |
0 commit comments