summaryrefslogtreecommitdiffstats
path: root/tdm
diff options
context:
space:
mode:
Diffstat (limited to 'tdm')
-rw-r--r--tdm/ConfigureChecks.cmake1
-rw-r--r--tdm/backend/genauth.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/tdm/ConfigureChecks.cmake b/tdm/ConfigureChecks.cmake
index cb333aa61..cb5615243 100644
--- a/tdm/ConfigureChecks.cmake
+++ b/tdm/ConfigureChecks.cmake
@@ -98,6 +98,7 @@ if( NOT HAVE_ARC4RANDOM )
set( DEV_RANDOM "/dev/random" CACHE INTERNAL "" FORCE )
endif( )
endif (NOT HAVE_ARC4RANDOM)
+check_function_exists( arc4random_buf HAVE_ARC4RANDOM_BUF )
# Xau
pkg_search_module( XAU xau )
diff --git a/tdm/backend/genauth.c b/tdm/backend/genauth.c
index 6da95cce0..1bde2fc85 100644
--- a/tdm/backend/genauth.c
+++ b/tdm/backend/genauth.c
@@ -432,7 +432,10 @@ AddPreGetEntropy( void )
int
GenerateAuthData( char *auth, int len )
{
-#ifdef HAVE_ARC4RANDOM
+#ifdef HAVE_ARC4RANDOM_BUF
+ arc4random_buf((void*)auth, (size_t)len);
+ return 1;
+#elif defined(HAVE_ARC4RANDOM)
int i;
unsigned *rnd = (unsigned *)auth;
if (sizeof(unsigned) == 4)