Commit graph

9086 commits

Author SHA1 Message Date
Mark Andrews
98de15b780 Recurse to find the root server list with 'dig +trace'.
(cherry picked from commit e65d4989a1)
2019-05-22 16:05:25 +10:00
Mark Andrews
b61d6cde83 remove dead code and unnecessary call to pkcs_C_GetAttributeValue
(cherry picked from commit 2e4986e2c4)
2019-05-13 11:22:33 +07:00
Witold Kręcicki
0617148792 Remove UNSPEC rrtype
(cherry picked from commit a8e2ca6f7d)
2019-05-13 10:52:48 +07:00
Tinderbox User
d7862ea81c prep 9.14.2 2019-05-10 04:51:22 +00:00
Michał Kępień
c6bf43a821 Make NTAs work with validating forwarders
If named is configured to perform DNSSEC validation and also forwards
all queries ("forward only;") to validating resolvers, negative trust
anchors do not work properly because the CD bit is not set in queries
sent to the forwarders.  As a result, instead of retrieving bogus DNSSEC
material and making validation decisions based on its configuration,
named is only receiving SERVFAIL responses to queries for bogus data.
Fix by ensuring the CD bit is always set in queries sent to forwarders
if the query name is covered by an NTA.

(cherry picked from commit 5e80488270)
2019-05-09 20:37:37 -07:00
Mark Andrews
07f8daf536 Recognise EDNS Client Tag and EDNS Server Tag
(cherry picked from commit ee7cf180b3)
2019-05-09 18:19:29 +10:00
Evan Hunt
9b59425d06 warn about the use of trusted-keys and managed-keys for the same name 2019-05-08 21:59:35 -07:00
Mark Andrews
227b49a830 add test for 'provide-ixfr no;' ; add forensics support
(cherry picked from commit d547465af5)
2019-05-07 13:43:14 +10:00
Mark Andrews
a0feec3dbc lock accesses to hash table
(cherry picked from commit 2483a8c76d)
2019-05-07 11:07:32 +10:00
Mark Andrews
3ebf1ddeb2 check that delv -t any works
(cherry picked from commit 6999bee7ef)
2019-05-07 10:27:18 +10:00
Evan Hunt
96e0e38fcd move the test lists into conf.sh.common
there is now a common list of tests in conf.sh.common, with the
tests that are either unique to windows or to unix, or which are
enabled or disabled by configure or Configure, being listed in
separate variables in conf.sh.in and conf.sh.win32.

(cherry picked from commit a33237f070)
2019-05-06 15:54:31 -07:00
Evan Hunt
5755465c2f enable parallel system tests on windows
this moves the creation of "parallel.mk" into a separate shell script
instead of bin/tests/system/Makefile. that shell script can now be
executed by runall.sh, allowing us to make use of the cygwin "make"
command, which supports parallel execution.

(cherry picked from commit bbae24c140)
2019-05-06 15:54:30 -07:00
Michał Kępień
3b7bc3421c Simplify trailing period handling in system tests
Windows systems do not allow a trailing period in file names while Unix
systems do.  When BIND system tests are run, the $TP environment
variable is set to an empty string on Windows systems and to "." on Unix
systems.  This environment variable is then used by system test scripts
for handling this discrepancy properly.

In multiple system test scripts, a variable holding a zone name is set
to a string with a trailing period while the names of the zone's
corresponding dlvset-* and/or dsset-* files are determined using
numerous sed invocations like the following one:

    dlvsets="$dlvsets dlvset-`echo $zone |sed -e "s/.$//g"`$TP"

In order to improve code readability, use zone names without trailing
periods and replace sed invocations with variable substitutions.

To retain local consistency, also remove the trailing period from
certain other zone names used in system tests that are not subsequently
processed using sed.

(cherry picked from commit da2c1b74ad)
2019-04-26 20:38:29 +02:00
Michał Kępień
027c6179a8 Make root zone data match root hints
In the "allow-query" system test, ns3 uses a root hints file which
contains a single entry for a.root-servers.nil (10.53.0.1).  This name
is not present in the root zone served by ns1, which means querying it
for that name and any type will yield an NXDOMAIN response.  When
combined with unfavorable thread scheduling, this can lead to ns3
caching an NXDOMAIN response for the only root server it is aware of and
thus to false positives for the "allow-query" system test caused by ns3
returning unexpected SERVFAIL responses.  Fix by modifying the root zone
served by ns1 so that authoritative responses to a.root-servers.nil
queries match the root hints file used by ns3.

