Commit graph

3654 commits

Author SHA1 Message Date
Mark Andrews
9b0a277490 Record types which support a empty rdata field were not handling the empty rdata field case.
(cherry picked from commit 2ff57d8a39)
2018-10-30 11:17:59 +11:00
Mark Andrews
9674fdcbfb Add support for EID and NIMLOC
(cherry picked from commit fbab100426)
2018-10-25 15:31:32 -07:00
Mark Andrews
e3a812507f GID, UID and UINFO could not be loaded using unknown record format.
(cherry picked from commit eb7ca65b78)
2018-10-25 13:35:37 -07:00
Mark Andrews
1828ba389d Add support for ATMA
(cherry picked from commit f9ceddd8ca)
2018-10-25 14:17:29 +11:00
Michał Kępień
f5260a8535 Fix CI
Use GitLab Registry for CI purposes.  Disable EdDSA support for Debian
sid since the OpenSSL version shipped with it has broken Ed448 support.
Use /dev/urandom as the random device in the "ecdsa" system test to
prevent newer OpenSSL versions from running out of entropy when
verifying ECDSA signatures.

(cherry picked from commit e5ebc13989)
2018-10-19 22:25:06 +02:00
Mark Andrews
32d48b8290 reclimit: delegate to ans4 so that ans2 can behave like a real name server
(cherry picked from commit a216135a15)
2018-10-04 13:22:24 +10:00
Mark Andrews
08bc58ca7a chain: change nameserver name so that the delegation matches
(cherry picked from commit 848e42227e)
2018-10-04 12:29:54 +10:00
Mark Andrews
405631c9d8 chain: add 'start test' messages to named.run
(cherry picked from commit 524c1317f7)
2018-10-04 12:29:53 +10:00
Mark Andrews
2b5cb47cfd zero: send grep output to /dev/null; set ret=0 at start of 'check repeated recursive lookups of non recurring TTL=0 responses get new values' test so the failed subtest count is correct
(cherry picked from commit a6507af9e3)
2018-10-03 15:38:55 +10:00
Mark Andrews
c7766cee64 improve case presevation
(cherry picked from commit 0fc1b1bffa)
2018-10-02 15:28:06 +10:00
Evan Hunt
1f72e316b9 add -class option to rndc nta
(cherry picked from commit cc0abf62a1)
2018-09-10 13:18:35 -07:00
Evan Hunt
af3bada56e 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.

(cherry picked from commit 83dc5a704a)
2018-09-10 13:18:33 -07:00
Mark Andrews
5413abae7d add more missing name in update rule checks
(cherry picked from commit d1f8e116db)
2018-09-10 17:45:48 +10:00
Mark Andrews
7cec76e222 add krb5-* tests to nsupdate system test.
(cherry picked from commit 54c4db569b)
2018-09-10 17:45:48 +10:00
Mark Andrews
2b1beb052d add test addresses 10.53.0.{9,10} and fd92:7065:b8e:ffff::{9,10} 2018-09-10 17:45:48 +10:00
Mark Andrews
6ff17d94bf check that name field is not a valid type
(cherry picked from commit 5fb75a3d75)
2018-09-10 17:25:07 +10:00
Mark Andrews
fb0f34cc71 use pack to construct the reply as Net::DNS just get it wrong
(cherry picked from commit feaf381adb)
2018-08-31 18:44:44 +10:00
Mark Andrews
073b2b9d02 report initial RRSIG expiry field values
(cherry picked from commit 8e5abc6cdf)
2018-08-31 13:09:47 +10:00
Michał Kępień
9a76ffc61f Do not call bin/tools/genrandom unconditionally in system tests
$RANDFILE, i.e. bin/tests/system/random.data, should only be written to
if a system test requires support for cryptography and that file does
not already exist.  Otherwise, when multiple system tests are run in
parallel, that file might get truncated due to bin/tools/genrandom.c
using fopen() with mode "w" when writing the destination file.  With
unfortunate timing, this may cause system tests employing BIND tools
which need entropy (e.g. dnssec-keygen) to fail.

