Commit graph

9693 commits

Author SHA1 Message Date
Mark Andrews
e522e80dc4 Add checking RFC 4592 responses examples to wildcard system test
(cherry picked from commit 30586aa054c9cd8a4e64c91ed78683a4b54c79bc)
2020-06-18 10:18:42 +02:00
Mark Andrews
70c27df941 The dsset returned by dns_keynode_dsset needs to be thread safe.
- clone keynode->dsset rather than return a pointer so that thread
  use is independent of each other.
- hold a reference to the dsset (keynode) so it can't be deleted
  while in use.
- create a new keynode when removing DS records so that dangling
  pointers to the deleted records will not occur.
- use a rwlock when accessing the rdatalist to prevent instabilities
  when DS records are added.

(cherry picked from commit e5b2eca1d3)
2020-06-11 16:09:43 +10:00
Mark Andrews
0c23582ffd Improve the behaviour of yamlget.py when run with python2
(cherry picked from commit 9e72266705)
2020-06-05 10:51:01 +10:00
Mark Andrews
28a940fe69 Add +yaml support for EDE
(cherry picked from commit 0ec77c2b92)
2020-06-05 10:50:58 +10:00
Michal Nowak
e39685b579
Fix "array subscript is of type 'char'" 2020-06-04 16:27:43 +02:00
Mark Andrews
6ac4e62fbc Ignore attempts to add DS records at zone apex
DS records belong in the parent zone at a zone cut and
are not retrievable with modern recursive servers.

(cherry picked from commit ae55fbbe9c)
2020-06-04 16:06:45 +02:00
Mark Andrews
b17f6eba6a Reject primary zones with an DS record at the zone apex.
DS records only belong at delegation points and if present
at the zone apex are invariably the result of administrative
errors.  Additionally they can't be queried for with modern
resolvers as the parent servers will be queried.

(cherry picked from commit 35a58d30c9)
2020-06-04 16:06:07 +02:00
Petr Mensik
596a0f27c4 Delay kserver cleanup until all tasks finishes
It might be possible some pending task would run when kserver is already
cleaned up. Postpone gsstsig structures cleanup after task and timer
managers are destroyed. No pending threads are possible after it.

Make action in maybeshutdown only if doshutdown was not already called.
Might be called from getinput event.

(cherry picked from commit 2685e69be8)
2020-06-04 11:32:33 +02:00
Ondřej Surý
d85b936898 Reduce the default value for max-stale-ttl from 1 week to 12 hours
Originally, the default value for max-stale-ttl was 1 week, which could
and in some scenarios lead to cache exhaustion on a busy resolvers.
Picking the default value will always be juggling between value that's
useful (e.g. keeping the already cached records after they have already
expired and the upstream name servers are down) and not bloating the
cache too much (e.g. keeping everything for a very long time).  The new
default reflects what we think is a reasonable to time to react on both
sides (upstream authoritative and downstream recursive).

(cherry picked from commit 13fd3ecfab)
2020-06-03 10:45:09 +00:00
Matthijs Mekking
168d362b54 Fix bug in keymgr_key_has_successor
The logic in `keymgr_key_has_successor(key, keyring)` is flawed, it
returns true if there is any key in the keyring that has a successor,
while what we really want here is to make sure that the given key
has a successor in the given keyring.

Rather than relying on `keymgr_key_exists_with_state`, walk the
list of keys in the keyring and check if the key is a successor of
the given predecessor key.

(cherry picked from commit 0d578097ef)
2020-06-02 14:54:08 +02:00
Matthijs Mekking
e85c1aa74e Replace date -d with python script
The usage of 'date -d' in the kasp system test is not portable,
replace with a python script.  Also remove some leftover
"set_keytime 'yes'" calls.

(cherry picked from commit 5b3decaf48)
2020-06-02 11:36:25 +02:00
Matthijs Mekking
da2daea0e6 Test keytimes on algorithm rollover
This improves keytime testing on algorithm rollover.  It now
tests for specific times, and also tests for SyncPublish and
Removed keytimes.

(cherry picked from commit 61c1040ae5)
2020-06-02 11:36:08 +02:00
Matthijs Mekking
327d8bb273 Test keytimes on policy changes
This improves keytime testing on reconfiguration of the
dnssec-policy.

(cherry picked from commit da5e1e3a0f)
2020-06-02 11:36:01 +02:00
Matthijs Mekking
f026332f88 Test keytimes on CSK rollover
This improves keytime testing on CSK rollover.  It now
tests for specific times, and also tests for SyncPublish and
Removed keytimes.

Since an "active key" for ZSK and KSK means something
different, this makes it tricky to decide when a CSK is
active. An "active key" intuitively means the key is signing
so we say a CSK is active when it is creating zone signatures.

