From fa3549c92b240aab23bd5838f1fdca2ae4caf055 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Sun, 13 Oct 2019 08:57:35 +0100 Subject: util/rand_xor: extend the urandom path to all non-Windows platforms Any system that provides `/dev/urandom` should be allowed to try to use it. Signed-off-by: Eric Engestrom Reviewed-by: Emmanuel Gil Peyrot Part-of: --- src/util/rand_xor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/util/rand_xor.c') diff --git a/src/util/rand_xor.c b/src/util/rand_xor.c index 3668ac9b84a..81b64f1ea71 100644 --- a/src/util/rand_xor.c +++ b/src/util/rand_xor.c @@ -22,7 +22,9 @@ * */ -#if defined(__linux__) +#include "detect_os.h" + +#if !DETECT_OS_WINDOWS #if defined(HAVE_GETRANDOM) #include #endif @@ -63,7 +65,7 @@ s_rand_xorshift128plus(uint64_t seed[2], bool randomised_seed) return; } -#if defined(__linux__) +#if !DETECT_OS_WINDOWS size_t seed_size = sizeof(uint64_t) * 2; #if defined(HAVE_GETRANDOM) -- cgit v1.2.3