diff --git a/configure.ac b/configure.ac index 25ede780..7e689187 100644 --- a/configure.ac +++ b/configure.ac @@ -371,7 +371,7 @@ dnl Checks for functions and headers AC_CHECK_FUNC(clock_gettime, , [AC_CHECK_LIB(rt, clock_gettime)]) AC_CHECK_FUNC(fegetenv, , [AC_CHECK_LIB(m, fegetenv)]) -AC_CHECK_FUNCS([SecureZeroMemory arc4random]) +AC_CHECK_FUNCS([SecureZeroMemory arc4random arc4random_buf]) AC_SUBST([LIBTOOL_EXTRA_FLAGS]) diff --git a/src/libsodium/sodium/utils.c b/src/libsodium/sodium/utils.c index 7026b497..6263dfc1 100644 --- a/src/libsodium/sodium/utils.c +++ b/src/libsodium/sodium/utils.c @@ -54,7 +54,7 @@ _sodium_alignedcalloc(unsigned char ** const unaligned_p, const size_t len) return NULL; } *unaligned_p = unaligned; -#ifdef HAVE_ARC4RANDOM +#ifdef HAVE_ARC4RANDOM_BUF (void) i; arc4random_buf(unaligned, len + (size_t) 256U); #else