Replace all random functions with isc_random, isc_random_buf and isc_random_uniform API.

The three functions has been modeled after the arc4random family of
functions, and they will always return random bytes.

The isc_random family of functions internally use these CSPRNG (if available):

1. getrandom() libc call (might be available on Linux and Solaris)
2. SYS_getrandom syscall (might be available on Linux, detected at runtime)
3. arc4random(), arc4random_buf() and arc4random_uniform() (available on BSDs and Mac OS X)
4. crypto library function:
4a. RAND_bytes in case OpenSSL
4b. pkcs_C_GenerateRandom() in case PKCS#11 library
This commit is contained in:
Ondřej Surý
2018-04-22 14:56:28 +02:00
committed by Witold Kręcicki
parent 74dd289a1c
commit 3a4f820d62
115 changed files with 406 additions and 4912 deletions

View File

@@ -185,11 +185,11 @@ int sigwait(const unsigned int *set, int *sig);
/* Define to 1 if you have the `arc4random' function. */
#undef HAVE_ARC4RANDOM
/* Define to 1 if you have the `arc4random_addrandom' function. */
#undef HAVE_ARC4RANDOM_ADDRANDOM
/* Define to 1 if you have the `arc4random_buf' function. */
#undef HAVE_ARC4RANDOM_BUF
/* Define to 1 if you have the `arc4random_stir' function. */
#undef HAVE_ARC4RANDOM_STIR
/* Define to 1 if you have the `arc4random_uniform' function. */
#undef HAVE_ARC4RANDOM_UNIFORM
/* Define to 1 if the compiler supports __builtin_clz. */
#undef HAVE_BUILTIN_CLZ
@@ -272,6 +272,9 @@ int sigwait(const unsigned int *set, int *sig);
/* Build with GeoIP Country IPv6 support */
#undef HAVE_GEOIP_V6
/* Define to 1 if you have the `getrandom' function. */
#undef HAVE_GETRANDOM
/* Define to use gperftools CPU profiler. */
#undef HAVE_GPERFTOOLS_PROFILER