(cherry picked from commit 978a0d2555)
2019-04-26 11:07:00 +02:00
Evan Hunt
8c1af0d3f5 associate a lock with the memory pool in the filter-aaaa plugin
(cherry picked from commit 4f4c18d643)
2019-04-26 00:32:55 -07:00
Tinderbox User
586e085a71 doc rebuild
(cherry picked from commit b441152036)
2019-04-25 17:01:11 +02:00
Matthijs Mekking
a38d17dc1c Add test for nxdomain-redirect ncachenxdomain
(cherry picked from commit 2d65626630c19bb8159a025accb18e5179da5dc3)
(cherry picked from commit 05d29443eb)
2019-04-25 15:59:43 +02:00
Mark Andrews
0c5ab7563a conditionally include <dlfcn.h>
(cherry picked from commit eee8084734)
2019-04-24 09:31:04 +10:00
Matthijs Mekking
f58a0bbcc1 Harden grep key ID calls
Key IDs may accidentally match dig output that is not the key ID (for
example the RRSIG inception or expiration time, the query ID, ...).
Search for key ID + signer name should prevent that, as that is what
only should occur in the RRSIG record, and signer name always follows
the key ID.

(cherry picked from commit 83473b9758)
2019-04-23 17:12:20 +02:00
Matthijs Mekking
5496b04829 Remove sleeps
Remove sleep calls from test, rely on wait_for_log().  Make
wait_for_log() and dnssec_loadkeys_on() fail the test if the
appropriate log line is not found.

Slightly adjust the echo_i() lines to print only the key ID (not the
key name).

(cherry picked from commit 67f0635f3c)
2019-04-23 17:12:11 +02:00
Michał Kępień
5bd52654e8 Wait more than 1 second for NSEC3 chain changes
One second may not be enough for an NSEC3 chain change triggered by an
UPDATE message to complete.  Wait up to 10 seconds when checking whether
a given NSEC3 chain change is complete in the "nsupdate" system test.

(cherry picked from commit f8746cddbc)
2019-04-23 14:59:22 +02:00
Michał Kępień
8691b38edf Remove redundant sleeps
In the "nsupdate" system test, do not sleep before checking results of
changes which are expected to be processed synchronously, i.e. before
nsupdate returns.

(cherry picked from commit 1c8e5ea333)
2019-04-23 14:59:22 +02:00
Michał Kępień
f069aca7ed Update interface lists in ifconfig scripts
Make bin/tests/system/ifconfig.bat also configure addresses ending with
9 and 10, so that the script is in sync with its Unix counterpart.

Update comments listing the interfaces created by ifconfig.{bat,sh} so
that they do not include addresses whose last octet is zero (since an
address like 10.53.1.0/24 is not a valid host address and thus the
aforementioned scripts do not even attempt configuring them).

(cherry picked from commit b6c1cdfffe)
2019-04-19 11:29:29 +02:00
Michał Kępień
26907f1b0b Fix the "dnssec" system test on Windows
On Windows, the bin/tests/system/dnssec/signer/example.db.signed file
contains carriage return characters at the end of each line.  Remove
them before passing the aforementioned file to the awk script extracting
key IDs so that the latter can work properly.

(cherry picked from commit e4280ed9f5)
2019-04-19 11:29:24 +02:00
Michał Kępień
2c7e341bf3 Do not wait for lock file cleanup on Windows
As signals are currently not handled by named on Windows, instances
terminated using signals are not able to perform a clean shutdown, which
involves e.g. removing the lock file.  Thus, waiting for a given
instance's lock file to be removed beforing assuming it is shut down
is pointless on Windows, so do not even attempt it.

(cherry picked from commit 761ba4514f)
2019-04-19 11:28:05 +02:00
Michał Kępień
a228c5b7be win32: remove lock file upon shutdown
Upon named shutdown, the lock file should not just be unlocked but also
removed.

(cherry picked from commit c506077da5)
2019-04-19 11:00:35 +02:00
Michał Kępień
a8172d06cf win32: fix service state reported during shutdown
When a Windows service receives a request to stop, it should not set its
state to SERVICE_STOPPED until it is completely shut down as doing that
allows the operating system to kill that service prematurely, which in
the case of named may e.g. prevent the PID file and/or the lock file
from being cleaned up.

