Commit graph

44458 commits

Author SHA1 Message Date
Evan Hunt
52bba5cc34 standardize CHECK and RETERR macros
previously, there were over 40 separate definitions of CHECK macros, of
which most used "goto cleanup", and the rest "goto failure" or "goto
out". there were another 10 definitions of RETERR, of which most were
identical to CHECK, but some simply returned a result code instead of
jumping to a cleanup label.

this has now been standardized throughout the code base: RETERR is for
returning an error code in the case of an error, and CHECK is for jumping
to a cleanup tag, which is now always called "cleanup". both macros are
defined in isc/util.h.
2025-12-03 13:26:28 -08:00
Colin Vidal
2955bb90c8 chg: dev: Add RRSIG if required as soon as they are found
When EDNS DO flag (`dig +dnssec`) flag is set, an rdataset is allocated
to hold the RRSIG of an RR, if present in DB. However, this allocation
is not done if the zone DB is not considered as secure
(`dns_db_issecure() == false`). Changes this behaviour by allocating the
rdataset anyway, so the RRSIG can be associated in the answer section of
the response as soon it is found from the DB.

The fact we attach the rrsig potentially more often (though it probably
occurs in edge cases) doesn't seems to affect performance in any ways:

Merge branch 'colin/rrsig-nonsecure-db' into 'main'

See merge request isc-projects/bind9!11317
2025-12-03 16:26:22 +01:00
Colin Vidal
6998fe42e3 test for RRSIG provided as soon as they are found
Add a system test which checks that a server authoritative on zone which
is not fully signed (here, it is missing the DNSKEY records as well as the
RRSIG on the RR `b`) still return the RRSIG associated with an RR if
provided in the zone.
2025-12-03 15:49:47 +01:00
Colin Vidal
3048b2a578 add RRSIG if required as soon as they are found
When EDNS DO flag (`dig +dnssec`) flag is set, an rdataset is allocated
to hold the RRSIG of an RR, if present in DB. However, this allocation
is not done if the zone DB is not considered as secure
(`dns_db_issecure() == false`). Changes this behaviour by allocating the
rdataset anyway, so the RRSIG can be associated in the answer section of
the response as soon it is found from the DB.
2025-12-03 15:49:47 +01:00
Arаm Sаrgsyаn
93fa62c3e0 fix: test: Fix an issue with unreachable cache's unit test
The isc_stdtime_now() function used by dns_unreachcache_find() to
check if the entry needs to be expired has a one-second resolution,
and the test sleeps for 1 second and then for the amount of the
expiration interval, which in a worst-case scenario can cause the
test to fail, because the entry was expected to be expired but it
wasn't. Sleep for 2 seconds instead of 1 to avoid the timing
resolution issue.

Closes #5601

Merge branch '5601-unreachable-cache-expire-test-fix' into 'main'

See merge request isc-projects/bind9!11224
2025-12-03 10:16:08 +00:00
Aram Sargsyan
8c8bf4e45d Fix an issue with unreachable cache's unit test
The isc_stdtime_now() function used by dns_unreachcache_find() to
check if the entry needs to be expired has a one-second resolution,
and the test sleeps for 1 second and then for the amount of the
expiration interval, which in a worst-case scenario can cause the
test to fail, because the entry was expected to be expired but it
wasn't. Sleep for 2 seconds instead of 1 to avoid the timing
resolution issue.
2025-12-02 16:03:26 +00:00
Mark Andrews
b378336155 fix: nil: Fix mislocated 'break;'
Closes #5665

Merge branch '5665-miss-located-break' into 'main'

See merge request isc-projects/bind9!11311
2025-12-02 14:24:47 +11:00
Mark Andrews
99c848e4a4 Fix mislocated break 2025-12-02 14:24:25 +11:00
Mark Andrews
e78e6150e5 new: usr: Add +[no]showtruncated and +[no]showallmessages to dig
The dig option +showtruncated adds the ability to display
the truncated message before retrying the query over TCP.

The dig option +showallmessages add a short cut which is
the equivalent of "dig +qr +showbadcookie +showbadversion
+showtruncated".

Closes #5657

Merge branch '5657-add-showtruncated-to-dig' into 'main'

See merge request isc-projects/bind9!11275
2025-12-02 10:11:49 +11:00
Mark Andrews
21b1ee5f80 Add +showallmessages to dig
This is equivalent to "dig +qr +showbadcookie +showbadversion
+showtruncated".
2025-12-02 09:34:13 +11:00
Mark Andrews
472cade02b check that dig +showtruncated works 2025-12-02 09:34:13 +11:00
Mark Andrews
44f12f9e61 Add +[no]showtruncated to dig
Adds the ability to display the truncated message before retrying
the query over TCP.
2025-12-02 09:34:13 +11:00
Michał Kępień
1c55e76b92 chg: doc: Update CVE checklist
Account for the recent nomenclature change in the CVE checklist.

Add a placeholder for a link to an Earliest Notification draft for every
vulnerability handled.

Use consistent Markdown reference names for all URLs in the summary
table.  Provide a template for all URLs to indicate naming expectations.

Merge branch 'michal/update-cve-checklist' into 'main'

See merge request isc-projects/bind9!11313
2025-12-01 14:43:23 +01:00
Michał Kępień
d95095e9dc
Clean up URL templates in the summary table
Use consistent Markdown reference names for all URLs in the summary
table.  Provide a template for all URLs to indicate naming expectations.
2025-12-01 14:31:39 +01:00
Michał Kępień
fe68307aad
Add Earliest Notification row to the summary table
Add a placeholder for a link to an Earliest Notification draft for every
vulnerability handled.
2025-12-01 14:31:39 +01:00
Michał Kępień
bb04e5e6e0
Replace "ASN" with "EVN" in the CVE checklist
Account for the recent nomenclature change in the CVE checklist.
2025-12-01 14:31:39 +01:00
Matthijs Mekking
edcbcdd081 chg: test: Wait for log zone_needdump is more reliable
Closes #5648

Merge branch '5648-need-dump-instead-of-sending-notifies' into 'main'

See merge request isc-projects/bind9!11265
2025-12-01 13:17:59 +00:00
Matthijs Mekking
c17ac42608 Wait for log zone_needdump is more reliable
In some cases we wait for the log message "sending notifies" before
proceeding with the test case. Notifies are rate limited. They are not
sent on every change to the zone. The "zone_needdump" messages happen on
every change.
2025-12-01 13:17:42 +00:00
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