bind9/lib/dns/tests
Ondřej Surý 99ba29bc52 Change isc_random() to be just PRNG, and add isc_nonce_buf() that uses CSPRNG
This commit reverts the previous change to use system provided
entropy, as (SYS_)getrandom is very slow on Linux because it is
a syscall.

The change introduced in this commit adds a new call isc_nonce_buf
that uses CSPRNG from cryptographic library provider to generate
secure data that can be and must be used for generating nonces.
Example usage would be DNS cookies.

The isc_random() API has been changed to use fast PRNG that is not
cryptographically secure, but runs entirely in user space.  Two
contestants have been considered xoroshiro family of the functions
by Villa&Blackman and PCG by O'Neill.  After a consideration the
xoshiro128starstar function has been used as uint32_t random number
provider because it is very fast and has good enough properties
for our usage pattern.

The other change introduced in the commit is the more extensive usage
of isc_random_uniform in places where the usage pattern was
isc_random() % n to prevent modulo bias.  For usage patterns where
only 16 or 8 bits are needed (DNS Message ID), the isc_random()
functions has been renamed to isc_random32(), and isc_random16() and
isc_random8() functions have been introduced by &-ing the
isc_random32() output with 0xffff and 0xff.  Please note that the
functions that uses stripped down bit count doesn't pass our
NIST SP 800-22 based random test.
2018-05-29 22:58:21 +02:00
..
testdata Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
testkeys Add a framework for dns__zone_updatesigs() unit tests 2018-05-09 13:32:09 +02:00
acl_test.c remove the experimental authoritative ECS support from named 2018-05-25 08:21:25 -07:00
Atffile remove dstrandom_test 2018-05-17 16:10:24 +10:00
db_test.c Use dns_fixedname_initname() where possible 2018-04-09 12:14:16 +02:00
dbdiff_test.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
dbiterator_test.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
dbversion_test.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
dh_test.c address win32 build issues 2018-05-22 16:32:21 -07:00
dispatch_test.c Replace all random functions with isc_random, isc_random_buf and isc_random_uniform API. 2018-05-16 09:54:35 +02:00
dnstap_test.c Use dns_fixedname_initname() where possible 2018-04-09 12:14:16 +02:00
dnstest.c Replace all random functions with isc_random, isc_random_buf and isc_random_uniform API. 2018-05-16 09:54:35 +02:00
dnstest.h Replace all random functions with isc_random, isc_random_buf and isc_random_uniform API. 2018-05-16 09:54:35 +02:00
dst_test.c Use dns_fixedname_initname() where possible 2018-04-09 12:14:16 +02:00
geoip_test.c remove the experimental authoritative ECS support from named 2018-05-25 08:21:25 -07:00
gost_test.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
Kdh.+002+18602.key [master] add diffie-hellman key unit test 2014-10-17 15:55:37 -07:00
keytable_test.c address win32 build issues 2018-05-22 16:32:21 -07:00
Krsa.+005+29235.key Merged rt43077 (new RSA verify unit test) 2016-08-22 14:10:21 +02:00
Kyuafile Replace all random functions with isc_random, isc_random_buf and isc_random_uniform API. 2018-05-16 09:54:35 +02:00
Makefile.in address win32 build issues 2018-05-22 16:32:21 -07:00
master_test.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
mkraw.pl Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
name_test.c use %u instead of %d for unsigned int arguments 2018-04-20 14:50:35 -07:00
nsec3_test.c address win32 build issues 2018-05-22 16:32:21 -07:00
peer_test.c Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
private_test.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
rbt_serialize_test.c Change isc_random() to be just PRNG, and add isc_nonce_buf() that uses CSPRNG 2018-05-29 22:58:21 +02:00
rbt_test.c Change isc_random() to be just PRNG, and add isc_nonce_buf() that uses CSPRNG 2018-05-29 22:58:21 +02:00
rdata_test.c Rename dns_test_rdata_fromstring() to dns_test_rdatafromstring() 2018-05-09 13:14:24 +02:00
rdataset_test.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
rdatasetstats_test.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
resolver_test.c Replace all random functions with isc_random, isc_random_buf and isc_random_uniform API. 2018-05-16 09:54:35 +02:00
rsa_test.c address win32 build issues 2018-05-22 16:32:21 -07:00
sigs_test.c address win32 build issues 2018-05-22 16:32:21 -07:00
time_test.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
tsig_test.c Use dns_fixedname_initname() where possible 2018-04-09 12:14:16 +02:00
update_test.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
zonemgr_test.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
zt_test.c Rework dns_test_makezone() 2018-05-08 12:26:53 +02:00