Set service state to SERVICE_STOP_PENDING when named begins its shutdown
and only report the SERVICE_STOPPED state immediately before exiting.

(cherry picked from commit 964749dfdb)
2019-04-19 09:38:45 +02:00
Matthijs Mekking
30ec661356 Update CHANGES
(cherry picked from commit 768ded1102)
2019-04-17 10:36:20 +02:00
Matthijs Mekking
d52bed8864 DLV tests unsupported/disabled algorithms
This tests both the cases when the DLV trust anchor is of an
unsupported or disabled algorithm, as well as if the DLV zone
contains a key with an unsupported or disabled algorithm.

(cherry picked from commit 3b7c849a3f)
2019-04-17 10:35:19 +02:00
Michał Kępień
3113dc24ec Move code handling key loading errors into a common function
Some values returned by dstkey_fromconfig() indicate that key loading
should be interrupted, others do not.  There are also certain subsequent
checks to be made after parsing a key from configuration and the results
of these checks also affect the key loading process.  All of this
complicates the key loading logic.

In order to make the relevant parts of the code easier to follow, reduce
the body of the inner for loop in load_view_keys() to a single call to a
new function, process_key().  Move dstkey_fromconfig() error handling to
process_key() as well and add comments to clearly describe the effects
of various key loading errors.

(cherry picked from commit b85007e0a6)
2019-04-17 10:35:07 +02:00
Matthijs Mekking
a224bea4b2 Also ignore configured revoked trusted anchors
(cherry picked from commit 4d1ed1283a)
2019-04-17 10:34:54 +02:00
Matthijs Mekking
a7c59e322b Ignore trust anchors using disabled algorithm
More specifically: ignore configured trusted and managed keys that
match a disabled algorithm.  The behavioral change is that
associated responses no longer SERVFAIL, but return insecure.

(cherry picked from commit 1d45ad8f39)
2019-04-17 10:33:25 +02:00
Matthijs Mekking
42c543bb85 Move algorithm variables, add disabled algorithms
Move from conf.sh.in to conf.sh.common as they will also need to be
added to conf.sh.win32.  Add variables for testing disabled
algorithms.

(cherry picked from commit 07c35f32f9)
2019-04-17 10:29:09 +02:00
Matthijs Mekking
96312dadc6 Add inline test related to unsupported algorithms
(cherry picked from commit 924fdad0e5)
2019-04-17 10:28:57 +02:00
Matthijs Mekking
5626c56862 System tests for tools and unsupported algorithms
(cherry picked from commit dfcf9bb0ed)
2019-04-17 10:28:40 +02:00
Evan Hunt
19f249ffa5 if recursion is allowed and minimal-responses is no, search other databases
this restores functionality that was removed in commit 03be5a6b4e,
allowing named to search in authoritative zone databases outside the
current zone for additional data, if and only if recursion is allowed
and minimal-responses is disabled.

(cherry picked from commit 7fff3295f5)
2019-04-15 11:38:28 -07:00
Matthijs Mekking
3e75bea995 Add detail on echo message in autosign test
(cherry picked from commit d330986374)
2019-04-12 11:33:06 +02:00
Matthijs Mekking
4dee3d149c Add test for ZSK rollover while KSK offline
This commit adds a lengthy test where the ZSK is rolled but the
KSK is offline (except for when the DNSKEY RRset is changed).  The
specific scenario has the `dnskey-kskonly` configuration option set
meaning the DNSKEY RRset should only be signed with the KSK.

A new zone `updatecheck-kskonly.secure` is added to test against,
that can be dynamically updated, and that can be controlled with rndc
to load the DNSSEC keys.

There are some pre-checks for this test to make sure everything is
fine before the ZSK roll, after the new ZSK is published, and after
the old ZSK is deleted.  Note there are actually two ZSK rolls in
quick succession.

When the latest added ZSK becomes active and its predecessor becomes
inactive, the KSK is offline.  However, the DNSKEY RRset did not
change and it has a good signature that is valid for long enough.
The expected behavior is that the DNSKEY RRset stays signed with
the KSK only (signature does not need to change).  However, the
test will fail because after reconfiguring the keys for the zone,
it wants to add re-sign tasks for the new active keys (in sign_apex).
Because the KSK is offline, named determines that the only other
active key, the latest ZSK, will be used to resign the DNSKEY RRset,
in addition to keeping the RRSIG of the KSK.

