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

39719 Commits

Author SHA1 Message Date
Matthijs Mekking
4690e95d29 Update views system test
Change test configuration to make use of 'dnssec-policy' instead of
'auto-dnssec'.

Because we now use 'dnssec-policy', there is no need to create an
explicit key in the final test that adds multiple inline zones
followed by a reconfig.
2023-07-20 11:04:23 +02:00
Matthijs Mekking
62368c6a6f Update unknown system test
Change test configuration to make use of 'dnssec-policy' instead of
'auto-dnssec'.

There is no need to sign the zone in advance.
2023-07-20 11:04:23 +02:00
Matthijs Mekking
49358928b3 Update statschannel system test
Change test configuration to make use of 'dnssec-policy' instead of
'auto-dnssec'.

Because we now add a DNSKEY with dynamic update, the sign statistics
change. When adding signatures triggered by dynamic update, the
dnssec-refresh stats are not incremented (this is only incremented
when signing is triggered by resign in lib/dns/zone.c).
2023-07-20 11:04:23 +02:00
Matthijs Mekking
660d089dca Update nsupdate system test
Remove from the nsupdate system test two test cases that are no longer
supported: We no longer support adding signing keys via dynamic update.
2023-07-20 11:04:23 +02:00
Matthijs Mekking
c8f61c4ac5 Alter mkeys system test
The mkeys system test configured 'auto-dnssec' on the root zone to do
smart signing and simulate root key changes that should be picked up
by the automated trust anchor management of BIND.

This does not require 'auto-dnssec' or 'dnssec-policy', so change the
tests to use manual smart signing with 'dnssec-signzone'.
2023-07-20 11:04:23 +02:00
Matthijs Mekking
730b7ac70f Update masterformat system test
Change test configuration to make use of 'dnssec-policy' instead of
'auto-dnssec'.
2023-07-20 11:04:23 +02:00
Matthijs Mekking
906dd57b68 Remove keymgr2kasp system test
The keymgr2kasp system test tests migration from auto-dnssec to
dnssec-policy. With auto-dnssec removed, we can also remove the
migration system test.
2023-07-20 11:04:23 +02:00
Matthijs Mekking
ee3ae4d7d5 Remove dupsigs system test
This test uses key timing metadata to do rollovers, this is no longer
applicable with 'dnssec-policy'. Note that with 'dnssec-policy' key
timing metadata is still written, but it is not used for determining
what and when to do key rollovers.
2023-07-20 11:04:23 +02:00
Matthijs Mekking
f0c164954e Copy DNSKEY record from unsigned zone db
Since external DNSKEY records may exist in the unsigned version of the
zone (for example DNSKEY records from other providers), handle these
RRsets also when copying non DNSSEC records from the unsigned zone
database to the signed version.
2023-07-20 11:04:23 +02:00
Matthijs Mekking
9ee33d99b3 Allow rndc signing commands with dnssec-policy
Some 'rndc signing' commands can still be used in conjunction with
'dnssec-policy' because it shows the progress of signing and
private type records can be cleaned up. Allow these commands to be
executed.

However, setting NSEC3 parameters is incompatible with dnssec-policy.
2023-07-20 11:04:23 +02:00
Matthijs Mekking
f4eb3ba459 Change inline system test
The inline system test tests 'auto-dnssec' in conjunction with
'inline-signing'. Change the tests to make use of 'dnssec-policy'.

Remove some tests that no longer make sense:
- The 'retransfer3.' zone tests changing the parameters with
  'rndc signing -nsec3param'. This command is going away and NSEC3
  parameters now need to be configured with nsec3param within
  'dnssec-policy'.
- The 'inactivezsk.' and 'inactiveksk.' zones test whether the ZSK take
  over signing if the KSK is inactive, or vice versa. This fallback
  mode longer makes sense when using a DNSSEC policy.

Some tests need to be adapted more than just changing 'auto-dnssec'
to 'dnssec-policy':
- The 'delayedkeys.' zone first needs to be configured as insecure,
  then we can change it to start signing. Previously, no existing
  keys means that you cannot sign the zone, with 'dnssec-policy'
  new keys will be created.