Make sure bin/tests/system/metadata/tests.sh no longer calls
bin/tools/genrandom since $RANDFILE is guaranteed to already be created
by the time bin/tools/genrandom is currently called because
bin/tests/system/metadata/prereq.sh uses bin/tests/system/testcrypto.sh.

Make sure bin/tests/system/sfcache/prereq.sh only writes to $RANDFILE if
it does not already exist.

(cherry picked from commit c12388f5e8)
2018-08-24 09:58:08 +02:00
Michał Kępień
6831af7717 Prevent a race in the "inline" system test
A short time window exists between logging the addition of an NSEC3PARAM
record to a zone and committing it to the current version of the zone
database.  If a query arrives during such a time window, an unsigned
response will be returned.  One of the checks in the "inline" system
test requires NSEC3 records to be present in an answer - that check
would fail in the case described above.  Use rndc instead of log
watching for checking whether zone signing and NSEC3 chain modifications
are complete in order to prevent intermittent "inline" system test
failures.

(cherry picked from commit e36c869e85)
2018-08-24 09:38:38 +02:00
Mark Andrews
56f8303377 when filter-aaaa and dns64 are both configured a assertion failure could occur
(cherry picked from commit 1056376d10)
2018-08-24 10:33:33 +10:00
Michał Kępień
cf7557dce0 Fix reloading inline-signed zones
While "rndc reload" causes dns_zone_asyncload() to be called for the
signed version of an inline-signed zone, the subsequent zone_load() call
causes the raw version to be reloaded from storage.  This means that
DNS_ZONEFLG_LOADPENDING gets set for the signed version of the zone by
dns_zone_asyncload() before the reload is attempted, but zone_postload()
is only called for the raw version and thus DNS_ZONEFLG_LOADPENDING is
cleared for the raw version, but not for the signed version.  This in
turn prevents zone maintenance from happening for the signed version of
the zone.

Until commit 749b3cacfc, this problem
remained dormant because DNS_ZONEFLG_LOADPENDING was previously
immediately, unconditionally cleared after zone loading was started
(whereas it should only be cleared when zone loading is finished or an
error occurs).  This behavior caused other issues [1] and thus had to be
changed.

Fix reloading inline-signed zones by clearing DNS_ZONEFLG_LOADPENDING
for the signed version of the zone once the raw version reload
completes.  Take care not to clear it prematurely during initial zone
load.  Also make sure that DNS_ZONEFLG_LOADPENDING gets cleared when
zone_postload() encounters an error or returns early, to prevent other
scenarios from resulting in the same problem.  Add comments aiming to
help explain code flow.

[1] see RT #47076

(cherry picked from commit 5431583971)
2018-08-22 11:46:08 +02:00
Michał Kępień
de6b8ded56 Set DNS_JOURNALOPT_RESIGN when loading the secure journal for an inline-signed zone
When an inline-signed zone is loaded, the master file for its signed
version is loaded and then a rollforward of the journal for the signed
version of the zone is performed.  If DNS_JOURNALOPT_RESIGN is not set
during the latter phase, signatures loaded from the journal for the
signed version of the zone will not be scheduled for refresh.  Fix the
conditional expression determining which flags should be used for the
dns_journal_rollforward() call so that DNS_JOURNALOPT_RESIGN is set when
zone_postload() is called for the signed version of an inline-signed
zone.

Extend bin/tests/system/stop.pl so that it can use "rndc halt" instead
of "rndc stop" as the former allows master file flushing upon shutdown
to be suppressed.

(cherry picked from commit 8db550c42f)
2018-08-22 10:56:42 +02:00
Ondřej Surý
e37e27c560 Update lwres to use stdint types to finish transition to using stdint types 2018-08-22 09:04:02 +02:00
Michał Kępień
a3490ef66e Make the "inline" system test more lightweight
Each zone used in the "inline" system test contains a few dozen records.
Over a dozen of these zones are used in the test.  Most records present
in these zones are not subsequently used in the test itself, but all of
them need to be signed by the named instances launched by the test,
which puts quite a bit of strain on lower-end machines, leading to
intermittent failures of the "inline" system test.  Remove all redundant
records from the zones used in the "inline" system test in order to
stabilize it.

