2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 21:47:59 +00:00

1503 Commits

Author SHA1 Message Date
Tony Finch
1b1d63acd8 Fixes for rndc nta user interface
Tell the user explicitly about their mistakes:

* Unknown options, e.g. -list instead of -dump
  or -delete instead of -remove.

* Unknown view names.

* Excess arguments.

Include the view name in `rndc nta -dump` output, for consistency with
the NTA add and remove actions.

When removing an NTA from all views, do not abort with an error if the
NTA was not found in one of the views.
2018-11-05 22:01:28 -08: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
Michał Kępień
2cb9e8a020 Replace the "mirror" zone option with "type mirror;"
Use a zone's 'type' field instead of the value of its DNS_ZONEOPT_MIRROR
option for checking whether it is a mirror zone.  This makes said zone
option and its associated helper function, dns_zone_mirror(), redundant,
so remove them.  Remove a check specific to mirror zones from
named_zone_reusable() since another check in that function ensures that
changing a zone's type prevents it from being reused during
reconfiguration.
2018-10-24 20:32:55 +02:00
Michał Kępień
e1bb8de6f0 Define a separate dns_zonetype_t for mirror zones
Rather than overloading dns_zone_slave and discerning between a slave
zone and a mirror zone using a zone option, define a separate enum
value, dns_zone_mirror, to be used exclusively by mirror zones.  Update
code handling slave zones to ensure it also handles mirror zones where
applicable.
2018-10-24 20:32:55 +02:00
Witold Kręcicki
f2af336dc4 Fix looping issues 2018-10-23 12:15:04 +00:00
Ondřej Surý
c4cee27f9b Add support for enabling and enforcing FIPS mode in OpenSSL:
* Add configure option --enable-fips-mode that detects and enables FIPS mode
* Add a function to enable FIPS mode and call it on crypto init
* Log an OpenSSL error when FIPS_mode_set() fails and exit
* Report FIPS mode status in a separate log message from named
2018-10-22 20:55:35 +02: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
Evan Hunt
ff49dd3c21 clarify relationship between dnssec-enable and dnssec-validation
- if dnssec-enable is no, then dnssec-validation now also defaults to
  no. if dnssec-enable is yes, dnssec-validation defaults to auto or yes
  depending on --disable-auto-validation.
- correct the doc
2018-10-04 23:33:18 -07:00
Evan Hunt
51c6f4b682 extend DNSTAP to record UPDATE requests and responses as a separate type 2018-10-03 01:03:56 -07:00
Evan Hunt
5752645e60 allow-recursion-on and allow-query-cache-on should inherit from each other 2018-09-27 21:48:43 -07:00
Evan Hunt
cc0abf62a1 add -class option to rndc nta 2018-09-10 12:04:04 -07:00
Evan Hunt
83dc5a704a report when NTAs added to multiple views
- the text returned by "rndc nta" when adding NTAs to multiple views
  was incorrectly terminated after the first line, so users only saw
  on NTA added unless they checked the logs.
2018-09-10 12:02:49 -07:00
Witold Kręcicki
79ce86090a rndc reconfig should not touch already loaded zones, some refactoring of dns_{zone,view,zt}_{async,}load 2018-08-28 17:04:45 +02:00
Ondřej Surý
bef8ac5bae Rewrite isc_refcount API to fetch_and_<op>, instead of former <op>_and_<fetch> 2018-08-28 12:15:39 +02:00
Michał Kępień
087157d14f Log a message when "ixfr-from-differences" is set for an inline-signed zone
For inline-signed zones, the value of "ixfr-from-differences" is
hardcoded to:

  - "yes" for the raw version of the zone,
  - "no" for the signed version of the zone.

In other words, any user-provided "ixfr-from-differences" setting is
effectively ignored for an inline-signed zone.  Ensure the user is aware
of that by adding a note to the ARM and logging a message when an
"ixfr-from-differences" option is found at the zone level.
2018-08-24 10:18:59 +02:00
Witold Kręcicki
5cdb38c2c7 Remove unthreaded support 2018-08-16 17:18:52 +02:00
Evan Hunt
eaac2057c7 option to disable validation under specified names
- added new 'validate-except' option, which configures an NTA with
  expiry of 0xffffffff.  NTAs with that value in the expiry field do not
  expire, are are not written out when saving the NTA table and are not
  dumped by rndc secroots
2018-08-14 13:28:02 -07: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
Mark Andrews
3ea9861e7a rename zone to mayberaw 2018-08-02 00:00:13 -04:00
Mark Andrews
c8b07932e4 named_server_servestale could leave the server in exclusive mode if a error occurs. 2018-07-26 22:54:15 -07:00
Ondřej Surý
c3b8130fe8 Make OpenSSL mandatory 2018-07-19 12:47:03 -04:00
Michał Kępień
8666f8d28f Fix handling of TAT sending failures
dns_view_zonecut() may associate the dns_rdataset_t structure passed to
it even if it returns a result different then ISC_R_SUCCESS.  Not
handling this properly may cause a reference leak.  Fix by ensuring
'nameservers' is cleaned up in all relevant failure modes.
2018-07-20 01:55:50 +10:00
Michał Kępień
a7657dc150 Send upstream TAT queries for locally served zones
Trying to resolve a trust anchor telemetry query for a locally served
zone does not cause upstream queries to be sent as the response is
determined just by consulting local data.  Work around this issue by
calling dns_view_findzonecut() first in order to determine the NS RRset
for a given domain name and then passing the zone cut found to
dns_resolver_createfetch().

