Evan Hunt
231436039d
convert sockaddr_test
2018-11-14 20:17:04 -08:00
Evan Hunt
7ab8c5b583
convert netaddr_test
2018-11-14 20:17:04 -08:00
Evan Hunt
5f377136be
convert symtab_test
2018-11-14 20:17:04 -08:00
Evan Hunt
b3db0266cb
convert queue_test
2018-11-14 20:17:04 -08:00
Evan Hunt
8161be27db
convert file_test
2018-11-14 20:17:04 -08:00
Evan Hunt
4133fd86f1
convert lex_test
2018-11-14 20:17:04 -08:00
Evan Hunt
049a3a7c0e
convert errno_test
2018-11-14 20:17:04 -08:00
Evan Hunt
c1c8d8846f
convert safe_test
2018-11-14 20:17:04 -08:00
Evan Hunt
718ca3166c
convert radix_test
2018-11-14 20:17:04 -08:00
Evan Hunt
cc6ab2416b
convert heap_test
2018-11-14 20:17:04 -08:00
Evan Hunt
a7c308df9c
convert parse_test
2018-11-14 20:17:04 -08:00
Evan Hunt
52b86f0abe
convert counter_test
2018-11-14 20:17:04 -08:00
Evan Hunt
02a5db7631
convert buffer_test
2018-11-14 20:17:04 -08:00
Evan Hunt
dc88db015b
convert aes_test
2018-11-14 20:17:04 -08:00
Evan Hunt
d8766293ab
assert if {isc,dns,ns}_test_begin() is called when a prior test is running
2018-11-14 20:17:04 -08:00
Evan Hunt
b434b0a4b6
remove .NOTPARALLEL so unit tests can build faster
2018-11-14 20:17:04 -08:00
Evan Hunt
f456e64736
set HAVE_CMOCKA correctly when using --with-cmocka=yes
...
(note: this is still broken if using --with-cmocka=path)
2018-11-14 20:17:04 -08:00
Mark Andrews
9024cf0c15
remove lib/isc/tests/result_test as it is now cmocka
2018-11-13 07:26:29 +11:00
Evan Hunt
471110933a
convert result tests to use CMocka instead of ATF
2018-11-10 12:29:40 -08:00
Mark Andrews
4f04a79250
check result tables are complete
2018-11-10 10:30:43 +11:00
Ondřej Surý
b2b43fd235
Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool
2018-11-08 12:21:53 +07:00
Witold Kręcicki
c80e25e482
Get rid of isc_taskmgr_setmode, we only use it to set privileged mode
2018-11-06 08:19:50 +00:00
Evan Hunt
a0de6707c0
silence warning from missing print.h
2018-10-30 08:06:34 -07:00
Michał Kępień
15440d8027
Add unit tests for isc_buffer_copyregion()
...
Add some basic checks for isc_buffer_copyregion() to ensure it behaves
as expected for both fixed-size buffers and buffers which can be
automatically reallocated. Adjust the list of headers included by
lib/isc/tests/buffer_test.c so that it matches what that test program
really uses.
2018-10-30 13:33:25 +01:00
Ondřej Surý
13888c93a4
Split isc_crc64 API test into separate unit test and convert it to cmocka
2018-10-25 08:16:24 +02:00
Ondřej Surý
b98ac2593c
Add generic hashed message authentication code API (isc_hmac) to replace specific HMAC functions hmacmd5/hmacsha1/hmacsha2...
2018-10-25 08:15:42 +02:00
Ondřej Surý
7fd3dc63de
Add generic message digest API (isc_md) to replace specific MD functions md5/sha1/sha256
2018-10-25 08:15:42 +02:00
Evan Hunt
09f58ab63f
retain a minimal "methods" struct in the mctx
...
- this enables memory to be allocated and freed in dyndb modules
when named is linked statically. when we standardize on libtool,
this should become unnecessary.
- also, simplified the isc_mem_create/createx API by removing
extra compatibility functions
2018-10-18 09:19:12 +00:00
Evan Hunt
0e86fa16e8
complete removal of a few unneeded functions
...
- removed register functions from isc_app, isc_timer, isc_task
- added a task_p.h header for use by unit tests
2018-10-18 09:19:12 +00:00
Witold Kręcicki
38a127c35b
Remove layering from isc_task, isc_app, isc_socket, isc_timer, isc_mem
2018-10-18 09:19:12 +00:00
Ondřej Surý
376bea8b40
Cleanup the custom atomic defines from Windows and remove empty atomic_test.c
2018-09-07 12:17:29 +02:00
Ondřej Surý
388d6db5a1
Remove support for legacy systems without inet_{ntop,pton} w/ IPv6 support
2018-08-28 10:31:48 +02:00
Ondřej Surý
7b21bbb7c1
Require IPv6 support from the OS
2018-08-28 10:31:47 +02:00
Ondřej Surý
00ca487fec
We always want IPv6
2018-08-28 10:31:47 +02:00
Witold Kręcicki
5cdb38c2c7
Remove unthreaded support
2018-08-16 17:18:52 +02:00
Mark Andrews
5dd1beec8e
mempool didn't work for sizes less than sizeof(void*)
2018-08-14 03:47:14 -04:00
Ondřej Surý
994e656977
Replace custom isc_boolean_t with C standard bool type
2018-08-08 09:37:30 +02:00
Ondřej Surý
cb6a185c69
Replace custom isc_u?intNN_t types with C99 u?intNN_t types
2018-08-08 09:37:28 +02:00
Ondřej Surý
64fe6bbaf2
Replace ISC_PRINT_QUADFORMAT with inttypes.h format constants
2018-08-08 09:36:44 +02:00
Ondřej Surý
20faf4652a
Change isc_buffer_reallocate() into a static functions as it is not used outside of isc_buffer_reserve()
2018-07-31 22:00:30 +02:00
Ondřej Surý
7785f644c3
Remove illogical condition from isc_buffer_reallocate that would return ISC_R_NOSPACE when requested size is less than available size
2018-07-31 22:00:30 +02:00
Ondřej Surý
71877806e8
Fix ax_check_openssl to accept yes and improve it to modern autotools standard
2018-07-23 22:10:52 +02:00
Ondřej Surý
083461d332
Fix the isc_safe_memwipe() usage with (NULL, >0)
2018-07-20 10:08:24 -04:00
Ondřej Surý
b105ccee68
Remove isc_safe_memcompare, it's not needed anywhere and can't be replaced with CRYPTO_memcmp()
2018-07-20 10:06:14 -04:00
Mark Andrews
4c3386ad95
remove lib/isc/print.c and lib/isc/tests/print_test.c
2018-07-19 23:24:28 -04:00
Ondřej Surý
c3b8130fe8
Make OpenSSL mandatory
2018-07-19 12:47:03 -04:00
Ondřej Surý
07910f0153
Integrate cmocka unit testing framework to kyua
2018-06-20 06:30:07 -04:00
Ondřej Surý
edcdfe9619
Disable the random_test from the regular kyua run, we are either using cryptolib PRNG or non-CS PRNG
2018-06-05 22:49:14 +02:00
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
Evan Hunt
e324449349
remove the experimental authoritative ECS support from named
...
- mark the 'geoip-use-ecs' option obsolete; warn when it is used
in named.conf
- prohibit 'ecs' ACL tags in named.conf; note that this is a fatal error
since simply ignoring the tags could make ACLs behave unpredictably
- re-simplify the radix and iptable code
- clean up dns_acl_match(), dns_aclelement_match(), dns_acl_allowed()
and dns_geoip_match() so they no longer take ecs options
- remove the ECS-specific unit and system test cases
- remove references to ECS from the ARM
2018-05-25 08:21:25 -07:00
Ondřej Surý
7ee8a7e69f
address win32 build issues
...
- Replace external -DOPENSSL/-DPKCS11CRYPTO with properly AC_DEFINEd
HAVE_OPENSSL/HAVE_PKCS11
- Don't enforce the crypto provider from platform.h, just from dst_api.c
and configure scripts
2018-05-22 16:32:21 -07:00
Tinderbox User
9536688b37
regenerate doc
2018-05-21 19:59:45 +00:00
Mark Andrews
6bff1768cf
ISC_SOCKEVENTATTR_TRUNC was not be set
2018-05-18 15:34:48 +10:00
Ondřej Surý
3a4f820d62
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
2018-05-16 09:54:35 +02:00
Ondřej Surý
55a10b7acd
Remove $Id markers, Principal Author and Reviewed tags from the full source tree
2018-05-11 13:17:46 +02:00
Mark Andrews
6aae115d15
silence cppcheck portability warning
2018-05-11 08:12:17 +02:00
Ondřej Surý
8d3220643c
Also test the higher part of the confidence interval
2018-05-03 08:30:31 -04:00
Mark Andrews
49f8e9571c
use %u instead of %d for unsigned int arguments
2018-04-20 14:50:35 -07:00
Ondřej Surý
b097be17ef
Remove unused obsolete isc_hash_* function, and just keep the FNV-1a version
2018-04-04 23:12:14 +02:00
Evan Hunt
0fabe0da83
update file headers
2018-03-15 18:33:13 -07:00
Evan Hunt
1b3eac926e
add an 'untested' case when none of the atomic operations are available
...
- this fixes a build failure introduced in change 4913 when
compiling with ATF and --disable-atomic
2018-03-15 14:15:20 -04:00
Evan Hunt
56353aaf42
Fix compiler warnings and test failures when building without threads
2018-03-10 10:35:31 -08:00
Evan Hunt
a173c9c18f
add missing includes
2018-03-09 16:55:21 -08:00
Evan Hunt
86e00cbb71
final cleanup
...
- update Kyuafiles to match Atffiles
- copyrights
- CHANGES note
2018-03-09 14:12:50 -08:00
Evan Hunt
9b753aa154
shorten ht_test and random_test
2018-03-09 14:12:50 -08:00
Evan Hunt
c6c1e99252
migrate t_tasks to lib/isc/tests/task_test
2018-03-09 14:12:49 -08:00
Evan Hunt
e2b8699df9
migrate t_timers to lib/isc/tests/timer_test
2018-03-09 14:12:49 -08:00
Evan Hunt
874e2fc70c
migrate t_atomic to lib/isc/tests/atomic_test
2018-03-09 14:12:48 -08:00
Evan Hunt
979f054702
migrate t_mem to lib/isc/tests/mem_test
2018-03-09 14:12:48 -08:00
Evan Hunt
05b7251d51
migrate t_net to lib/isc/tests
2018-03-09 14:12:48 -08:00
Evan Hunt
62f650078a
migrate t_sockaddr to lib/isc/tests
2018-03-09 14:12:48 -08:00
Mark Andrews
b71a1386ed
remove deadcode
2018-02-24 17:50:41 -08:00
Evan Hunt
3c028ed07d
Merge branch 'kyua-oot' into 'master'
...
chg: dev: Unit tests were broken in out-of-tree builds.
See merge request isc-projects/bind9!57
2018-02-23 18:22:59 -05:00
Ondřej Surý
843d389661
Update license headers to not include years in copyright in all applicable files
2018-02-23 10:12:02 +01:00
Petr Menšík
95cde3608a
unit/unittest.sh is generated by configure. It will always be
...
generated into builddir. If out-of-tree build is used, make unit
will always fail. Kyuafiles and testdata still have to be copied
manually into the builddir.
2018-02-22 15:32:16 +01:00
Tinderbox User
5fdca0da2f
update copyright notice / whitespace
2018-02-01 23:46:26 +00:00
Michał Kępień
a3c2b8831e
[master] Silence compiler warnings about comparisons between signed and unsigned integers [RT #46980 ]
2018-02-01 21:28:47 +01:00
Francis Dupont
614d838acf
Merged rt46864 (check MD5 amd SHA1 support)
2018-01-17 14:33:21 +01:00
Tinderbox User
3d2a6c9949
update copyright notice / whitespace
2018-01-16 23:45:57 +00:00
Michał Kępień
73819362d8
[master] Simplify handling isc_socket_sendto2() return values when flags == 0
...
4865. [cleanup] Simplify handling isc_socket_sendto2() return values.
[RT #46986 ]
2018-01-16 08:33:30 +01:00
Tinderbox User
099a9efd82
update copyright notice / whitespace
2018-01-09 23:45:45 +00:00
Mark Andrews
0ce212b9f5
4861. [bug] The isc_crc64 unit test was not endian independent.
...
[RT #46973 ]
2018-01-10 09:46:08 +11:00
Tinderbox User
a280a7871d
update copyright notice / whitespace
2018-01-03 23:45:29 +00:00
Mark Andrews
1e10ef06ce
4855. [bug] isc_time_formatshorttimestamp produced incorrect
...
output. [RT #46938 ]
2018-01-04 09:57:40 +11:00
Tinderbox User
015c017dfa
regen master
2017-12-29 01:04:39 +00:00
Mark Andrews
9d5a0abe81
4841. [bug] Address -fsanitize=undefined warnings. [RT #46786 ]
2017-12-06 21:00:14 +11:00
Tinderbox User
34075107ba
update copyright notice / whitespace
2017-11-28 23:45:35 +00:00
Mark Andrews
65a483106e
4829. [bug] isc_heap_delete did not zero the index value when
...
the heap was created with a callback to do that.
[RT #46709 ]
2017-11-28 18:49:52 +11:00
Tinderbox User
e6801bf89e
update copyright notice / whitespace
2017-11-06 23:45:48 +00:00
Mukund Sivaraman
7e1df5182c
[master] isc_rng_randombytes()
...
4807. [cleanup] isc_rng_randombytes() returns a specified number of
bytes from the PRNG; this is now used instead of
calling isc_rng_random() multiple times. [RT #46230 ]
2017-11-06 10:44:37 -08:00
Mark Andrews
5ff48dca18
#include <inttypes.h>
2017-10-20 16:36:07 +11:00
Mark Andrews
66258ca349
4776. [bug] Improve portability of ht_test. [RT #46333 ]
2017-10-20 16:04:59 +11:00
Mark Andrews
583e355951
4775. [bug] Address Coverity warnings in ht_test.c and mem_test.c
...
[RT #46281 ]
2017-10-19 13:08:31 +11:00
Michał Kępień
0d61fe5dfd
[master] Remove non-portable isc_buffer_printf() unit test
2017-10-11 09:30:48 +02:00
Tinderbox User
5414e48606
update copyright notice / whitespace
2017-10-09 23:45:53 +00:00
Evan Hunt
4c368378fc
[master] print.h; add missing win32 declaration
2017-10-09 15:01:46 -07:00
Michał Kępień
077f9626c2
[master] Add isc_buffer_printf()
...
4767. [func] Add a new function, isc_buffer_printf(), which can be
used to append a formatted string to the used region of
a buffer. [RT #46201 ]
2017-10-09 11:43:07 +02:00
Tinderbox User
7ac51a8380
update copyright notice / whitespace
2017-10-04 23:45:46 +00:00
Mark Andrews
5fcdb09126
4752. [test] Add unit test for isc_net_pton. [RT #46171 ]
2017-10-04 14:10:40 +11:00
Tinderbox User
e880197f31
update copyright notice / whitespace
2017-09-27 23:45:52 +00:00