diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 41dc37b..6388cb0 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -736,8 +736,10 @@ endif() if(NOT HAVE_ARC4RANDOM_BUF) set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random.c) + set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random_uniform.c) set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random) set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_buf) + set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_uniform) if(NOT HAVE_GETENTROPY) if(CMAKE_HOST_WIN32) @@ -761,11 +763,6 @@ if(NOT HAVE_ARC4RANDOM_BUF) endif() endif() -if(NOT HAVE_ARC4RANDOM_UNIFORM) - set(CRYPTO_SRC ${CRYPTO_SRC} compat/arc4random_uniform.c) - set(EXTRA_EXPORT ${EXTRA_EXPORT} arc4random_uniform) -endif() - if(NOT HAVE_TIMINGSAFE_BCMP) set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_bcmp.c) set(EXTRA_EXPORT ${EXTRA_EXPORT} timingsafe_bcmp) diff --git a/m4/check-libc.m4 b/m4/check-libc.m4 index c66364e..53ffce6 100644 --- a/m4/check-libc.m4 +++ b/m4/check-libc.m4 @@ -152,14 +152,13 @@ echo "generating $crypto_p_sym ..." chmod u+w $srcdir/crypto cp $crypto_sym $crypto_p_sym chmod u+w $crypto_p_sym -if test "x$ac_cv_func_arc4random" = "xno" ; then - echo arc4random >> $crypto_p_sym -fi if test "x$ac_cv_func_arc4random_buf" = "xno" ; then + echo arc4random >> $crypto_p_sym echo arc4random_buf >> $crypto_p_sym -fi -if test "x$ac_cv_func_arc4random_uniform" = "xno" ; then echo arc4random_uniform >> $crypto_p_sym + if test "x$ac_cv_func_getentropy" = "xno" ; then + echo getentropy >> $crypto_p_sym + fi fi if test "x$ac_cv_func_asprintf" = "xno" ; then echo asprintf >> $crypto_p_sym @@ -168,9 +167,6 @@ fi if test "x$ac_cv_func_explicit_bzero" = "xno" ; then echo explicit_bzero >> $crypto_p_sym fi -if test "x$ac_cv_func_getentropy" = "xno" ; then - echo getentropy >> $crypto_p_sym -fi if test "x$ac_cv_func_inet_pton" = "xno" ; then echo inet_pton >> $crypto_p_sym fi