- The 'updated.' zone needs to have key states in a specific state
  so that the minimal journal check still works (otherwise CDS/
  CDNSKEY and related records will be in the journal too).
- External keys are now added to the unsigned zone and no longer
  are maintained with key files. Adjust the 'externalkey.' zone
  accordingly.
- The 'nsec3-loop.' zone requires three signing keys. Since
  'dnssec-policy' will ignore duplicates in the 'keys' section,
  create RSASHA256 keys with different role and/or key length.

Finally, the 'externalkey.' zone checks for an expected number of
DNSKEY and RRSIG records in the response. This used to be 3 DNSKEY
and 2 RRSIG records. Due to logic behavior changes (key timing
metadata is no longer authoritative, these expected values are
changed to 4 DNSKEY records (two signing keys and two external keys
per algorithm) and 1 RRSIG record (one active KSK per signing
algorithm).
2023-07-20 11:04:23 +02:00
Matthijs Mekking
d3bf732697 Update dnssec system test
The dnssec system test has some tests that use auto-dnssec. Update
these tests to make use of dnssec-policy.

Remove any 'rndc signing -nsec3param' commands because with
dnssec-policy you set the NSEC3 parameters in the configuration.

Remove now duplicate tests that checked if CDS and CDNSKEY RRsets
are signed with KSK only (the dnssec-dnskey-kskonly option worked
in combination with auto-dnssec).

Also remove the publish-inactive.example test case because such
use cases are no longer supported (only with manual signing).

The auto-nsec and auto-nsec3 zones need to use an alternative
algorithm because duplicate lines in dnssec-policy/keys are ignored.
2023-07-20 11:04:23 +02:00
Matthijs Mekking
9f75f472f6 Alter autosign system test
The autosign system test mainly tests the auto-dnssec configuration
option. Since this option is going to be removed, update the system
test so that it uses dnssec-policy.

We could remove the complete system test, but keeping an altered
version of the system test may still be useful to detect unexpected
behavior after code changes.

Change the ns1 (test root server) to use manual signing. This zone
has some weird corner cases that do not fit the dnssec-policy model
very well.

The ns2 bar zone also needs to use manual signing, because it revokes
its key, and RFC 5011 key revocation is not supported with
dnssec-policy.

There are also a couple of weird corner test cases that can be removed:
- Inactive KSK or ZSK. With dnssec-policy there is no such thing as
  ZSK taking over the role of a KSK when the KSK is deleted, or vice
  versa.
- The CDS and CDNSKEY DELETE records are now automated with
  dnssec-policy and so the tests for persistence are no longer required.

In tests.sh, bump the expected number of root DNSKEY records to 11,
because with manual signing the activation before publication is
actually honored.

Also remove any 'rndc signing -nsec3param' commands because with
dnssec-policy you set the NSEC3 parameters in the configuration.

Remove any check interval tests, these "next key event" times are
now calculated and tested in the kasp system test.
2023-07-20 11:04:23 +02:00
Matthijs Mekking
33db82cf20 Remove auto-dnssec checkconf tests
Any checkconf tests related to auto-dnssec can be removed, as this
option will be removed too.
2023-07-20 11:04:23 +02:00
Ondřej Surý
6df1f85f14 Merge branch '4096-uv-now' into 'main'
add isc_loop_now() to get consistent time

Closes #4096

See merge request isc-projects/bind9!7989
2023-07-19 13:32:47 +00:00
Evan Hunt
6ac8723611
use isc_loop_now() for dispentry timeouts
store a pointer to the running loop when creating a dispatch entry
with dns_dispatch_add(), and use isc_loop_now() to get the timestamp for
the current event loop tick when we initialize the dispentry start time
and check for timeouts.
2023-07-19 15:32:21 +02:00
Evan Hunt
e37d02905c
add isc_loop_now() to get consistent time
isc_loop_now() is a front-end to uv_now(), returning the start
time of the current event loop tick.
2023-07-19 15:32:21 +02:00
Arаm Sаrgsyаn
e20c7d1415 Merge branch 'aram/tests-statschannel-fetch.pl-typo' into 'main'
Fix a bug in an utility script for the statschannel system test

See merge request isc-projects/bind9!8108
2023-07-19 13:24:31 +00:00
Aram Sargsyan
aa7538fd38 Fix a bug in an utility script for the statschannel system test
Because of a typo, the fetch.pl script tries to extract the server
address from the input parameter 'a' instead of 's'. Fix the typo.
2023-07-19 13:23:40 +00:00
Tom Krizek
5b5d5f9f22 Merge tag 'v9.19.15' 2023-07-19 14:16:32 +02:00
Ondřej Surý
0e794e85c2 Merge branch 'ondrej/add-missing-headers-to-dns_rdataslab-header' into 'main'
Add missing headers to <dns/rdataslab.h>

See merge request isc-projects/bind9!8115
2023-07-19 07:40:59 +00:00
Ondřej Surý
fb13b439bc
Add missing headers to <dns/rdataslab.h>
The new header was not self-contained and required extra headers to be
included before including <dns/rdataslah.h>; rectify that.
2023-07-19 09:28:53 +02:00
Michal Nowak
b14bb7be97 Merge branch 'mnowak/remove-windows-support-remnants' into 'main'
Remove remnants of Windows support in system test

See merge request isc-projects/bind9!8105
2023-07-18 14:40:24 +00:00
Michal Nowak
ad3efede4d
Remove remnants of Windows support in system test
The "uname -o" command is harmful on OpenBSD because this platform does
not know about the "-o" option. It is a permanent failure since system
tests are started with "set -e".
2023-07-18 16:39:21 +02:00
Matthijs Mekking
086d78a4f1 Merge branch 'matthijs-dont-add-signing-records-on-dnskey-update' into 'main'
Don't add signing records for DNSKEY added with dynamic update

See merge request isc-projects/bind9!8070
2023-07-18 14:37:07 +00:00
Matthijs Mekking
239c94bc08 Add CHANGES entry 2023-07-18 15:57:09 +02:00
Matthijs Mekking
2152d06c8e Don't add signing records for dyn update DNSKEY
We removed DNSSEC management via dynamic update (see issue #3686),
this means we also should no longer add signing records (of private
type) for DNSKEY records added via dynamic update.
2023-07-18 15:38:53 +02:00
Tom Krizek
66e36cf55d Merge branch 'tkrizek/readthedocs-config' into 'main'
Add configuration for readthedocs.org

See merge request isc-projects/bind9!8101
2023-07-18 13:32:14 +00:00
Tom Krizek
a1a0ccda6e
Add configuration for readthedocs.org
readthedocs.org is switching to in-repo configuration file in favor of
the deprecated web interface as it allows more flexibility.

This also fixes our recent doc build issues, as we're switching to a
newer Python which is required by Sphinx.

See https://blog.readthedocs.com/migrate-configuration-v2/
2023-07-18 15:30:27 +02:00
Ondřej Surý
1ea144f50f Merge branch '4185-reduce-the-recursion-in-query_lookup' into 'main'
Make the recursive query_lookup() call from query_gotanswer() async

Closes #4185

See merge request isc-projects/bind9!8073
2023-07-18 11:41:25 +00:00
Ondřej Surý
d9d2527a19
Add CHANGES and release note for [GL #4185] 2023-07-18 11:57:11 +02:00
Evan Hunt
b2993f7b85
Make query chain processing asynchronous
Under some circumstances when processing a query response - for example,
when it contains a CNAME or DNAME - a query will have to be restarted
from the beginning to look up a new target.

This was previously handled by recursively calling the ns__query_start()
function directly from ns_query_done(). However, performance test data
indicated that chains of CNAMEs could consume quite a bit of time inside
the worker thread, increasing latency for other waiting queries.  This
has now been changed so that restarted queries are run asynchronously.
2023-07-18 11:57:11 +02:00
Mark Andrews
1c2b1c52bd Merge branch '4203-run-gdb-not-found' into 'main'
Resolve "run.gdb not found"

Closes #4203

See merge request isc-projects/bind9!8091
2023-07-18 00:34:05 +00:00
Mark Andrews
3f7723cdff Use absolute path to locate run.gdb 2023-07-18 00:01:46 +00:00
Tom Krizek
dd2b7a0b2b Merge branch 'tkrizek/doth-test-curl-set-e' into 'main'
Handle curl without HTTP/2 support in doth test

See merge request isc-projects/bind9!8104
2023-07-17 15:52:58 +00:00
Tom Krizek
cf3e9f8399
Handle curl without HTTP/2 support in doth test 2023-07-17 16:46:06 +02:00
Ondřej Surý
8ecae23d50 Merge branch 'each-split-rbtdb' into 'main'
Split up rbtdb.c

See merge request isc-projects/bind9!7873
2023-07-17 12:50:50 +00:00
Evan Hunt
5a85135c1e
split out cache-specific functions
move cache-specific functions from rbtdb.c to rbt-cachedb.c.
2023-07-17 14:50:25 +02:00
Evan Hunt
9a1a1293c0
split out zone-specific functions
move zone-specific functions from rbtdb.c to rbt-zonedb.c.
2023-07-17 14:50:25 +02:00
Evan Hunt
445ef1d033
move slab rdataset implementation to rdataslab.c
ultimately we want the slab implementation of dns_rdataset to
be usable by more database implementaions than just rbtdb. this
commit moves rdataset_methods to rdataslab.c, renamed
dns_rdataslab_rdatasetmethods.

new database methods have been added: locknode, unlocknode,
addglue, expiredata, and deletedata, allowing external functions to
perform functions that previously required internal access to the
database implementation.

database and heap pointers are now stored in the dns_slabheader object
so that header is the only thing that needs to be passed to some
functions; this will simplify moving functions that process slabheaders
out of rbtdb.c so they can be used by other database implementations.
2023-07-17 14:50:25 +02:00
Evan Hunt
17f85f6c93
move prototypes for common functions to rbtdb_p.h
rename the existing rbtdb.h to rbtdb_p.h, and start putting
macros and declarations of dns__rbtdb functions into it.
2023-07-17 14:50:25 +02:00
Evan Hunt
4db150437e
clean up unused dns_db methods
to reduce the amount of common code that will need to be shared
between the separated cache and zone database implementations,
clean up unused portions of dns_db.

the methods dns_db_dump(), dns_db_isdnssec(), dns_db_printnode(),
dns_db_resigned(), dns_db_expirenode() and dns_db_overmem() were
either never called or were only implemented as nonoperational stub
functions: they have now been removed.

dns_db_nodefullname() was only used in one place, which turned out
to be unnecessary, so it has also been removed.

dns_db_ispersistent() and dns_db_transfernode() are used, but only
the default implementation in db.c was ever actually called. since
they were never overridden by database methods, there's no need to
retain methods for them.

in rbtdb.c, beginload() and endload() methods are no longer defined for
the cache database, because that was never used (except in a few unit
tests which can easily be modified to use the zone implementation
instead).  issecure() is also no longer defined for the cache database,
as the cache is always insecure and the default implementation of
dns_db_issecure() returns false.

for similar reasons, hashsize() is no longer defined for zone databases.

implementation functions that are shared between zone and cache are now
prepended with 'dns__rbtdb_' so they can become nonstatic.

serve_stale_ttl is now a common member of dns_db.
2023-07-17 14:50:25 +02:00
Evan Hunt
1c21e50953
clean up rbtdb.c
in preparation for splitting up rbtdb.c, rename some types so they
can be defined in dns/types.h instead of only locally. these include:

- struct noqname, which is used to hold no-qname and closest-encloser
  proofs, and is now named dns_proof_t;
- rbtdb_rdatatype_t, which is used to hold a pair of rdatatypes and
  is now called dns_typepair_t and defined in rdatatype.h;
- rbtdb_serial_t, which is now just a uint32_t;
- rdatasetheader_t and rdatasetheaderlist_t, now called
  dns_slabheader_t and dns_slabheaderlist_t;
- rbtdb_version_t, now called dns_rbtdb_version_t.

the helper functions header_from_raw() and raw_from_header() are
renamed dns_slabheader_fromrdataset() and dns_slabheader_raw().

also made further style changes:
- fixing uninitialized pointer variables throughout rbtdb.c;
- switching some initializations to struct literals;
- renaming some functions and struct members more descriptively;
- replacing dns_db_secure_t with a simple bool since it no longer needs
  to be tri-valued.
2023-07-17 14:50:25 +02:00
Evan Hunt
d25d0af7f5
remove unused DNS_DBFIND options
the DNS_DBFIND_VALIDATEGLUE and DNS_DBFIND_FORCENSEC options
were never set, so the code implementing them (which in the case
of _VALIDATEGLUE appears to have been quite outdated anyway) was
never reached. they have now been removed.
2023-07-17 14:50:25 +02:00
Tony Finch
856a6e4afb
Give the rdataset->privateN fields more helpful names
BIND's rdataset structure is a view of some DNS records. It is
polymorphic, so the details of how the records are stored can vary.
For instance, the records can be held in an rdatalist, or in an
rdataslab in the rbtdb.

The dns_rdataset structure previously had a number of fields called
`private1` up to `private7`, which were used by the various rdataset
implementations. It was not at all clear what these fields were for,
without reading the code and working it out from context.

This change makes the rdataset inheritance hierarchy more clear. The
polymorphic part of a `struct dns_rdataset` is now a union of structs,
each of which is named for the class of implementation using it. The
fields of these structs replace the old `privateN` fields. (Note: the
term "inheritance hierarchy" refers to the fact that the builtin and
SDLZ implementations are based on and inherit from the rdatalist
implementation, which in turn inherits from the generic rdataset.

Most of this change is mechanical, but there are a few extras.

In keynode.c there were a number of REQUIRE()ments that were not
necessary: they had already been checked by the rdataset method
dispatch code. On the other hand, In ncache.c there was a public
function which needed to REQUIRE() that an rdataset was valid.

I have removed lots of "reset iterator state" comments, because it
should now be clear from `target->iter = NULL` where before
`target->private5 = NULL` could have been doing anything.

Initialization is a bit neater in a few places, using C structure
literals where appropriate.

The pointer arithmetic for translating between an rdataslab header and
its raw contents is now fractionally safer.
2023-07-17 14:50:25 +02:00
Evan Hunt
9330fada3a
refactor the slab rdataset implementation
- use externally accessible functions for attachnode/detachnode
  so these functions can be moved outside rbtdb.c
- simplify and tidy up some other functions
- use struct initializers when appropriate
- remove the flag RDATASET_ATTR_RETAIN; it was never being set
- renamed the rdataset attributes to
- remove the 'slab_methods' rdataset implementation. this was
  a reduced set of slab rdataset methods, omitting 'setownercase()'
  and 'getownercase()'. we can get the identical result by using
  an DNS_RDATASETATTR_KEEPCASE attribute in rdatasets that
  shouldn't have their case modified, and then we only need one
  set of rdataset methods.
2023-07-17 14:50:25 +02:00
Tom Krizek
83a33c3555 Merge branch 'tkrizek/tkey-cleanup' into 'main'
Remove tkey test remnants

See merge request isc-projects/bind9!8102
2023-07-17 09:07:28 +00:00
Tom Krizek
87e95b2348
Remove tkey test remnants
The tkey test was removed in bd4576b3cef88bcb78ae0dd7619019be4fdfb2ea
and the prereq.sh bit was accidentally added in
175d0c6d85f501c959d1371ab1017b95e27c528c
2023-07-17 10:40:07 +02:00
Tom Krizek
02b3cb671a Merge branch 'tkrizek/run-tests-with-set-e' into 'main'
Run system tests with set -e

See merge request isc-projects/bind9!8052
2023-07-17 08:19:01 +00:00
Tom Krizek
e5f2addcaa
Check return codes from commands in inline test
To improve the compatibility of the inline test with the `set -e`
option, ensure all commands which are expected to pass are explicitly
checked for return code and non-zero return codes are handled.
2023-07-14 17:10:58 +02:00