This change means a lot of timings for the CSK rollover tests
need to be adjusted.

The keymgr code needs a slight change on calculating the
prepublication time: For a KSK we need to include the parent
registration delay, but for CSK we look at the zone signing
property and stick with the ZSK prepublication calculation.

(cherry picked from commit e233433772)
2020-06-02 11:35:52 +02:00
Matthijs Mekking
8e0776d0d5 Test keytimes on KSK rollover
This improves keytime testing on KSK rollover.  It now
tests for specific times, and also tests for SyncPublish and
Removed keytimes.

(cherry picked from commit 649d0833ce)
2020-06-02 11:35:43 +02:00
Matthijs Mekking
437ec25c0c kasp: registration delay adjustments
Registration delay is not part of the Iret retire interval, thus
removed from the calculation when setting the Delete time metadata.

Include the registration delay in prepublication time, because
we need to prepublish the key sooner than just the Ipub
publication interval.

(cherry picked from commit 50bbbb76a8)
2020-06-02 11:35:32 +02:00
Matthijs Mekking
48a265b2c7 Test keytimes on ZSK rollover
This improves keytime testing on ZSK rollover.  It now
tests for specific times, and also tests for SyncPublish and
Removed keytimes.

(cherry picked from commit e01fcbbaf8)
2020-06-02 11:35:19 +02:00
Matthijs Mekking
0e1290c383 Test keytimes on enable-dnssec case
This improves keytime testing for enabling DNSSEC.  It now
tests for specific times, and also tests for SyncPublish.

(cherry picked from commit cf51c87fad)
2020-06-02 11:35:09 +02:00
Matthijs Mekking
e036a0a919 Start testing keytiming metadata
This commit adds testing keytiming metadata.  In order to facilitate
this, the kasp system test undergoes a few changes:

1. When finding a key file, rather than only saving the key ID,
   also save the base filename and creation date with `key_save`.
   These can be used later to set expected key times.
2. Add a test function `set_addkeytime` that takes a key, which
   keytiming to update, a datetime in keytiming format, and a number
   (seconds) to add, and sets the new time in the given keytime
   parameter of the given key.  This is used to set the expected key
   times.
3. Split `check_keys` in `check_keys` and `check_keytimes`.  First we
   need to find the keyfile before we can check the keytimes.
   We need to retrieve the creation date (and sometimes other
   keytimes) to determine the other expected key times.
4. Add helper functions to set the expected key times per policy.
   This avoids lots of duplication.

Check for keytimes for the first test cases (all that do not cover
rollovers).

(cherry picked from commit f8e34b57b4)
2020-06-02 11:34:49 +02:00
Matthijs Mekking
91d861b90d Stop keeping track of key parameter count
Stop tracking in the comments the number of key parameters in the
kasp system test, it adds nothing beneficial.

(cherry picked from commit 8483f71258)
2020-06-02 11:34:39 +02:00
Matthijs Mekking
cec9ddd18c Fix some more test output filenames
After removing dnssec-settime calls that set key rollover
relationship, we can adjust the counts in test output filenames.

Also fix a couple of more wrong counts in output filenames.

(cherry picked from commit 8204e31f0e)
2020-06-02 11:34:31 +02:00
Matthijs Mekking
f4d3a774f7 Set key rollover relationship without settime
Using dnssec-setttime after dnssec-keygen in the kasp system test
can lead to off by one second failures, so reduce the usage of
dnssec-settime in the setup scripts.  This commit deals with
setting the key rollover relationship (predecessor/successor).

(cherry picked from commit 5a590c47a5)
2020-06-02 11:34:22 +02:00
Matthijs Mekking
34fd8a0531 Move setting keytimes from settime to keygen
In the kasp system test, we are going to set the keytimes on
dnssec-keygen so we can test them against the key creation time.
This prevents off by one second in the test, something that can
happen if you set those times with dnssec-settime after
dnssec-keygen.

Also fix some test output filenames.

(cherry picked from commit 637d5f9a68)
2020-06-02 11:34:13 +02:00
Matthijs Mekking
ab8ee0d040 keygen -k: allow to set times, not genonly
For testing purposes mainly, we want to allow set keytimings on
generated keys, such that we don't have to "keygen/settime" which
can result in one second off times.

(cherry picked from commit 1c21631730)
2020-06-02 11:33:55 +02:00
Evan Hunt
a40d6ec091 generate grammar text correctly in RST format 2020-06-01 09:58:29 +02:00
Evan Hunt
b580eb2fb3 add support for building sphinx documentation 2020-06-01 09:54:46 +02:00
Evan Hunt
330c9b32ba convert python tools' man pages to RST 2020-06-01 09:54:45 +02:00
Ondřej Surý
58e20fa746 Convert the documentation to Sphinx documentation format
The ARM and the manpages have been converted into Sphinx documentation
format.

