Some systems have arc4random() but not arc4random_buf()

This commit is contained in:
Frank Denis 2013-10-22 02:54:45 -07:00
parent 1fe019c482
commit afb89c7e16
2 changed files with 2 additions and 2 deletions

View File

@ -371,7 +371,7 @@ dnl Checks for functions and headers
AC_CHECK_FUNC(clock_gettime, , [AC_CHECK_LIB(rt, clock_gettime)]) AC_CHECK_FUNC(clock_gettime, , [AC_CHECK_LIB(rt, clock_gettime)])
AC_CHECK_FUNC(fegetenv, , [AC_CHECK_LIB(m, fegetenv)]) 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]) AC_SUBST([LIBTOOL_EXTRA_FLAGS])

View File

@ -54,7 +54,7 @@ _sodium_alignedcalloc(unsigned char ** const unaligned_p, const size_t len)
return NULL; return NULL;
} }
*unaligned_p = unaligned; *unaligned_p = unaligned;
#ifdef HAVE_ARC4RANDOM #ifdef HAVE_ARC4RANDOM_BUF
(void) i; (void) i;
arc4random_buf(unaligned, len + (size_t) 256U); arc4random_buf(unaligned, len + (size_t) 256U);
#else #else