Commit 3fb62a5a authored by Evan Hunt's avatar Evan Hunt

[master] use arc4random_stir() when available

4499.	[port]		MacOSX: silence deprecated function warning
			by using arc4random_stir() when available
			instead of arc4random_addrandom(). [RT #43503]
parent 7960fc59
4499. [port] MacOSX: silence deprecated function warning
by using arc4random_stir() when available
instead of arc4random_addrandom(). [RT #43503]
4498. [test] Simplify prerequisite checks in system tests.
[RT #43516]
......
......@@ -64,6 +64,9 @@
/** define if arc4random() exists */
#undef HAVE_ARC4RANDOM
/** define if arc4random_stir() exists */
#undef HAVE_ARC4RANDOM_STIR
/** define if arc4random_addrandom() exists */
#undef HAVE_ARC4RANDOM_ADDRANDOM
......
......@@ -14578,8 +14578,8 @@ fi
#
# Do we have arc4random(), etc ? arc4random_addrandom() has been removed
# from OpenBSD 5.5 onwards.
# Do we have arc4random(), etc ?
# Will use stir and if not exist addrandom
#
ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random"
if test "x$ac_cv_func_arc4random" = xyes; then :
......@@ -14587,6 +14587,12 @@ if test "x$ac_cv_func_arc4random" = xyes; then :
fi
ac_fn_c_check_func "$LINENO" "arc4random_stir" "ac_cv_func_arc4random_stir"
if test "x$ac_cv_func_arc4random_stir" = xyes; then :
$as_echo "#define HAVE_ARC4RANDOM_STIR 1" >>confdefs.h
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
......
......@@ -1156,10 +1156,11 @@ fi
AC_SUBST(CHECK_DSA)
#
# Do we have arc4random(), etc ? arc4random_addrandom() has been removed
# from OpenBSD 5.5 onwards.
# Do we have arc4random(), etc ?
# Will use stir and if not exist addrandom
#
AC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
AC_CHECK_FUNC(arc4random_stir, AC_DEFINE(HAVE_ARC4RANDOM_STIR))
AC_CHECK_FUNC(arc4random_addrandom, AC_DEFINE(HAVE_ARC4RANDOM_ADDRANDOM))
sinclude(config.threads.in)dnl
......
......@@ -101,17 +101,12 @@ isc_random_seed(isc_uint32_t seed) {
#ifndef HAVE_ARC4RANDOM
srand(seed);
#elif defined(HAVE_ARC4RANDOM_STIR)
/* Formally not necessary... */
UNUSED(seed);
arc4random_stir();
#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.
*/
UNUSED(seed);
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment