Commit graph

44440 commits

Author SHA1 Message Date
Evan Hunt
53ea41b459 fix: dev: Pass isc_buffer_t pointers when applicable
In commit aea251f3bc, `isc_buffer_reserve()` was changed to
take a simple `isc_buffer_t *` instead of `isc_buffer_t **`.
A number of functions calling it have now been similarly
modified.

Merge branch 'each-text-buffers' into 'main'

See merge request isc-projects/bind9!11282
2025-11-28 19:07:48 +00:00
Evan Hunt
76b6fb3802 pass isc_buffer_t pointers when applicable
In commit aea251f3bc, `isc_buffer_reserve()` was changed to
take a simple `isc_buffer_t *` instead of `isc_buffer_t **`.
A number of functions calling it have now been similarly
modified.
2025-11-28 18:47:49 +00:00
Matthijs Mekking
814f7a72cd chg: usr: Improve output of 'rndc dnssec -status'
Add a new parameter ``-v`` to the ``rndc dnssec -status`` command for more verbose output. Previously, key states were printed, and keys that can be purged were listed. This made the output hard to read. This information is now only shown in the verbose output.

Add more meaningful messages to the status output, making it clearer what the state of a rollover is.

This makes the output more condense, improving its readability.

Closes #3938

Merge branch '3938-improve-rndc-dnssec-status-output' into 'main'

See merge request isc-projects/bind9!11099
2025-11-28 15:15:39 +00:00
Matthijs Mekking
4c96081fc3 Split rndc dnssec manpage into sections
Making it more readable.
2025-11-28 15:32:17 +01:00
Matthijs Mekking
ef33272181 Update kasp based system tests to new output
In addition fix some test bugs where we actually were testing against
the wrong policy name.
2025-11-28 15:32:17 +01:00
Matthijs Mekking
0941b5754c Change output of rndc dnssec -status
Wrap 'dns_keymgr_status()' in 'dns_zone_dnssecstatus()' so we can easily
retrieve the zone string name and refresh key time value.

In addition to the current time, output when the next key event is
expected.

Don't log keys that are completely hidden unless verbose is set.
Don't log key state values unless verbose is set, or they are in a
weird state.

For expected key states, log a more useful message of the stage of
the rollover. If we are in the middle of a key rollover, don't log
when the next key rollover is scheduled.

Condense the output for better readability.
2025-11-28 15:32:17 +01:00
Matthijs Mekking
0ff66f2924 Add verbose option to rndc dnssec -status
This can be used to hide noisy details such as key states, and keys that
have been fully retired.
2025-11-28 15:32:17 +01:00
Matthijs Mekking
e65cd3043a chg: test: Rewrite multisigner system test to pytest
Merge branch 'matthijs-pytestify-multisigner-system-test' into 'main'

See merge request isc-projects/bind9!11082
2025-11-28 14:30:38 +00:00
Matthijs Mekking
a91f13cae8 dnskey is now a property of Key class
After a rebase, the dnskey() invocations need to be adjusted to
accomodate for !11201 (0bf20f8d).
2025-11-28 14:30:31 +00:00
Matthijs Mekking
11578aa219 Update misleading comments in multisigner test
We are not actually retrieving these records from the other provider,
they are available as key files to us and we are using those files
to send a dynamic update to the server.
2025-11-28 14:30:31 +00:00
Matthijs Mekking
61d1209c31 Remove common kasp shell script
No system test is using the common kasp shell script test anymore, so we
can remove it.
2025-11-28 14:30:31 +00:00
Matthijs Mekking
97b38a1fbc Clean up shell script remnants
All the cases in this system test have been converted to pytest, so
we can clean up the shell script remnants.
2025-11-28 14:30:31 +00:00
Matthijs Mekking
c96f896482 Convert model2.secondary test to pytest
This test is similar to model2.multisigner, but now the two providers
are both secondary, both using the same hidden primary. The DNSKEY,
CDNSKEY, and CDS records need to be published at the hidden primary,
ns5, the zone is transferred to both secondaries, ns3 and ns4.

To avoid intermittent test failures, we wait for the line
"zone {zone}/IN (signed): serial {serial2} (unsigned {serial1})" in
the secondary server logs. This is a signal that the unsigned zone
with serial <serial1> has a signed version ready with serial <serial2>.

