[master] check for arc4random_addrandom()
3840. [port] Check for arc4random_addrandom() before using it; it's been removed from OpenBSD 5.5. [RT #35907]
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
||||
3840. [port] Check for arc4random_addrandom() before using it;
|
||||
it's been removed from OpenBSD 5.5. [RT #35907]
|
||||
|
||||
3839. [test] Use only posix-compatible shell in system tests.
|
||||
[RT #35625]
|
||||
|
||||
|
||||
@@ -73,6 +73,9 @@
|
||||
/** define if arc4random() exists */
|
||||
#undef HAVE_ARC4RANDOM
|
||||
|
||||
/** define if arc4random_addrandom() exists */
|
||||
#undef HAVE_ARC4RANDOM_ADDRANDOM
|
||||
|
||||
/**
|
||||
* define if pthread_setconcurrency() should be called to tell the
|
||||
* OS how many threads we might want to run.
|
||||
|
||||
@@ -73,6 +73,9 @@
|
||||
/** define if arc4random() exists */
|
||||
#undef HAVE_ARC4RANDOM
|
||||
|
||||
/** define if arc4random_addrandom() exists */
|
||||
#undef HAVE_ARC4RANDOM_ADDRANDOM
|
||||
|
||||
/**
|
||||
* define if pthread_setconcurrency() should be called to tell the
|
||||
* OS how many threads we might want to run.
|
||||
|
||||
9
configure
vendored
9
configure
vendored
@@ -14113,7 +14113,8 @@ fi
|
||||
|
||||
|
||||
#
|
||||
# Do we have arc4random() ?
|
||||
# Do we have arc4random(), etc ? arc4random_addrandom() has been removed
|
||||
# from OpenBSD 5.5 onwards.
|
||||
#
|
||||
ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random"
|
||||
if test "x$ac_cv_func_arc4random" = xyes; then :
|
||||
@@ -14121,6 +14122,12 @@ if test "x$ac_cv_func_arc4random" = xyes; then :
|
||||
|
||||
fi
|
||||
|
||||
ac_fn_c_check_func "$LINENO" "arc4random_addrandom" "ac_cv_func_arc4random_addrandom"
|
||||
if test "x$ac_cv_func_arc4random_addrandom" = xyes; then :
|
||||
$as_echo "#define HAVE_ARC4RANDOM_ADDRANDOM 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Begin pthreads checking.
|
||||
|
||||
@@ -967,9 +967,11 @@ fi
|
||||
AC_SUBST(CHECK_DSA)
|
||||
|
||||
#
|
||||
# Do we have arc4random() ?
|
||||
# Do we have arc4random(), etc ? arc4random_addrandom() has been removed
|
||||
# from OpenBSD 5.5 onwards.
|
||||
#
|
||||
AC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
|
||||
AC_CHECK_FUNC(arc4random_addrandom, AC_DEFINE(HAVE_ARC4RANDOM_ADDRANDOM))
|
||||
|
||||
sinclude(config.threads.in)dnl
|
||||
|
||||
|
||||
@@ -67,8 +67,16 @@ isc_random_seed(isc_uint32_t seed)
|
||||
|
||||
#ifndef HAVE_ARC4RANDOM
|
||||
srand(seed);
|
||||
#else
|
||||
#elif defined(HAVE_ARC4RANDOM_ADDRANDOM)
|
||||
arc4random_addrandom((u_char *) &seed, sizeof(isc_uint32_t));
|
||||
#else
|
||||
/*
|
||||
* If arcrandom() is available and no corresponding seeding
|
||||
* function arc4random_addrandom() is available, no seeding is
|
||||
* done on such platforms (e.g., OpenBSD 5.5). This is because
|
||||
* the OS itself is supposed to seed the RNG and it is assumed
|
||||
* that no explicit seeding is required.
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user