Sphinx uses reStructuredText as its markup language, and many of its
strengths come from the power and straightforwardness of
reStructuredText and its parsing and translating suite, the Docutils.

(cherry picked from commit 9fb6d11abb)
2020-06-01 09:54:45 +02:00
Witold Kręcicki
4ceddeee78 Add missing isc_mutex_destroy and isc_conditional_destroy calls.
While harmless on Linux, missing isc_{mutex,conditional}_destroy
causes a memory leak on *BSD. Missing calls were added.

(cherry picked from commit a8807d9a7b)
2020-05-30 07:50:30 +02:00
Mark Andrews
f00cb2415a Lock access to 'answer' to silence TSAN
(cherry picked from commit b3bd8a270b)
2020-05-28 11:11:45 +10:00
Evan Hunt
c19a593d3e change "expr == false" to "!expr" in conditionals
(cherry picked from commit 57e54c46e4)
2020-05-25 17:04:04 -07:00
Evan Hunt
00c816778d change 'expr == true' to 'expr' in conditionals
(cherry picked from commit 68a1c9d679)
2020-05-25 17:03:59 -07:00
Mark Andrews
d64c9b7eb4 Handle deprecated 'trusted-keys' style anchors
(cherry picked from commit d807febd25)
2020-05-26 09:18:34 +10:00
Mark Andrews
5c6919fdde Check that delv supports deprecated trusted-keys
(cherry picked from commit 26b3ca7acf)
2020-05-26 09:18:34 +10:00
Mark Andrews
63238a6c7a Add DBC checks to named_checknames_get
(cherry picked from commit 20c07da49b)
2020-05-25 11:52:17 +10:00
Mark Andrews
d02f1ed5b8 Set obj to NULL so INSIST makes sense
(cherry picked from commit ac9e266749)
2020-05-25 11:52:17 +10:00
Michał Kępień
8d33f372a0 Do not use f-strings in Python system tests
Use str.format() instead of f-strings in Python system tests to enable
them to work on Python 3 versions older than 3.6 as the latter is not
available on some operating systems used in GitLab CI that are still
actively supported (CentOS 6, Debian 9, Ubuntu 16.04).

(cherry picked from commit 5562c38ffb)
2020-05-21 11:38:26 +02:00
Tinderbox User
046f56f5ab prep 9.16.3 2020-05-19 13:57:36 +02:00
Stephen Morris
9648c335d5 Add test for reduction in number of fetches
Add a system test that counts how many address fetches are made
for different numbers of NS records and checks that the number
are successfully limited.
2020-05-19 13:57:07 +02:00
Mark Andrews
9d787ab6f0 Check that a 'BADTIME' response with 'QR=0' is handled as a request 2020-05-19 13:57:07 +02:00
Mark Andrews
c813b5a737 Address race in dnssec system test. 'clear signing records' can fail
as the update triggers by the rndc command to clear the signing records
may not have completed by the time the subsequent rndc command to test
that the records have been removed is commenced.  Loop several times to
prevent false negative.

(cherry picked from commit 353018c0e5)
2020-05-19 13:46:07 +10:00
Mark Andrews
906211a02a Wait longer (up to 20 secs) for journal to be truncated
(cherry picked from commit 0c2f0e02f2)
2020-05-19 08:15:11 +10:00
Mark Andrews
74f79188db Retry checks that records are present and signed
There a race between when the delta is logged and when the
server returns signed record.  Retry the queries if the
lookups fail to meet expectations.

(cherry picked from commit 46c4e5d96f)
2020-05-18 15:58:43 +10:00
Mark Andrews
89c1bc58e4 move provide-ixfr testing after the serial has been checked
(cherry picked from commit c7cdc47cc5)
2020-05-15 14:29:12 +10:00
Mark Andrews
88e11a9971 Check display of EDE option
(cherry picked from commit e6b0153f8a)
2020-05-13 10:26:39 +10:00
Mark Andrews
eed4fab37b Report Extended DNS Error codes
(cherry picked from commit b144ae1bb0)
2020-05-13 10:26:39 +10:00
Ondřej Surý
75e76b072a Rewrite the statschannel traffic tests to pytest
(cherry picked from commit 1202fd912a)
2020-05-12 14:12:03 +02:00
Ondřej Surý
09a1c051ec Add tests for zone timers using the pytest testing framework
(cherry picked from commit 6aa6d7be58)
2020-05-12 14:12:03 +02:00
Paul Frieden
838329bcb7 Add the zone timers to the XSL
(cherry picked from commit 72ffa194e2)
2020-05-12 14:12:03 +02:00
Paul Frieden
794c645987 Export zone timers via stats channels
(cherry picked from commit 543bab699d)
2020-05-12 14:12:03 +02:00