Commit graph

11041 commits

Author SHA1 Message Date
Michał Kępień
5c03cd339e Reimplement all zone logging functions using dns_zone_logv()
In order to decrease code duplication, express the logic contained in
all zone logging functions using dns_zone_logv() calls.
2018-06-11 12:49:06 +02:00
Michał Kępień
bb2dfb3f49 Add dns_zone_logv()
Add a new libdns function, dns_zone_logv(), which takes a single va_list
argument rather than a variable number of arguments and can be used as a
base for implementing more specific zone logging functions.
2018-06-11 12:49:06 +02:00
Evan Hunt
8d923a05a9 ensure that we attempt to validate glue if it's signed
- incidentally fixed a bug in the dnssec system test where TTLs in the
  answer section rather than the additional section were being checked
2018-06-08 11:39:25 -07:00
Mark Andrews
0e10223029 add answer-cookie as a obsolete option 2018-06-08 11:21:43 -07:00
Mark Andrews
b313084af2 add cfg_parse_buffer4 2018-06-08 17:37:14 +10:00
Mark Andrews
befff9452c Add support for marking a option as deprecated. 2018-06-08 15:45:16 +10:00
Witold Kręcicki
cb3208aa43 Don't fetch DNSKEY when fuzzing resolver 2018-06-06 15:06:23 +02:00
Ondřej Surý
013a49474c fix whitespaces 2018-06-06 14:37:22 +02:00
Ondřej Surý
b4aa7a9d7e Remove entropy.h from Makefile.in 2018-06-06 14:36:33 +02:00
Mark Andrews
87a3dc8ab9 add support -T sigvalinsecs 2018-06-06 15:35:57 +10:00
Mark Andrews
0667bf7ae7 only sign with other keys when deleting a key if there are not already existing signature for the deleted algorithm 2018-06-06 15:33:41 +10: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ý
27593e65dc Remove support for obsoleted ECC-GOST (GOST R 34.11-94) algorithm 2018-06-05 09:14:14 +02:00
Tony Finch
abfbedc0b1 Move NSID logging to its own category
It is very verbose, so it is useful to be able to filter it out.
2018-06-05 12:10:37 +10:00
Mukund Sivaraman
b0d9198e03 Add NSEC3 fromtext/totext unittests 2018-06-04 12:21:48 +10:00
Mukund Sivaraman
d4ea1edd2c Don't insert 2nd space between NSEC3 nexthash and typemap fields 2018-06-04 12:21:48 +10:00
Ondřej Surý
4f6d6919ab Remove thread_local macro from win32 platform.h 2018-05-30 23:03:22 +02:00
Ondřej Surý
29be9cddaf Uninline isc_nonce_buf 2018-05-30 22:43:39 +02:00
Ondřej Surý
e50210c695 Add isc_entropy_get to libisc.def.in 2018-05-30 22:34:57 +02:00
Ondřej Surý
ed3389a72c Remove return from void function 2018-05-30 22:14:38 +02:00
Ondřej Surý
eb242959cb Add nonce.{c,h} and entropy.c to libisc.vcxproj.* 2018-05-30 22:07:51 +02:00
Ondřej Surý
05d7aa5734 Fix various build failures on Windows (Courtesy of rockerinthelocker) 2018-05-30 15:09:55 +02:00
Ondřej Surý
430e8d6858 Change the _LOCK macro on Windows and the variable initialization to be more VC compatible 2018-05-30 07:28:19 +02:00
Ondřej Surý
12bdee3aa7 Turn the _LOCK/_UNLOCK in xoshiro128** to no-op for non-threaded builds 2018-05-30 06:37:51 +02:00
Ondřej Surý
28e0b2c4c4 Use isc int types to be able to build with old VS 2018-05-30 06:26:05 +02:00
Evan Hunt
3abb2db9e8 fix missing config.h and win32 symbols 2018-05-29 18:39:56 -07:00
Ondřej Surý
ce71d94434 Make the xoshiro128plusplus thread-safe 2018-05-29 22:58:49 +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
Mark Andrews
cb5802e854 work around cppcheck false positive 2018-05-29 09:28:30 +10:00
Evan Hunt
3006ccb7f0 improve readability of radix code
- use RADIX_V4 and RADIX_V6 instead of 0 and 1 as array indices
- remove some unused macros
2018-05-28 18:45:41 -04:00
Tony Finch
4b442c309d Move serve-stale logging to its own category, so that its verbosity can be curtailed. 2018-05-25 22:00:51 -07:00
Evan Hunt
7fbffa6c44 remove #ifndef DNS_RBT_USEHASH from rbtdb.c
- this was a compile time option to disable the use of a hash table in
  the RBTDB. the code path without the hash table was buggy and
  untested, and unlikely to be needed by anyone anyway.