To speed up the test, disable 'notify-delay'.
2025-11-28 14:30:31 +00:00
Matthijs Mekking
fdf8a171c5 Update multisigner system test to set primary
When testing multi-signer as bump-in-the-wire (upcoming test), we want
to be able to do dynamically updates to a hidden primary. Update the
test functions such that we can set a specific primary server.
2025-11-28 14:30:31 +00:00
Matthijs Mekking
9ae449afd1 Make test code flexible for more providers
The initial test code only allowed for one additional provider. Update
the test function such that more extra keys can be tested.
2025-11-28 14:30:31 +00:00
Matthijs Mekking
773ce8d99b Convert model2.multisigner test to pytest
This converts the model2.multisigner tests from the multisigner system
test to pytest based code. Crappy shell test functions such as
'zsks_are_published', 'records_published' and others are replaced with
the standard test code from isctest.kasp and by setting 'private=False'
and 'legacy=True' on the keys from the other providers so we don't do
any key file testing.
2025-11-28 14:30:31 +00:00
Ondřej Surý
94ffc96897 chg: usr: Provide more information when the memory allocation fails
Provide more information about the failure when the memory allocation fails.

Merge branch 'ondrej/print-helpful-message-on-oom' into 'main'

See merge request isc-projects/bind9!11272
2025-11-28 14:42:43 +01:00
Ondřej Surý
b0194004d9
Provide more information when the memory allocation fails
Instead of just crashing when memory allocation fails, also print a
message saying "Out of memory!", the size of the allocation that failed,
total allocated memory from all memory contexts and value of errno.
2025-11-28 14:42:21 +01:00
Ondřej Surý
054d20205d fix: nil: Fix missing field 'merge' initializer for the new cfg_clausedef_t
In !11121, a .merge member was added to cfg_clausedef_t.  This caused
a build failure with -Werror,-Wmissing-field-initializers enabled.
Add the missing initializer and set them all to NULL to match the
intent.

Merge branch 'ondrej/fix-compilation-on-macos' into 'main'

See merge request isc-projects/bind9!11302
2025-11-28 14:34:04 +01:00
Ondřej Surý
772ef27fe6
Fix missing field 'merge' initializer for the new cfg_clausedef_t
In !11121, a .merge member was added to cfg_clausedef_t.  This caused
a build failure with -Werror,-Wmissing-field-initializers enabled.
Add the missing initializer and set them all to NULL to match the
intent.
2025-11-28 13:50:54 +01:00
Colin Vidal
dd2d690d98 fix: dev: Fix uninitialized pointer check on getipandkeylist
Function `named_config_getipandkeylist` could, in case of error in the early code attempting to get the `port` or `tls-port`, make a pointer check on a non-initialized value. This is now fixed.

Merge branch 'colin/getipandkeylist-uinitstate' into 'main'

See merge request isc-projects/bind9!11303
2025-11-28 13:45:06 +01:00
Colin Vidal
954503b9f5 fix unitiailized pointer check on getipandkeylist
Function `named_config_getipandkeylist` could, in case of error in the
early code attempting to get the `port` or `tls-port`, make a pointer
check on a non-initialized value. This is now fixed.
2025-11-28 11:55:32 +01:00
Nicki Křížek
9c312bde42 chg: test: Remove obsolete checks for PYTHON executable
Python has been required to run the system test suite for quite a while.
Remove the dated checks inside system tests which are no longer needed.

Merge branch 'nicki/cleanup-python-checks-system-tests' into 'main'

See merge request isc-projects/bind9!11292
2025-11-28 11:24:22 +01:00
Nicki Křížek
b1ffc80f26 Remove obsolete dnspython prerequisite checks
dnspython has been mandatory to run system test for quite a while.
Remove all extraneous checks for this module from prereq.sh scipts.
2025-11-28 11:24:11 +01:00
Nicki Křížek
156b213d62 Remove extraneous prerequisite script for timeouts test
The timeouts test already checks for dnspython>=2.0.0 in
test_tcp_timeouts.py and the prereq.sh file is not needed.
2025-11-28 11:24:11 +01:00
Nicki Křížek
fe92341fd3 Remove obsolete checks for PYTHON executable
Python has been required to run the system test suite for quite a while.
Remove the dated checks inside system tests which are no longer needed.
2025-11-28 11:24:11 +01:00
Ondřej Surý
a81aad0cdc fix: usr: Fix caching RRSIG covering cache NODATA record
When a RRSIG for type that we already have cached NODATA record was cached due to mismatch of the records on the upstream nameservers, an assertion failure could trigger.  This has been fixed.

Closes #5633

Merge branch '5633-evict-related-rrsig-when-adding-negative-header' into 'main'

See merge request isc-projects/bind9!11228
2025-11-28 10:51:38 +01:00
Ondřej Surý
125d7aa232
Fix not caching RRSIG covering cache NODATA record
During refactoring, a condition that prevented caching RRSIGs for
records that we already have cached NODATA records was changed in an
invalid way.  This was caught later when a cached NODATA(type) +
RRSIG(type) was found in the cache and caused an assertion failure.