Note that this change only applies to TAT queries generated by the
resolver itself, not to ones received from downstream resolvers.
2018-07-11 08:27:10 +02:00
Michał Kępień
127810e512 Extract TAT QNAME preparation to a separate function
Extract the part of dotat() reponsible for preparing the QNAME for a TAT
query to a separate function in order to limit the number of local
variables used by each function and improve code readability.

Rename 'name' to 'origin' to better convey the purpose of that variable.
Also mark it with the const qualifier.
2018-07-11 08:27:10 +02:00
Michał Kępień
73d64de779 Make "rndc zonestatus" output for mirror zones different than for regular slave zones
Replace "type: slave" with "type: mirror" in "rndc zonestatus" output
for mirror zones in order to enable the user to tell a regular slave
zone and a mirror zone apart.
2018-06-28 13:38:39 +02:00
Mukund Sivaraman
0ba997b4c2 Add a answer-cookie named config option
(cherry picked from commit 29305073575459a66f0a93b9becc4863fd1c0c6b)
2018-06-26 15:10:02 -07:00
Evan Hunt
03ecba2cdc allow-recursion could incorrectly inherit from the default allow-query 2018-06-14 14:42:50 +02:00
Witold Kręcicki
7ec88b384d Add qname-minimization off as an option; test fixes 2018-06-12 10:24:05 +02:00
Evan Hunt
dde66b8012 nits
- capitalize QNAME in the doc
- regenerate options/docbook
- whitespace
2018-06-12 09:20:13 +02:00
Witold Kręcicki
265052df49 qname-minimization: Some post-review style/minor fixes 2018-06-12 09:20:12 +02:00
Witold Kręcicki
dd7bb617be - qname minimization:
- make qname-minimization option tristate {strict,relaxed,disabled}
 - go straight for the record if we hit NXDOMAIN in relaxed mode
 - go straight for the record after 3 labels without new delegation or 7 labels total

- use start of fetch (and not time of response) as 'now' time for querying cache for
  zonecut when following delegation.
2018-06-12 09:18:46 +02:00
Witold Kręcicki
0698158eb0 QNAME minimization 2018-06-12 09:18:46 +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
d1ca21d50a clarify serve-stale documentation, and add a floor for max-stale-ttl
- added a 1-second floor to max-stale-ttl similar to stale-answer-ttl;
  if set to 0, it will be silently updated to 1.
- fixed the ARM entry on max-stale-ttl, which incorrectly suggested that
  the default was 0 instead of 1 week.
- clarified rndc serve-stale documentation.
2018-05-25 22:00:37 -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
Mark Andrews
10dd0b3efe add HOME.ARPA to the list of empty zones 2018-05-23 10:48:30 +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
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
Michał Kępień
172d0c401e Address GCC 8 -Wformat-truncation warnings 2018-05-10 10:35:01 +02:00
Ondřej Surý
9a3a257374 Always use random data from the crypto provider 2018-05-03 15:03:46 +02:00
Mark Andrews
68e9315c7d add named.conf option root-key-sentinel 2018-04-18 08:49:55 -07:00
Mathieu Arnold
ebf7641610 Rename the last occurence of dns_dt_create2. 2018-04-09 16:46:07 +02:00
Michał Kępień
4df4a8e731 Use dns_fixedname_initname() where possible
Replace dns_fixedname_init() calls followed by dns_fixedname_name()
calls with calls to dns_fixedname_initname() where it is possible
without affecting current behavior and/or performance.

This patch was mostly prepared using Coccinelle and the following
semantic patch:

    @@
    expression fixedname, name;
    @@
    -	dns_fixedname_init(&fixedname);
    	...
    -	name = dns_fixedname_name(&fixedname);
    +	name = dns_fixedname_initname(&fixedname);

The resulting set of changes was then manually reviewed to exclude false
positives and apply minor tweaks.

It is likely that more occurrences of this pattern can be refactored in
an identical way.  This commit only takes care of the low-hanging fruit.
2018-04-09 12:14:16 +02:00
Witold Kręcicki
102a397e39 libdns refactoring: get rid of multiple versions of dns_keytable_add, dns_iptable_addprefix and dns_iptable_addprefix 2018-04-06 08:04:41 +02:00
Witold Kręcicki
c8aa1ee9e6 libdns refactoring: get rid of multiple versions of dns_dt_create, dns_view_setcache, dns_zt_apply, dns_message_logfmtpacket, dns_message_logpacket, dns_ssutable_checkrules and dns_ttl_totext 2018-04-06 08:04:41 +02:00
Witold Kręcicki
d54d482af0 libdns refactoring: get rid of multiple versions of dns_view_find, dns_view_findzonecut and dns_view_flushcache 2018-04-06 08:04:41 +02:00
Witold Kręcicki
702c022016 libdns refactoring: get rid of multiple versions of dns_xfrin_create, dst_key_generate, dst_lib_init and dst_context_create 2018-04-06 08:04:41 +02:00