The question is: Why do we need to resign the DNSKEY RRset
immediately when a new key becomes active?  This is not required,
only once the next resign task is triggered the new active key
should replace signatures that are in need of refreshing.

(cherry picked from commit 8bc10bcf59)
2019-04-12 11:33:06 +02:00
Evan Hunt
f6c3b13522 dnstap: if recursion is not available, log queries as AQ instead of CQ
(cherry picked from commit 1f578cdb12)
2019-04-11 15:45:52 -07:00
Matthijs Mekking
5b77d02cbb Check dig TTLs.
This also fixes a bug in the tests ($n was not incremented in one
place).

(cherry picked from commit 195277ca6d)
2019-04-10 15:48:48 +10:00
Mark Andrews
f471907db8 Check delv TTLs.
(cherry picked from commit 146202d6a8)
2019-04-10 15:48:48 +10:00
Mark Andrews
53a62e2977 for rkey flags MUST be zero
(cherry picked from commit 82d4931440)
2019-04-09 14:22:50 +10:00
Michał Kępień
915f94a6a3 Do not rely on default dig options in system tests
Some system tests assume dig's default setings are in effect.  While
these defaults may only be silently overridden (because of specific
options set in /etc/resolv.conf) for BIND releases using liblwres for
parsing /etc/resolv.conf (i.e. BIND 9.11 and older), it is arguably
prudent to make sure that tests relying on specific +timeout and +tries
settings specify these explicitly in their dig invocations, in order to
prevent test failures from being triggered by any potential changes to
current defaults.

(cherry picked from commit b6cce0fb8b)
2019-04-03 12:57:45 +02:00
Mark Andrews
8c2a3b03f4 fix plugin installation
(cherry picked from commit cd3593c38d)
2019-03-26 19:54:39 +11:00
Tinderbox User
fdeb694c1e doc rebuild 2019-03-22 10:35:15 -07:00
Ondřej Surý
7485a4332e Make lib/dns/dnstap.pb-c.h private header
This changes dns_dtdata struct to not expose data types from dnstap.pb-c.h to
prevent the need for including this header where not really needed.

(cherry picked from commit 8ccce7e24b)
2019-03-22 12:07:31 +01:00
Evan Hunt
dde35a8edf don't fail when allow-update{,-forwarding} is used globally
(cherry picked from commit 91dca0f8da)
2019-03-22 00:14:52 -07:00
Michał Kępień
d14d661c20 Fix key ID extraction in the "dnssec" system test
Simply looking for the key ID surrounded by spaces in the tested
dnssec-signzone output file is not a precise enough method of checking
for signatures prepared using a given key ID: it can be tripped up by
cross-algorithm key ID collisions and certain low key IDs (e.g. 60, the
TTL specified in bin/tests/system/dnssec/signer/example.db.in), which
triggers false positives for the "dnssec" system test.  Make key ID
extraction precise by using an awk script which operates on specific
fields.

(cherry picked from commit a40c60e4c1)
2019-03-21 08:10:47 +01:00
Michał Kępień
689f5aef5a Increase dig query timeout to 2 seconds
The "mirror" system test expects all dig queries (including recursive
ones) to be responded to within 1 second, which turns out to be overly
optimistic in certain cases and leads to false positives being
triggered.  Increase dig query timeout used throughout the "mirror"
system test to 2 seconds in order to alleviate the issue.

(cherry picked from commit 73afbdc552)
2019-03-20 09:51:18 +01:00
Michał Kępień
78cce30893 Increase TAT query interval
Currently, ns3 in the "mirror" system test sends trust anchor telemetry
queries every second as it is started with "-T tat=1".  Given the number
of trust anchors configured on ns3 (9), TAT-related traffic clutters up
log files, hindering troubleshooting efforts.  Increase TAT query
interval to 3 seconds in order to alleviate the issue.

Note that the interval chosen cannot be much higher if intermittent test
failures are to be avoided: TAT queries are only sent after the
configured number of seconds passes since resolver startup.  Quick
experiments show that even on contemporary hardware, ns3 should be
running for at least 5 seconds before it is first shut down, so a
3-second TAT query interval seems to be a reasonable, future-proof
compromise.  Ensure the relevant check is performed before ns3 is first
shut down to emphasize this trade-off and make it more clear by what
time TAT queries are expected to be sent.

(cherry picked from commit 6847a29b54)
2019-03-20 09:51:18 +01:00