Fix and simplify condition that prevents adding such RRSIGs.
2025-11-28 10:10:14 +01:00
Ondřej Surý
3d2244a745
Refactor the conditions when adding new NEGATIVE header
Refactor the block when adding existing negative header under common
block, so it is easier to understand that the two conditions inside are
related.
2025-11-28 10:10:14 +01:00
Ondřej Surý
f4adabb2dd
Evict the RRSIG when adding negative header
Formerly, we've evicted the RRSIG(type) only when we were changing
existing header from positive to negative.  Move the eviction routine
for the RRSIG to a common path, so the RRSIG also gets evicted when we
are adding new negative header for a specific type.
2025-11-28 10:10:14 +01:00
Colin Vidal
51af07cdee fix: usr: Fix parsing bug in remote-servers with key or tls
The :any:`remote-servers` clause enable the following pattern using a named ``server-list``:

	remote-servers a { 1.2.3.4; ... };
	remote-servers b { a key foo; };

However, such configuration was wrongly rejected, with an "unexpected token 'foo'" error. Such configuration is now accepted.

Closes #5646

Merge branch '5646-fix-named-remote-servers-key-tls' into 'main'

See merge request isc-projects/bind9!11252
2025-11-28 09:51:24 +01:00
Colin Vidal
4bc435ab10 add checkconf test for named remote-servers
Add checkconf system test to cover usage of `remote-servers` with a
named server-list and a `key` and/or a `tls` option.
2025-11-28 09:10:54 +01:00
Colin Vidal
2956e4fc45 check validity of key and tls in a server-list
If a `key` or `tls` is associated to an IP address inside a server-list,
only the `tls` existence in the configuration was checked. Also, if
`key` or `tls` is associated to a named server-list inside a
server-list, there was no check at all.

Add the check for making sure a `key` is defined in the configuration,
as well as the check for `key` and `tls` when used on a named
server-list.
2025-11-28 09:10:54 +01:00
Colin Vidal
1a732b6b8e check remote-servers list correctness
`check.c` only checks if `remote-servers`, `primaries`, etc. are not
duplicated inside the configuration file, but does not check the
correctness of its definition. This commit fixes this by calling
`validate_remotes()` for each `remote-servers` (and other aliases),
which validates the correctness of the definition itself (this is the
same call done to validate other cases like `also-notify`, etc.).
2025-11-28 09:10:54 +01:00
Colin Vidal
ccb82ea85d refactoring of named_config_getipandkeylist
Function `named_config_getipandkeylist()` processes the nested lists by
overriding the current local variable of the function, jumping back to
the beginning of the list processing. Of course, in order to go back to
the previous state and process the remaining items of the current list,
a "stack" array is used in order to put and get back the next list
element and associated values.

This makes the logic quite complex and error prone. Instead, this commit
changes the logic by recursing into the nested list (while sharing a
state between all the invocations). The processing is fundamentally
identical, but instead of "manually" handling the stack to go back to
the previous state (and process remaining elements of the current list),
takes advantage of recursion.
2025-11-28 09:10:53 +01:00
Colin Vidal
e732a8d25a minimal fix for missing key/tls in named remote-servers
The following case

   remote-servers foo { 10.53.0.5; };
   remote-servers bar { foo key fookey; };

did not work: the `fookey` was silently ignored. No matter how `bar` was
used, the server `10.53.0.5` wouldn't be contacted using the TSIG key
`fookey`. The problem is the same the for `tls` property.

The reason of the problem was that when `named_config_getipandkeylist()`
reached a named server-list (here, `foo`), it modified the current
context in order to immediately process what is inside `foo`, but forgot
to look at the fields `key` and `tls`, to associate those with `foo`
addresses.

Fix the problem by wrapping the `key` and `tls` from the "caller" list
inside the existing `lists` struct which is used to figure out if a
list is already processed or not. That way, the `key` and `tls` values
can be read when adding the addresses of the nested list.
2025-11-28 09:10:53 +01:00
Colin Vidal
9c96c38268 remove dns_notify_dequeue
Function `dns_notify_dequeue` is dead code, removing it.
2025-11-28 09:10:53 +01:00
Colin Vidal
32a4aa95ae test named remote-servers key usage
Even though `remote-servers` now allows using named server-list with `key`
(or `tls`), the `key` or `tls` is not used, in the context of a named
server-list, when configuring the server.

For instance,

   remote-servers foo { 10.53.0.5; };
   also-notify { foo key fookey; };

won't use `fookey`.

Add a system test highlighting the problem.
2025-11-28 09:10:53 +01:00
Colin Vidal
046c6819b2 allow named remote-servers list with key or tls
The remote-servers clause enables the following pattern:

	remote-servers a { 1.2.3.4; ... };
	remote-servers b { a key foo; };