2018-05-25 09:12:17 -07: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
Evan Hunt
9147a31b94 copyrights 2018-05-23 12:39:40 -04:00
Evan Hunt
1c1a02d244 fix broken win32 code in random.c 2018-05-22 16:32:21 -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
Ondřej Surý
c4a38bd127 Remove extra FATAL prefix from FATAL_ERROR call 2018-05-22 12:31:54 +02:00
Ondřej Surý
88631dad8f Provide better error message on failed RAND_bytes call 2018-05-22 12:12:25 +02:00
Tinderbox User
9536688b37 regenerate doc 2018-05-21 19:59:45 +00:00
Evan Hunt
df4df8e0d5 begin preparation for 9.13.0
- tidy up release notes, removing the existing "security fixes" and
  "bug fixes" sections
- add a section in the release notes to discuss the new version
  numbering
- update version, CHANGES, api, and mapapi files
2018-05-21 11:50:38 -07:00
Michał Kępień
46bb4dd124 Detect recursion loops during query processing
Interrupt query processing when query_recurse() attempts to ask the same
name servers for the same QNAME/QTYPE tuple for two times in a row as
this indicates that query processing may be stuck for an indeterminate
period of time, e.g. due to interactions between features able to
restart query_lookup().
2018-05-21 09:50:10 -07:00
Michał Kępień
391fac1fc8 Prevent check_stale_header() from leaking rdataset headers
check_stale_header() fails to update the pointer to the previous header
while processing rdataset headers eligible for serve-stale, thus
enabling rdataset headers to be leaked (i.e. disassociated from a node
and left on the relevant TTL heap) while iterating through a node.  This
can lead to several different assertion failures.  Add the missing
pointer update.
2018-05-21 09:50:10 -07:00
Mark Andrews
6bff1768cf ISC_SOCKEVENTATTR_TRUNC was not be set 2018-05-18 15:34:48 +10:00
Mukund Sivaraman
975afc508d Fix ARM about min-update-interval default for RPZ zones
Also, use variable names consistent with catz for rpz configuration functions
2018-05-17 19:02:51 -07:00
Mark Andrews
074f247926 remove dstrandom_test 2018-05-17 16:10:24 +10:00
Tony Finch
174cd00290 Fix request-nsid log level to match documentation.
Since change 3741 (commit 1d761cb4) they have been logged at
debug(3) by mistake.
2018-05-16 20:20:05 +01:00
Ondřej Surý
2b8fab6828 Remove genrandom command and all usage of specific random files throughout the system test suite 2018-05-16 09:54:35 +02: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
Mukund Sivaraman
31bd3147d1 Don't validate non-pending glue when adding to the additional section 2018-05-16 08:15:36 +02:00
Michał Kępień
6ddbca6f2b isc_buffer_*(): if source can be NULL, only call memmove() when length is non-zero
Certain isc_buffer_*() functions might call memmove() with the second
argument (source) set to NULL and the third argument (length) set to 0.
While harmless, it triggers an ubsan warning:

    runtime error: null pointer passed as argument 2, which is declared to never be null

Modify all memmove() call sites in lib/isc/include/isc/buffer.h and
lib/isc/buffer.c which may potentially use NULL as the second argument
(source) so that memmove() is only called if the third argument (length)
is non-zero.
2018-05-15 09:11:34 +02:00