+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]
/** 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.
/** 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.
#
-# 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 :
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.
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
#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
}