(cherry picked from commit 24dd865b97)
2018-08-14 10:16:39 +02:00
Michał Kępień
cbd85e0137 Queue "rndc signing -nsec3param ..." requests if needed
If "rndc signing -nsec3param ..." is ran for a zone which has not yet
been loaded or transferred (i.e. its "db" field is NULL), it will be
silently ignored by named despite rndc logging an "nsec3param request
queued" message, which is misleading.  Prevent this by keeping a
per-zone queue of NSEC3PARAM change requests which arrive before a zone
is loaded or transferred and processing that queue once the raw version
of an inline-signed zone becomes available.

(cherry picked from commit cb40c5229a)
2018-08-14 09:29:54 +02:00
Ondřej Surý
1084b40b44 Replace custom isc_boolean_t with C standard bool type
(cherry picked from commit 994e656977)
(cherry picked from commit 884929400c)
2018-08-10 15:20:57 +02:00
Ondřej Surý
aaa76dc654 Replace custom isc_u?intNN_t types with C99 u?intNN_t types
(cherry picked from commit cb6a185c69)
(cherry picked from commit d61e6a3111)
2018-08-10 15:20:57 +02:00
Evan Hunt
ba162bd0d4 caclulate nlabels and set *chainingp correctly
(cherry picked from commit e78e55f435)
2018-08-08 14:27:44 -07:00
Evan Hunt
02e8b3f8dc test case
(cherry picked from commit 73486c13f743407a50d5bbadde90c949a696506f)
(cherry picked from commit 584a1cff8b)
2018-08-08 14:27:17 -07:00
Mark Andrews
f2ce5b542e only check the bit map
(cherry picked from commit a94db46631)
(cherry picked from commit 092b739535)
2018-08-03 09:02:34 +10:00
Mark Andrews
84b5b6a659 use guard values for testing unixtime serial
(cherry picked from commit abe41ba011)
2018-08-02 11:29:15 +10:00
Mark Andrews
2e29c1f139 save SOA values
(cherry picked from commit 6b30bc73c0)
2018-08-02 11:29:15 +10:00
Mark Andrews
8c515d6b18 test mdig '+ednsopt=:' handling
(cherry picked from commit 2e688488f7)
2018-08-02 09:48:27 +10:00
Michał Kępień
88be595735 Do not replace lo0 address on Solaris
lo0 and lo0:0 are the same interface on Solaris.  Make sure
bin/tests/system/ifconfig.sh does not touch lo0:0 in order to prevent it
from changing the address of the loopback interface on Solaris.

(cherry picked from commit 618921902a)
2018-07-17 08:20:10 +02:00
Michał Kępień
12bedaef75 Do not spam console if "git status --ignored" fails during tests
The "git status" command in Git versions before 1.7.2 does not support
the "--ignored" option.  Prevent spamming the console when running
system tests from a Git repository on a host with an ancient Git version
installed.

(cherry picked from commit 2be97feb46)
2018-07-13 12:15:36 +02:00
Michał Kępień
e0dbc27c0d Remove IDN subtest from the "digdelv" system test
The output of certain "dig +idnout" invocations may be locale-dependent.
Remove the "dig +idnout" subtest from the "digdelv" system test as IDN
support is already thoroughly tested by the "idna" system test.

(cherry picked from commit fd30a03f2b)
2018-07-13 12:15:36 +02:00
Michał Kępień
4fdee34a0b Improve error handling in idn_ace_to_locale()
While idn2_to_unicode_8zlz() takes a 'flags' argument, it is ignored and
thus cannot be used to perform IDN checks on the output string.

The bug in libidn2 versions before 2.0.5 was not that a call to
idn2_to_unicode_8zlz() with certain flags set did not cause IDN checks
to be performed.  The bug was that idn2_to_unicode_8zlz() did not check
whether a conversion can be performed between UTF-8 and the current
locale's character encoding.  In other words, with libidn2 version
2.0.5+, if the current locale's character encoding is ASCII, then
idn2_to_unicode_8zlz() will fail when it is passed any Punycode string
which decodes to a non-ASCII string, even if it is a valid IDNA2008
name.