However, `check.c` was explicitly throwing an error if a `key` or `tls`
was provided after a named server-list. Remove this check, as this is a
valid use case.
2025-11-28 09:10:53 +01:00
Arаm Sаrgsyаn
d441e14cbf fix: usr: Fix TLS contexts cache object usage bug in the resolver
:iscman:`named` could terminate unexpectedly when reconfiguring or
reloading, and if client-side TLS transport was in use (for example,
when forwarding queries to a DoT server). This has been fixed.

Closes #5653

Merge branch '5653-tlsctx_cache-reference-bug-fix' into 'main'

See merge request isc-projects/bind9!11295
2025-11-27 17:41:17 +00:00
Aram Sargsyan
ed7b08c0c4 Fix a bug where tlsctx_cache could be destroyed while still in use
When named is being reconfigured, it detaches from the old
'isc_tlsctx_cache_t' TLS context cache object and creates a
new one. This can cause an assertion failure within the
resolver when the object is destroyed while still in use,
because the resolver is using the object without getting
attached to it.

Add an attach/detach so that the 'isc_tlsctx_cache_t' doesn't
get destroyed while still being in use.
2025-11-27 16:45:55 +00:00
Ondřej Surý
908b7c1f34 fix: usr: Fix the spurious timeouts while resolving names
Sometimes the loops in the resolving (e.g. to resolve or validate ns1.example.com we need to resolve ns1.example.com) were not properly detected leading to spurious 10 seconds delay.  This has been fixed and such loops are properly detected.

Closes #3033, #5578

Merge branch '5578-tracker-parent-fetch' into 'main'

See merge request isc-projects/bind9!11138
2025-11-27 17:34:42 +01:00
Ondřej Surý
4d307ac67a
Detect resolution loops between fetches
Maintain the relationship between the parent and child fetch and when
creating a new child fetch, properly check the resolution loops that
would lead to a new fetch would join one of the parent's fetch contexts.
2025-11-27 17:34:25 +01:00
Ondřej Surý
15494053b1 chg: usr: Change the QNAME minimization algorithm to follow the standard
In !9155, the QNAME minimization was changed to not leak the query type
to the parent name server.  This violates RFC 9156 Section 3, step (3)
and it is not necessary.  It also breaks some (weird) authoritative DNS
setups, especially when CNAMEs are involved.  Also there is really no
privacy leak with query type.

Closes #5661

Merge branch '5661-dont-minimize-when-QNAME-matches-original-QNAME' into 'main'

See merge request isc-projects/bind9!11293
2025-11-27 17:34:07 +01:00
Ondřej Surý
ed460c50b7
Change the QNAME minimization algorithm to follow the standard
In !9155, the QNAME minimization was changed to not leak the query type
to the parent name server.  This violates RFC 9156 Section 3, step (3)
and it is not necessary.  It also breaks some (weird) authoritative DNS
setups, especially when CNAMEs are involved.  Also there is really no
privacy leak with query type.
2025-11-27 16:47:29 +01:00
Michal Nowak
40c375c58e new: ci: Add Fedora 43
Merge branch 'mnowak/fedora-43' into 'main'

See merge request isc-projects/bind9!11285
2025-11-27 16:35:22 +01:00
Michal Nowak
350c3a9a19
Add Fedora 43 2025-11-27 16:30:30 +01:00
Nicki Křížek
d2777a6e78 new: test: Create trust anchors from isctest.kasp.Key
Add isctest.kasp.Key.into_ta() method which convert the key into DS /
DNSKEY trust anchor for BIND config. Add a shared template
trusted.conf.j2 which can be linked to in tests to create the trust
anchor configuration from trust anchor data returned from bootstrap()
function.

This is basically a python replacement for the keyfile_to_static_ds (and
friends) from the conf.sh shell framework.

Merge branch 'nicki/pytest-add-trust-anchor-template' into 'main'

See merge request isc-projects/bind9!11201
2025-11-27 14:49:01 +01:00
Nicki Křížek
2f2be20547 Mock DSDigest for compatibility with older dnspython
DSDigest class isn't available prior to dnspython 2.0.0 and prior to Add
an isctest.compat.DSDigest compatibility hack to support those versions.
2025-11-27 14:02:49 +01:00
Nicki Křížek
f6cb154b65 Add a template for TA and generate it from isctest.kasp.Key
Add isctest.kasp.Key.into_ta() method which convert the key into DS /
DNSKEY trust anchor for BIND config. Add a shared template
trusted.conf.j2 which can be linked to in tests to create the trust
anchor configuration from trust anchor data returned from bootstrap()
function.

This is basically a python replacement for the keyfile_to_static_ds (and
friends) from the conf.sh shell framework.
2025-11-27 14:02:49 +01:00