Rework idn_ace_to_locale() so that invalid IDNA2008 names are properly
and consistently detected for all libidn2 versions and locales.

Update the "idna" system test accordingly.  Add checks for processing a
server response containing Punycode which decodes to an invalid IDNA2008
name.  Fix invalid subtest description.

(cherry picked from commit 7fe0f00a3b)
2018-07-13 12:15:03 +02:00
Michał Kępień
a996e26b8b Include conf.sh from all prereq.sh scripts
Every prereq.sh script must include bin/tests/system/conf.sh, otherwise
if some prerequisite is not met, errors about echo_i not being found
will be printed instead of actual error messages.

(cherry picked from commit cc0e8cda71)
2018-07-13 08:24:55 +02:00
Ondřej Surý
d4baf8b117 Add .gitignore for PKCS#11 test files
(cherry picked from commit 96907d636d)
2018-07-12 12:18:33 -04:00
Mark Andrews
41a632bae1 add test for bad dig option '+ednsopt=:' being handled gracefully
(cherry picked from commit ad86878d61)
(cherry picked from commit 9f126bac32)
2018-07-11 12:12:32 -07:00
Mukund Sivaraman
a829bb3f1b Add system tests for "tcp-self" update-policy
(cherry picked from commit a7e6a584ea)
2018-07-11 11:13:24 -07:00
Michał Kępień
740b3a9118 Fix a Net::DNS version quirk in the "resolver" system test
Net::DNS versions older than 0.68 insert a ./ANY RR into the QUESTION
section if the latter is empty.  Since the latest Net::DNS version
available with stock RHEL/CentOS 6 packages is 0.65 and we officially
support that operating system, bin/tests/system/resolver/ans8/ans.pl
should behave consistently for various Net::DNS versions.  Ensure that
by making handleUDP() return the query ID and flags generated by
Net::DNS with 8 zero bytes appended.

(cherry picked from commit 6c3c6aea37)
2018-07-10 15:08:05 +02:00
Mukund Sivaraman
49cd7552be return FORMERR when question section is empty if COOKIE is not present
(cherry picked from commit 06d3106002)
(cherry picked from commit ed29b84e16)
2018-06-26 14:44:18 -07:00
Mark Andrews
316eebb699 construct a symtab of valid in-view targets then check that the target exists
(cherry picked from commit e01a4bcb20)
2018-06-26 10:53:59 -07:00
Evan Hunt
b330bcb8a1 add a regression test for default allow-recursion settings 2018-06-14 14:47:11 +02:00
Michał Kępień
6d8a514ecb Treat records below a DNAME as out-of-zone data
DNAME records indicate bottom of zone and thus no records below a DNAME
should be DNSSEC-signed or included in NSEC(3) chains.  Add a helper
function, has_dname(), for detecting DNAME records at a given node.
Prevent signing DNAME-obscured records.  Check that DNAME-obscured
records are not signed.

(cherry picked from commit ff7015a0f8)
2018-06-13 12:58:27 +02:00
Michał Kępień
da430b5f36 Add helper variables in mkeys system test
The keyfile and key ID for the original managed key do not change
throughout the mkeys system test.  Keep them in helper variables to
prevent calling "cat" multiple times and improve code readability.

(cherry picked from commit 2cad382552)
2018-06-13 08:08:25 +02:00
Michał Kępień
a23e9821d6 Replace duplicated code snippet with calls to helper functions
Reduce code duplication by replacing a code snippet repeated throughout
system tests using "trusted-keys" and/or "managed-keys" configuration
sections with calls to keyfile_to_{managed,trusted}_keys() helper
functions.

(cherry picked from commit dce66f7635)
2018-06-13 08:08:25 +02:00
Michał Kępień
36d6a6cc76 Add helper functions for converting keyfile data into configuration sections
Add a set of helper functions for system test scripts which enable
converting key data from a set of keyfiles to either a "trusted-keys"
section or a "managed-keys" section suitable for including in a
resolver's configuration file.

(cherry picked from commit 21d3658bcb)
2018-06-13 08:08:25 +02:00