]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
18 months agoRemove dns_badcache usage in the resolver (lame-ttl) bind-9.20-badcache-cleaning
Ondřej Surý [Fri, 22 Nov 2024 14:10:26 +0000 (15:10 +0100)] 
Remove dns_badcache usage in the resolver (lame-ttl)

The lame-ttl processing was overriden to be disabled in the config,
but the code related to the lame-ttl was still kept in the resolver
code.  More importantly, the DNS_RESOLVER_BADCACHETTL() macro would
cause the entries in the resolver badcache to be always cached for at
least 30 seconds even if the lame-ttl would be set to 0.

Remove the dns_badcache code from the dns_resolver unit, so we save some
processing time and memory in the resolver code.

18 months agoImprove the badcache cleaning by adding LRU and using RCU
Ondřej Surý [Thu, 14 Nov 2024 18:51:29 +0000 (19:51 +0100)] 
Improve the badcache cleaning by adding LRU and using RCU

Instead of cleaning the dns_badcache opportunistically, add per-loop
LRU, so each thread-loop can clean the expired entries.  This also
allows removal of the atomic operations as the badcache entries are now
immutable, instead of updating the badcache entry in place, the old
entry is now deleted from the hashtable and the LRU list, and the new
entry is inserted in the LRU.

18 months ago[9.20] chg: nil: Re-split format strings lib/ns/update.c
Mark Andrews [Thu, 21 Nov 2024 06:27:16 +0000 (06:27 +0000)] 
[9.20] chg: nil: Re-split format strings lib/ns/update.c

Re-split format strings that had been poorly split by multiple
clang-format runs using different versions of clang-format.

Closes #5043

Backport of MR !9752

Merge branch 'backport-5043-re-split-format-strings-lib-ns-update-c-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9755

18 months agoRe-split format strings
Mark Andrews [Thu, 14 Nov 2024 01:34:11 +0000 (12:34 +1100)] 
Re-split format strings

Re-split format strings that had been poorly split by multiple
clang-format runs using different versions of clang-format.

(cherry picked from commit a24d6e1654834179e11cb29671b978673cc20379)

18 months ago[9.20] chg: dev: Add two new clang-format options that help with code formatting
Ondřej Surý [Tue, 19 Nov 2024 15:42:23 +0000 (15:42 +0000)] 
[9.20] chg: dev: Add two new clang-format options that help with code formatting

* Add new clang-format option to remove redundant semicolons
* Add new clang-format option to remove redundant parentheses

Backport of MR !9749

Merge branch 'backport-ondrej/code-style-2024-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9750

18 months agoIgnore clang-format reformatting commit
Ondřej Surý [Tue, 19 Nov 2024 09:52:38 +0000 (10:52 +0100)] 
Ignore clang-format reformatting commit

(cherry picked from commit 82f0c31c0da45dd6c50e3897aeac5cded77f44f0)

18 months agoRemove redundant semicolons after the closing braces of functions
Ondřej Surý [Tue, 19 Nov 2024 09:41:22 +0000 (10:41 +0100)] 
Remove redundant semicolons after the closing braces of functions

(cherry picked from commit 1a19ce39db12ed4ecf59a3d0f5734656d24999a5)

18 months agoAdd new clang-format option to remove redundant semicolons
Ondřej Surý [Tue, 19 Nov 2024 09:39:47 +0000 (10:39 +0100)] 
Add new clang-format option to remove redundant semicolons

The new clang-format options (since clang-format 16) removes semicolons
after the closing braces of functions and constructors/destructors.

(cherry picked from commit c7420eccd9b169dd0fd8864f192373a3390988af)

18 months agoRemove redundant parentheses from the return statement
Ondřej Surý [Tue, 19 Nov 2024 09:38:03 +0000 (10:38 +0100)] 
Remove redundant parentheses from the return statement

(cherry picked from commit 0258850f202b7a46b52f3e3a4968c3fc68fe9a45)

18 months agoAdd new clang-format option to remove redundant parentheses
Ondřej Surý [Tue, 19 Nov 2024 09:35:40 +0000 (10:35 +0100)] 
Add new clang-format option to remove redundant parentheses

The new clang-format option (since 17) can remove redundant parentheses
in the return statement (with configuration value ReturnStatement).

(cherry picked from commit 3873b0c279b782fbbb7b7e544fc4151624610385)

18 months ago[9.20] fix: dev: Fix a data race between dns_zone_getxfr() and dns_xfrin_create()
Arаm Sаrgsyаn [Sat, 16 Nov 2024 19:51:25 +0000 (19:51 +0000)] 
[9.20] fix: dev: Fix a data race between dns_zone_getxfr() and dns_xfrin_create()

There is a data race between the statistics channel, which uses
`dns_zone_getxfr()` to get a reference to `zone->xfr`, and the creation
of `zone->xfr`, because the latter happens outside of a zone lock.

Split the `dns_xfrin_create()` function into two parts to separate the
zone transfer starting part from the zone transfer object creation part.
This allows us to attach the new object to a local variable first, then
attach it to `zone->xfr` under a lock, and only then start the transfer.

Closes #5011

Backport of MR !9716

Merge branch 'backport-5011-dns_zone_getxfr-race-fix-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9728

18 months agoFix a data race between dns_zone_getxfr() and dns_xfrin_create()
Aram Sargsyan [Tue, 5 Nov 2024 10:28:37 +0000 (10:28 +0000)] 
Fix a data race between dns_zone_getxfr() and dns_xfrin_create()

There is a data race between the statistics channel, which uses
`dns_zone_getxfr()` to get a reference to `zone->xfr`, and the creation
of `zone->xfr`, because the latter happens outside of a zone lock.

Split the `dns_xfrin_create()` function into two parts to separate the
zone tranfer startring part from the zone transfer object creation part.
This allows us to attach the new object to a local variable first, then
attach it to `zone->xfr` under a lock, and only then start the transfer.

(cherry picked from commit dbf230650f74d40fc1e1b45e1445d174802ede1b)

18 months ago[9.20] new: usr: Update bind.keys with the new 2025 IANA root key
Evan Hunt [Fri, 15 Nov 2024 23:16:37 +0000 (23:16 +0000)] 
[9.20] new: usr: Update bind.keys with the new 2025 IANA root key

Add an 'initial-ds' entry to bind.keys for the new root key, ID
38696, which is scheduled for publication in January 2025.

Closes #4896

Backport of MR !9422

Merge branch 'backport-4896-update-bind-keys-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9746

18 months agoAdd the DS for the new root key (38696)
Evan Hunt [Mon, 26 Aug 2024 19:13:09 +0000 (12:13 -0700)] 
Add the DS for the new root key (38696)

Add an 'initial-ds' entry to bind.keys for the new root key, ID
38696, scheduled for publication in January 2025.

(cherry picked from commit 609bf35075868ceca1a39b003613317d7796e6dd)

18 months ago[9.20] fix: nil: Add OpenSSL includes as needed
Ondřej Surý [Fri, 15 Nov 2024 15:54:59 +0000 (15:54 +0000)] 
[9.20] fix: nil: Add OpenSSL includes as needed

The isc/crypto.h now directly includes the OpenSSL headers (evp.h) and
any application that includes that header also needs to have
OPENSSL_CFLAGS in the Makefile.am.  Adjust the required automake files
as needed.

Backport of MR !9713

Merge branch 'backport-ondrej/add-missing-OPENSSL_CFLAGS-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9715

18 months agoAdd OpenSSL includes as needed
Ondřej Surý [Mon, 4 Nov 2024 15:13:45 +0000 (15:13 +0000)] 
Add OpenSSL includes as needed

The isc/crypto.h now directly includes the OpenSSL headers (evp.h) and
any application that includes that header also needs to have
OPENSSL_CFLAGS in the Makefile.am.  Adjust the required automake files
as needed.

(cherry picked from commit 88103e72d52d539df41f28166349e2afcfb4da63)

18 months ago[9.20] chg: doc: Move Known Issues to BIND9 wiki
Petr Špaček [Fri, 15 Nov 2024 13:02:23 +0000 (13:02 +0000)] 
[9.20] chg: doc: Move Known Issues to BIND9 wiki

Merge branch 'nicki/move-known-issues-to-wiki-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9730

18 months agoMove Known Issues to BIND9 wiki
Nicki Křížek [Thu, 7 Nov 2024 13:06:53 +0000 (14:06 +0100)] 
Move Known Issues to BIND9 wiki

Keeping the Known Issues as part of the rendered docs has the issue that
the list can't be updated on the official docs website until the next
release. This is unpractical is a high-priority issue is discovered
shortly after a release. Keep the Known Issues in wiki and simply link
to the list from the rendered docs. The wiki article can be updated at
any time as needed.

18 months ago[9.20] fix: usr: Fix race condition when canceling ADB find
Ondřej Surý [Wed, 13 Nov 2024 08:52:08 +0000 (08:52 +0000)] 
[9.20] fix: usr: Fix race condition when canceling ADB find

When canceling the ADB find, the lock on the find gets released for
a brief period of time to be locked again inside adbname lock.  During
the brief period that the ADB find is unlocked, it can get canceled by
other means removing it from the adbname list which in turn causes
assertion failure due to a double removal from the adbname list.
This has been fixed.

Closes #5024

Backport of MR !9722

Merge branch 'backport-5024-fix-crash-in-dns_adb_cancelfind-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9744

18 months agoRevalidate the adbname when canceling the ADB find
Ondřej Surý [Tue, 5 Nov 2024 13:59:16 +0000 (14:59 +0100)] 
Revalidate the adbname when canceling the ADB find

When canceling the ADB find, the lock on the find gets released for
a brief period of time to be locked again inside adbname lock.  During
the brief period that the ADB find is unlocked, it can get canceled by
other means removing it from the adbname list which in turn causes
assertion failure due to a double removal from the adbname list.

Recheck if the find->adbname is still valid after acquiring the lock
again and if not just skip the double removal.  Additionally, attach to
the adbname as in the worst case, the adbname might also cease to exist
if the scheduler would block this particular thread for a longer period
of time invalidating the lock we are going to acquire and release.

(cherry picked from commit 128e50e1ff888ff760f0753613edfe9bf360a857)

18 months ago[9.20] fix: test: minor fixes for extra_artifacts detection
Nicki Křížek [Tue, 12 Nov 2024 13:29:51 +0000 (13:29 +0000)] 
[9.20] fix: test: minor fixes for extra_artifacts detection

Some omissions of !9426 discovered during the backports

Backport of MR !9739

Merge branch 'backport-nicki/extra-artifacts-fixups-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9741

18 months agoFix clean.sh removal omissions
Nicki Křížek [Tue, 12 Nov 2024 08:25:34 +0000 (09:25 +0100)] 
Fix clean.sh removal omissions

- Ensure keyfromlabel token is cleaned up
- Remove forgotten clean.sh file
- Add missing enginepkcs11 test artifact

(cherry picked from commit 7dde34afacf414fbef37e0198ee0bff5452c656e)

18 months agoEnsure pytest runner get proper outcome from flaky reruns
Nicki Křížek [Tue, 12 Nov 2024 09:07:02 +0000 (10:07 +0100)] 
Ensure pytest runner get proper outcome from flaky reruns

When a test is re-run by the flaky plugin, the TestReport outcomes
collected in the pytest_runtest_makereport() hook should be overriden.
Each of the setup/call/teardown phases is reported again and since we
care about the overall outcome, their respective results should be
overriden so that only the outcome from the final test (re)run gets
reported.

Prior to this change, it lead to a situation where an extra_artifact
generated during the test might be ignored. This was caused because the
check was skipped, since the test was incorrectly considered as "failed"
in the case where the test would fail on the first run, but pass on a
subsequent flaky rerun.

(cherry picked from commit b66fb31dcbaeec4e0d4486a468666b40a25cf5e7)

18 months ago[9.20] chg: dev: Use lists of expected artifacts in system tests
Nicki Křížek [Fri, 8 Nov 2024 15:24:07 +0000 (15:24 +0000)] 
[9.20] chg: dev: Use lists of expected artifacts in system tests

``clean.sh`` scripts have been replaced by lists of expected artifacts for each system test module. The list is defined using the custom ``pytest.mark.extra_artifacts`` mark, which can use both filenames and globs.

Closes #4261

Backport of MR !9426

Merge branch 'backport-4261-add-pytest-fixture-checking-test-artifacts-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9734

18 months agoRemove invocations and mentions of clean.sh
Nicki Křížek [Mon, 26 Aug 2024 13:46:21 +0000 (15:46 +0200)] 
Remove invocations and mentions of clean.sh

(cherry picked from commit f2cb2e57231262835caf2fc44097bbf7f3e1ed4f)

18 months agoReplace clean.sh files with extra_artifacts mark
Nicki Křížek [Mon, 19 Aug 2024 16:54:13 +0000 (18:54 +0200)] 
Replace clean.sh files with extra_artifacts mark

The artifact lists in clean.sh and extra_artifacts might be slightly
different. The list was updated for each test to reflect the current
state.

(cherry picked from commit 7c259fe254c0c67480760a678d39fbfd9bef69d7)

18 months agoAdd pytest fixture for checking test artifacts
Michał Kępień [Mon, 19 Aug 2024 16:49:08 +0000 (18:49 +0200)] 
Add pytest fixture for checking test artifacts

Prior to introducing the pytest runner, clean.sh files were used as a
list of files that the test is expected to leave around as artifacts and
check that no extra files were created.

With the pytest runner, those scripts are no longer used, but the
ability to detect extraneous files is still useful. Add a new
"extra_artifacts" mark which can be used for the same purpose.

(cherry picked from commit 3a9f4edddcfba0d4d303f0ae6873a9f0c07966d7)

18 months ago[9.20] rem: nil: Remove named_g_sessionkey and named_g_sessionkeyname
Mark Andrews [Thu, 7 Nov 2024 05:15:00 +0000 (05:15 +0000)] 
[9.20] rem: nil: Remove named_g_sessionkey and named_g_sessionkeyname

Remove named_g_sessionkey and named_g_sessionkeyname as they are declared and cleaned up but otherwise are unused.

Closes #5023

Backport of MR !9720

Merge branch 'backport-5023-remove-named_g_sessionkey-as-it-is-unused-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9725

18 months agoRemove named_g_sessionkey and named_g_sessionkeyname
Mark Andrews [Tue, 5 Nov 2024 23:23:22 +0000 (10:23 +1100)] 
Remove named_g_sessionkey and named_g_sessionkeyname

They are only declared and cleaned up but otherwise unused.

(cherry picked from commit f70ff727ec28bf026a3b554ba1ee20be463f9153)

18 months ago[9.20] chg: usr: Print expire option in transfer summary.
Mark Andrews [Tue, 5 Nov 2024 02:06:11 +0000 (02:06 +0000)] 
[9.20] chg: usr: Print expire option in transfer summary.

The zone transfer summary will now print the expire option value in the zone transfer summary.

Closes #5013

Backport of MR !9694

Merge branch 'backport-5013-print-expire-option-in-transfer-summary-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9714

18 months agoUpdate zone transfer summary
Mark Andrews [Fri, 25 Oct 2024 20:50:23 +0000 (07:50 +1100)] 
Update zone transfer summary

Print the expire option in the zone transfer summary. This is
currently emitted in a DEBUG(1) message.

(cherry picked from commit 5253c75b7a51bd39521755a487658deba2402f9e)

18 months ago[9.20] chg: usr: dnssec-ksr now supports KSK rollovers
Mark Andrews [Mon, 4 Nov 2024 02:16:52 +0000 (02:16 +0000)] 
[9.20] chg: usr: dnssec-ksr now supports KSK rollovers

The tool 'dnssec-ksr' now allows for KSK generation, as well as planned KSK rollovers. When signing a bundle from a Key Signing Request (KSR), only the key that is active in that time frame is being used for signing. Also, the CDS and CDNSKEY records are now added and removed at the correct time.

Closes #4697

Closes #4705

Backport of MR !9452

Merge branch 'backport-4705-dnssec-ksr-only-sign-with-active-ksks-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9711

18 months agoFix dnssec-ksr to support KSK rollovers
Matthijs Mekking [Wed, 4 Sep 2024 14:00:13 +0000 (16:00 +0200)] 
Fix dnssec-ksr to support KSK rollovers

dnssec-ksr can now sign KSR files with multiple KSKs. A planned KSK
rollover is supported, meaning the KSR will first be signed with
one KSK and later with another. The timing metadata for CDS and
CDNSKEY records are also taken into account, so these records are
only published when the time is between "SyncPublish" and "SyncDelete".

(cherry picked from commit d7f2a2f43781285381ea49771aac31f06ce337c4)

18 months agoAdd KSK roll test case
Matthijs Mekking [Wed, 4 Sep 2024 13:57:55 +0000 (15:57 +0200)] 
Add KSK roll test case

Add a test case for Offline KSK where during the lifespan of the Signed
Key Response a KSK rollover happens. Ensure that the correct DNSKEY,
CDNSKEY, and CDS records are published at the right times.

(cherry picked from commit 8cf5f972f4e92b732d34a7715a789c64cdf997e4)

18 months agoAllow empty CDNSKEY/CDS RRset in ksr system test
Matthijs Mekking [Wed, 4 Sep 2024 13:54:53 +0000 (15:54 +0200)] 
Allow empty CDNSKEY/CDS RRset in ksr system test

When the zone is initially signed, the CDNSKEY/CDS RRset is not
immediately published. The DNSKEY and signatures must propagate first.
Adjust the test to allow for this case.

(cherry picked from commit 708927e03d152983557b6a2d0d40888e0ccffad5)

18 months agodnssec-ksr keygen -o to create KSKs
Matthijs Mekking [Tue, 3 Sep 2024 15:24:22 +0000 (17:24 +0200)] 
dnssec-ksr keygen -o to create KSKs

Add an option to dnssec-ksr keygen, -o, to create KSKs instead of ZSKs.
This way, we can create a set of KSKS for a given period too.

For KSKs we also need to set timing metadata, including "SyncPublish"
and "SyncDelete". This functionality already exists in keymgr.c so
let's make the function accessible.

Replace dnssec-keygen calls with dnssec-ksr keygen for KSK in the
ksr system test and check keys for created KSKs as well. This requires
a slight modification of the check_keys function to take into account
KSK timings and metadata.

(cherry picked from commit 680aedb595917868118bf312834fc388787c5b4e)

18 months agoAdd -f option to dnssec-ksr documentation
Matthijs Mekking [Tue, 3 Sep 2024 14:02:24 +0000 (16:02 +0200)] 
Add -f option to dnssec-ksr documentation

This was previously left out by error.

(cherry picked from commit 01169b7ffc442499244c88526ff95f54f2579106)

18 months ago[9.20] fix: nil: TLS notify checks fail on OL 8 FIPS
Mark Andrews [Sat, 2 Nov 2024 06:36:41 +0000 (06:36 +0000)] 
[9.20] fix: nil: TLS notify checks fail on OL 8 FIPS

Add missing checks for `$FEATURETEST --have-fips-dh` in notify system test to match those in setup.sh.

Closes #5015

Backport of MR !9707

Merge branch 'backport-5015-tls-notify-checks-fail-on-ol-8-fips-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9712

18 months agoAdd missing $FEATURETEST --have-fips-dh
Mark Andrews [Thu, 31 Oct 2024 21:42:41 +0000 (08:42 +1100)] 
Add missing $FEATURETEST --have-fips-dh

Notify over TLS only works if FIPS DH is supported.  Skip the system
tests parts that depend on it.

(cherry picked from commit 4f7e3e29a7907dada00ed8a4002eecb669214646)

18 months ago[9.20] chg: test: Match algorithms when checking signatures
Matthijs Mekking [Fri, 1 Nov 2024 14:51:01 +0000 (14:51 +0000)] 
[9.20] chg: test: Match algorithms when checking signatures

In the ksr system test, the 'test_ksr_twotone' case may fail if there are two keys with the same keytag (but different algorithms), because one key is expected to be signing and the other is not.

Switch to regular expression matching and include the algorithm in the search string.

Closes #5017

Backport of MR !9701

Merge branch 'backport-5017-unexpected-match-ksr-twotone-again-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9710

18 months agoMatch algorithms when checking signatures
Matthijs Mekking [Thu, 31 Oct 2024 10:25:23 +0000 (11:25 +0100)] 
Match algorithms when checking signatures

In the ksr system test, the test_ksr_twotone case may fail if there
are two keys with the same keytag (but different algorithms), because
one key is expected to be signing and the other is not.

Switch to regular expression matching and include the algorithm in the
search string.

(cherry picked from commit 795fcc9f803068de8c5dbdbcbba69bbd0545b8be)

18 months ago[9.20] chg: test: Rewrite rsabigexponent system test to pytest
Michal Nowak [Thu, 31 Oct 2024 18:57:28 +0000 (18:57 +0000)] 
[9.20] chg: test: Rewrite rsabigexponent system test to pytest

Backport of MR !9157

Merge branch 'backport-mnowak/pytest_rewrite_rsabigexponent-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9705

18 months agoRewrite rsabigexponent system test to pytest
Michal Nowak [Thu, 18 Jul 2024 14:10:49 +0000 (16:10 +0200)] 
Rewrite rsabigexponent system test to pytest

(cherry picked from commit cacff68e7802dfc376882e9b8776b30c40df4314)

18 months ago[9.20] fix: doc: Remove the CHANGES file
Michal Nowak [Thu, 31 Oct 2024 18:11:43 +0000 (18:11 +0000)] 
[9.20] fix: doc: Remove the CHANGES file

With the introduction of the generated changelog, the CHANGES file
became a symlink to doc/arm/changelog.rst. After the changes made in
!9549, the changelog file transitioned from being a wholly generated
file to one that includes versioned changelog files, which are
themselves generated. However, while implementing !9549, we overlooked
that the CHANGES file is copied to a release directory on an FTP server
and contains just "include" directives, not the changelog itself.
Therefore, in the same fashion as the "RELEASE-NOTES*.html" file, create
a "CHANGELOG*.html" file that redirects to the Changelog appendix of the
ARM.

Closes #5000

Backport of MR !9690

Merge branch 'backport-5000-provide-correct-changelog-on-ftp-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9703

18 months agoFix changelog history header
Michal Nowak [Thu, 24 Oct 2024 15:05:15 +0000 (17:05 +0200)] 
Fix changelog history header

(cherry picked from commit 9750f22e3afc6d28b286522f8784b1ddfbd8ada6)

18 months agoRemove the CHANGES file
Michal Nowak [Thu, 24 Oct 2024 15:01:57 +0000 (17:01 +0200)] 
Remove the CHANGES file

With the introduction of the generated changelog, the CHANGES file
became a symlink to doc/arm/changelog.rst. After the changes made in
!9549, the changelog file transitioned from being a wholly generated
file to one that includes versioned changelog files, which are
themselves generated. However, while implementing !9549, we overlooked
that the CHANGES file is copied to a release directory on an FTP server
and contains just "include" directives, not the changelog itself.
Therefore, in the same fashion as the "RELEASE-NOTES*.html" file, create
a "CHANGELOG*.html" file that redirects to the Changelog appendix of the
ARM.

(cherry picked from commit e40bd273e474a0562bcabccbb193ae1074443e3d)

18 months ago[9.20] new: dev: Support jinja2 templates in pytest runner
Nicki Křížek [Thu, 31 Oct 2024 12:13:09 +0000 (12:13 +0000)] 
[9.20] new: dev: Support jinja2 templates in pytest runner

Configuration files in system tests which require some variables (e.g.
port numbers) filled in during test setup, can now use jinja2 templates
when `jinja2` python package is available.

Any `*.j2` file found within the system test directory will be
automatically rendered with the environment variables into a file
without the `.j2` extension by the pytest runner. E.g.
`ns1/named.conf.j2` will become `ns1/named.conf` during test setup. To
avoid automatic rendering, use `.j2.manual` extension and render the
files manually at test time.

New `templates` pytest fixture has been added. Its `render()` function
can be used to render a template with custom test variables. This can be
useful to fill in different config options during the test. With
advanced jinja2 template syntax, it can also be used to include/omit
entire sections of the config file rather than using `named1.conf.in`,
`named2.conf.in` etc.

Closes #4938

Backport of MR !9587

Merge branch 'backport-4938-use-jinja2-templates-in-system-tests-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9699

18 months agoSupport jinja2 templates in pytest runner
Nicki Křížek [Tue, 1 Oct 2024 12:45:36 +0000 (14:45 +0200)] 
Support jinja2 templates in pytest runner

Configuration files in system tests which require some variables (e.g.
port numbers) filled in during test setup, can now use jinja2 templates
when `jinja2` python package is available.

Any `*.j2` file found within the system test directory will be
automatically rendered with the environment variables into a file
without the `.j2` extension by the pytest runner. E.g.
`ns1/named.conf.j2` will become `ns1/named.conf` during test setup. To
avoid automatic rendering, use `.j2.manual` extension and render the
files manually at test time.

New `templates` pytest fixture has been added. Its `render()` function
can be used to render a template with custom test variables. This can be
useful to fill in different config options during the test. With
advanced jinja2 template syntax, it can also be used to include/omit
entire sections of the config file rather than using `named1.conf.in`,
`named2.conf.in` etc.

(cherry picked from commit 60e118c4fb7085030f47ef69e136fc6ca710b009)

18 months agochg: doc: Make inline-signing default value change more clear in documentation
Matthijs Mekking [Wed, 30 Oct 2024 16:11:01 +0000 (16:11 +0000)] 
chg: doc: Make inline-signing default value change more clear in documentation

Emphasize more that the `inline-signing` default value has changed in 9.20.0.

Merge branch 'matthijs-improve-release-notes-wrt-inline-signing-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9647

18 months agoMake inline-signing default value change more clear
Matthijs Mekking [Wed, 16 Oct 2024 13:39:01 +0000 (15:39 +0200)] 
Make inline-signing default value change more clear

Emphasize more that the inline-signing default value has changed in
9.20.0.

18 months ago[9.20] chg: ci: Make changelog audience mandatory
Nicki Křížek [Tue, 29 Oct 2024 16:12:35 +0000 (16:12 +0000)] 
[9.20] chg: ci: Make changelog audience mandatory

Backport of MR !9628

Merge branch 'backport-nicki/harazd-enforce-mr-title-audience-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9696

18 months agoMake changelog audience mandatory
Nicki Křížek [Mon, 14 Oct 2024 17:32:39 +0000 (19:32 +0200)] 
Make changelog audience mandatory

Use a stricter hazard check which ensures the audience tag is present in
the MR title and is one of the known values. This prevents siuations
where incorrect audience is accidentally used, resulting in a missing
changelog entry or a release note.

(cherry picked from commit cdb93bcbd45535e304717aca43571a9e2e2d17fc)

19 months ago[9.20] fix: test: Fix CID 510858: Null ptr derefs in check_keys
Matthijs Mekking [Fri, 25 Oct 2024 14:08:04 +0000 (14:08 +0000)] 
[9.20] fix: test: Fix CID 510858: Null ptr derefs in check_keys

Coverity Scan reported a new issue for the ksr system test. There is allegedly a null pointer dereference (FORWARD_NULL) in check_keys().

This popped up because previously we set 'retired' to 0 in case of unlimited lifetime, but we changed it to None.

It is actually a false positive, because if lifetime is unlimited there will be only one key in 'keys'.

However, the code would be better if we always initialized 'active' and if it is not the first key and retired is set, set the successor key's active time to the retire time of the predecessor key.

Closes #5004

Backport of MR !9687

Merge branch 'backport-5004-cid-510858-ksr-check-keys-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9693

19 months agoFix CID 510858: Null ptr derefs in check_keys
Matthijs Mekking [Thu, 24 Oct 2024 12:03:58 +0000 (14:03 +0200)] 
Fix CID 510858: Null ptr derefs in check_keys

Coverity Scan reported a new issue for the ksr system test. There
is allegedly a null pointer dereference (FORWARD_NULL) in check_keys().

This popped up because previously we set 'retired' to 0 in case of
unlimited lifetime, but we changed it to None.

It is actually a false positive, because if lifetime is unlimited
there will be only one key in 'keys'.

However, the code would be better if we always initialized 'active'
and if it is not the first key and retired is set, set the successor
key's active time to the retire time of the predecessor key.

(cherry picked from commit e777efb5767a11b2fa3679b6ea4c6ec4290bd23e)

19 months ago[9.20] fix: test: Fix intermittent ksr test failure
Matthijs Mekking [Fri, 25 Oct 2024 09:25:27 +0000 (09:25 +0000)] 
[9.20] fix: test: Fix intermittent ksr test failure

A test may fail if the key id is shorter than 5 digits. Add a leading space to the expected strings which start with the key tag to avoid the issue.

Closes #5002

Backport of MR !9688

Merge branch 'backport-5002-unexpected-match-ksr-twotwone-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9692

19 months agoFix intermittent ksr test failure
Matthijs Mekking [Thu, 24 Oct 2024 12:30:51 +0000 (14:30 +0200)] 
Fix intermittent ksr test failure

The test_ksr_twotwone may fail if the key id is shorter than 5 digits.
Add a leading space to the expected strings which start with the key
tag to avoid the issue.

(cherry picked from commit d5f32f6990b6f33405e5ca33ffbbc3912f852e3f)

19 months ago[9.20] fix: test: Make system tests compatible with pytest 8.0.0+
Nicki Křížek [Thu, 24 Oct 2024 12:28:25 +0000 (12:28 +0000)] 
[9.20] fix: test: Make system tests compatible with pytest 8.0.0+

Make system tests symlinks and logged test names consistent across pytest versions.

Backport of MR !9071

Merge branch 'backport-nicki/pytest-v8-compat-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9685

19 months agoAdd legacy.run.sh to .gitignore
Nicki Křížek [Mon, 27 May 2024 14:24:35 +0000 (16:24 +0200)] 
Add legacy.run.sh to .gitignore

While this file is no longer created / used in the main branch, it may
linger around when switching from maintenance branches.

(cherry picked from commit 6262d002bf7d27d2b84681e76fed2bac9344451b)

19 months agoMake system tests compatible with pytest 8.0.0+
Nicki Křížek [Mon, 27 May 2024 14:10:04 +0000 (16:10 +0200)] 
Make system tests compatible with pytest 8.0.0+

The pytest collection mechanism has been overhauled in pytest 8.0.0,
resulting in a different node tree when collecting the tests. Ensure the
paths / names we're using that are derived from the node tree are
consistent across different pytest versions.

Particularly, this has affected the convenience symlink name (which is
supposed to be in the form of e.g. dns64_sh_dns64 for the dns64 module
and tests_sh_dns64.py module) and the test name that's logged at the
start of the test, which is supposed to include the system test
directory relative to the root system test directory as well as the
module name (e.g. dns64/tests_sh_dns64.py).

Related https://github.com/pytest-dev/pytest/issues/7777

(cherry picked from commit 7118cbed984108ba22bd2de4b86ccf4abc9a558d)

19 months ago[9.20] fix: usr: Use TLS for notifies if configured to do so
Mark Andrews [Thu, 24 Oct 2024 06:01:40 +0000 (06:01 +0000)] 
[9.20] fix: usr: Use TLS for notifies if configured to do so

Notifies configured to use TLS will now be sent over TLS, instead of plaintext UDP or TCP.
Also, failing to load the TLS configuration for notify now also results in an error.

Closes #4821

Backport of MR !9407

Merge branch 'backport-4821-notify-over-tls-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9684

19 months agoUse correct certificates for TLS notify tests
Timo Eisenmann [Wed, 18 Sep 2024 17:40:30 +0000 (19:40 +0200)] 
Use correct certificates for TLS notify tests

Use tls-forward-secrecy instead of tls-expired for tls-x2 and regenerate
the expired certificate for tls-x6 to reflect the swap of ns2 and ns3.

(cherry picked from commit bbdc6b26aa93677cd895dc813b873621e987d40a)

19 months agoswap ns2 and ns3 rolls in tls notify tests
Mark Andrews [Wed, 18 Sep 2024 05:52:42 +0000 (15:52 +1000)] 
swap ns2 and ns3 rolls in tls notify tests

Still need to regenerate the expired certificate as it has
the wrong IP address

(cherry picked from commit 87e287c9844cea3c2667246e5f8f23bbf4b7c330)

19 months agoAdd system tests for notify over TLS
Timo Eisenmann [Thu, 29 Aug 2024 13:44:40 +0000 (15:44 +0200)] 
Add system tests for notify over TLS

We use ns2 as the primary, and ns3 as the secondary server.

(cherry picked from commit e00beca8c5ad8c6aaa144fb30bd6b5b023ee830a)

19 months agoUse TLS for notifies if configured to do so
Timo Eisenmann [Thu, 22 Aug 2024 14:58:18 +0000 (16:58 +0200)] 
Use TLS for notifies if configured to do so

(cherry picked from commit e9d54d798fa6f58d7a814a77d3ae749901966b23)

19 months ago[9.20] fix: dev: Transport needs to be a selector when looking for an existing dispatch
Mark Andrews [Thu, 24 Oct 2024 01:57:28 +0000 (01:57 +0000)] 
[9.20] fix: dev: Transport needs to be a selector when looking for an existing dispatch

This allows for dispatch to use existing TCP/HTTPS/TLS etc. streams without accidentally using an unexpected transport.

Closes #4989

Backport of MR !9633

Merge branch 'backport-4989-fix-transport-use-with-dispatch-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9682

19 months agoFix TCP dispatches and transport
Mark Andrews [Tue, 15 Oct 2024 05:09:48 +0000 (16:09 +1100)] 
Fix TCP dispatches and transport

Dispatch needs to know the transport that is being used over the
TCP connection to correctly allow for it to be reused.  Add a
transport parameter to dns_dispatch_createtcp and dns_dispatch_gettcp
and use it when selecting a TCP socket for reuse.

(cherry picked from commit baab8a5d759e03a048bd1e71e12491026a3fb8ab)

19 months ago[9.20] fix: test: Use UTC timezone when handling keys in kasp test library
Nicki Křížek [Tue, 22 Oct 2024 11:23:03 +0000 (11:23 +0000)] 
[9.20] fix: test: Use UTC timezone when handling keys in kasp test library

When working with key timestamps, ensure we correctly set the UTC
timezone in order for the tests to work consistently regardless of the
local time setting.

Closes #4999

Backport of MR !9673

Merge branch 'backport-4999-pytest-kasp-use-utc-timezone-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9679

19 months agoSet TZ to Australia/Sydney for bookworm CI job
Nicki Křížek [Mon, 21 Oct 2024 10:18:43 +0000 (12:18 +0200)] 
Set TZ to Australia/Sydney for bookworm CI job

Use a different timezone via the TZ variable in at least one of the
system test jobs in order to detect possible issues with timezone
handling in python.

(cherry picked from commit 46810be809aa2ffc7ee7f305f10f29c5b9121423)

19 months agoUse UTC timezone when handling keys in kasp test library
Nicki Křížek [Mon, 21 Oct 2024 10:08:52 +0000 (12:08 +0200)] 
Use UTC timezone when handling keys in kasp test library

When working with key timestamps, ensure we correctly set the UTC
timezone in order for the tests to work consistently regardless of the
local time setting.

(cherry picked from commit f840deba33f0b719fed0c9b6ad33a2a181406b38)

19 months ago[9.20] chg: test: Disable too-many/too-few pylint checks
Nicki Křížek [Tue, 22 Oct 2024 08:45:52 +0000 (08:45 +0000)] 
[9.20] chg: test: Disable too-many/too-few pylint checks

Backport of MR !9626

Merge branch 'backport-nicki/pylint-disable-too-few-too-many-checks-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9656

19 months agoDisable too-many/too-few pylint checks
Nicki Křížek [Mon, 14 Oct 2024 12:44:06 +0000 (14:44 +0200)] 
Disable too-many/too-few pylint checks

Enforcing pylint standards and default for our test code seems
counter-productive. Since most of the newly added code are tests or is
test-related, encountering these checks rarely make us refactor the code
in other ways and we just disable these checks individually. Code that
is too complex or convoluted will be pointed out in reviews anyways.

(cherry picked from commit 7639c58c4889003777e5da36567f84caa424f157)

19 months ago[9.20] chg: test: Rewrite ksr system test to pytest
Matthijs Mekking [Tue, 22 Oct 2024 07:00:12 +0000 (07:00 +0000)] 
[9.20] chg: test: Rewrite ksr system test to pytest

Backport of MR !9445

Merge branch 'backport-matthijs-pytest-rewrite-ksr-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9648

19 months agoRetry dnssec-verify in kasp test code
Matthijs Mekking [Tue, 15 Oct 2024 08:43:41 +0000 (10:43 +0200)] 
Retry dnssec-verify in kasp test code

It is possible that the zone is not yet fully signed because it is
signed in batches. Retry the AXFR and verify command a couple of times.

(cherry picked from commit b8b3df0676dedbca6e94340825a173ed1764f5b5)

19 months agoAddress pylint issues
Nicki Křížek [Mon, 14 Oct 2024 12:49:38 +0000 (14:49 +0200)] 
Address pylint issues

(cherry picked from commit 3c6124a0933d95e154ded274cea6fbef5ac60cc8)

19 months agoUse difflib rather than diff cmd
Nicki Křížek [Tue, 8 Oct 2024 13:02:37 +0000 (15:02 +0200)] 
Use difflib rather than diff cmd

(cherry picked from commit b7207fa3e737fc364469179d6ced8e13d54010e0)

19 months agoMove algorithm defaults to check_keys()
Nicki Křížek [Tue, 8 Oct 2024 12:33:37 +0000 (14:33 +0200)] 
Move algorithm defaults to check_keys()

(cherry picked from commit c9ecd2a618dbae1b6234f5a76368a06a238a13eb)

19 months agoUse f-strings
Nicki Křížek [Tue, 8 Oct 2024 12:12:10 +0000 (14:12 +0200)] 
Use f-strings

(cherry picked from commit 55ec9f94bc04eb76090528d939b798048fd7aa70)

19 months agoSimplify command invocation
Nicki Křížek [Tue, 8 Oct 2024 12:11:56 +0000 (14:11 +0200)] 
Simplify command invocation

(cherry picked from commit 732a959d9a1e392f32c7365ecf270ea08f585eee)

19 months agoRemove unused isctest/kasp code
Nicki Křížek [Tue, 8 Oct 2024 12:10:50 +0000 (14:10 +0200)] 
Remove unused isctest/kasp code

(cherry picked from commit b5633462bfe7fc1e5e684680bb33fed5e8267d6d)

19 months agoRename kasp function to check_*
Nicki Křížek [Tue, 8 Oct 2024 12:09:05 +0000 (14:09 +0200)] 
Rename kasp function to check_*

If a function is expected to assert / raise on failure (rather than
return boolean), its name should start with "check_".

(cherry picked from commit 67957d1f54e01bc3066effc0fa5b6486efb66178)

19 months agoUse convenience wrappers for kasp key operations
Nicki Křížek [Mon, 7 Oct 2024 16:08:02 +0000 (18:08 +0200)] 
Use convenience wrappers for kasp key operations

(cherry picked from commit 2b0a8fcfb5084b23477f1c66b9f32445422a4461)

19 months agoConvert ksr system test to pytest
Matthijs Mekking [Mon, 2 Sep 2024 15:36:47 +0000 (17:36 +0200)] 
Convert ksr system test to pytest

Move all test cases from tests.sh to tests_ksr.py. The only test that
is not moved is the check that key id's match expected keys. The
shell-based system test checks two earlier set environment variables
against each other that has become redundant in the pytest variant,
because we now check the signed key response against a list of keys
and for each key we take into account the timing metadata. So we
already ensure that each published key is in the correct key bundle.

(cherry picked from commit a15bf6704beddc7ef18609094e8f5c7505b3e3e2)

19 months agoIntroduce pytest kasp library
Matthijs Mekking [Mon, 2 Sep 2024 15:51:32 +0000 (17:51 +0200)] 
Introduce pytest kasp library

Write initial pytest kasp library. This contains everything that is
required for testing Offline KSK functionality with pytest.

This includes:
- addtime: adding a value to a timing metadata
- get_timing_metdata: retrieve timing metadata from keyfile
- get_metadata/get_keystate: retrieve metadata from statefile
- get_keytag: retrieve keytag from base keyfile string
- get_keyrole: get key role from statefile
- dnskey_equals: compare DNSKEY record from file against a string
- cds_equals: compare CDS derived from file against a string
- zone_is_signed: wait until a zone is completely signed
- dnssec_verify: verify a DNSSEC signed zone with dnssec-verify
- check_dnssecstatus: check rndc dnssec -status output
- check_signatures: check that signatures for a given RRset are correct
- check_dnskeys: check that the published DNSKEY RRset is correct
- check_cds: check that the published CDS RRset is correct
- check_apex: check SOA, DNSKEY, CDNSKEY, and CDS RRset
- check_subdomain: check an RRset below the apex

(cherry picked from commit a3829990fdb67b646f41ef69d2d4ab3b5debbc24)

19 months agoChange dnssec-ksr key sorting
Matthijs Mekking [Mon, 2 Sep 2024 15:48:22 +0000 (17:48 +0200)] 
Change dnssec-ksr key sorting

Sort keys on algorithm, then keytag. This is more convenient for
testing.

(cherry picked from commit ea1fc5c47b1e242eaa43483a00bbb5922c4ad2d3)

19 months ago[9.20] fix: usr: Parsing of hostnames in rndc.conf was broken
Mark Andrews [Tue, 22 Oct 2024 01:14:07 +0000 (01:14 +0000)] 
[9.20] fix: usr:  Parsing of hostnames in rndc.conf was broken

When DSCP support was removed, parsing of hostnames in rndc.conf was accidentally broken, resulting in an assertion failure.  This has been fixed.

Closes #4991

Backport of MR !9669

Merge branch 'backport-4991-rndc-fix-parsing-hostnames-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9676

19 months agoAdd regression test for [GL #4991]
Mark Andrews [Mon, 21 Oct 2024 00:43:29 +0000 (11:43 +1100)] 
Add regression test for [GL #4991]

(cherry picked from commit 5a78f6b21b26b7c68dc5e38ff10f527ddfc841e9)

19 months agoFix parsing of hostnames in rndc.conf
Mark Andrews [Mon, 21 Oct 2024 00:34:32 +0000 (11:34 +1100)] 
Fix parsing of hostnames in rndc.conf

When DSCP was removed the parsing of hostnames was accidentally
broken resulting in an assertion failure.  Call cfg_parse_tuple
rather than using custom code in parse_sockaddrnameport.

(cherry picked from commit 6c095f89f5ac22bb67e9ef6d67b75d77234fea45)

19 months ago[9.20] chg: test: Rewrite verify system test to pytest
Michal Nowak [Mon, 21 Oct 2024 12:58:32 +0000 (12:58 +0000)] 
[9.20] chg: test: Rewrite verify system test to pytest

Backport of MR !9249

Merge branch 'backport-mnowak/pytest_rewrite_verify-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9674

19 months agoRewrite verify system test to pytest
Michal Nowak [Thu, 1 Aug 2024 19:35:29 +0000 (21:35 +0200)] 
Rewrite verify system test to pytest

(cherry picked from commit 091968f5fa6e3226792bee19c0979444dd9dba39)

19 months ago[9.20] chg: test: xfail upforwd system test if DNSTAP is enabled
Michal Nowak [Mon, 21 Oct 2024 11:46:57 +0000 (11:46 +0000)] 
[9.20] chg: test: xfail upforwd system test if DNSTAP is enabled

See isc-projects/bind9#4996

Backport of MR !9662

Merge branch 'backport-mnowak/mark-upforwd-xfail-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9672

19 months agoxfail upforwd system test if DNSTAP is enabled
Michal Nowak [Thu, 17 Oct 2024 12:26:57 +0000 (14:26 +0200)] 
xfail upforwd system test if DNSTAP is enabled

(cherry picked from commit 0579e0a4299d7d238997486c52c3e3c97ebd977d)

19 months agoAdd with_dnstap mark
Michal Nowak [Thu, 17 Oct 2024 12:26:32 +0000 (14:26 +0200)] 
Add with_dnstap mark

(cherry picked from commit a8b70abca177cb41875fe53f5c50d4b2afad6b02)

19 months ago[9.20] fix: doc: All footnotes need to have unique name and be referenced
Michal Nowak [Mon, 21 Oct 2024 07:41:36 +0000 (07:41 +0000)] 
[9.20] fix: doc: All footnotes need to have unique name and be referenced

With Sphinx 8.1.0, footnotes can't stand on their own and have to be
referenced from somewhere, otherwise build fails, e.g.:

    doc/dnssec-guide/signing.rst:1470: WARNING: Footnote [#] is not referenced. [ref.footnote]

Backport of MR !9663

Merge branch 'backport-mnowak/fix-dnssec-guide-footnote-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9670

19 months agoAll footnotes need to have unique name and be referenced
Michal Nowak [Thu, 17 Oct 2024 17:49:17 +0000 (19:49 +0200)] 
All footnotes need to have unique name and be referenced

With Sphinx 8.1.0, footnotes can't stand on their own and have to be
referenced from somewhere, otherwise build fails, e.g.:

    doc/dnssec-guide/signing.rst:1470: WARNING: Footnote [#] is not referenced. [ref.footnote]

(cherry picked from commit bdf8859e2de21ab8c95acbe298b6b988b05dd497)

19 months agofix: nil: corrected code style errors
Evan Hunt [Fri, 18 Oct 2024 19:32:22 +0000 (19:32 +0000)] 
fix: nil: corrected code style errors

- add missing brackets around one-line statements
- add paretheses around return values

Merge branch 'each-style-corrections-bind-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9665

19 months agocorrected code style errors
Evan Hunt [Thu, 17 Oct 2024 20:27:32 +0000 (13:27 -0700)] 
corrected code style errors

- add missing brackets around one-line statements
- add paretheses around return values

19 months ago[9.20] fix: usr: Restore values when dig prints command line
Mark Andrews [Fri, 18 Oct 2024 03:55:26 +0000 (03:55 +0000)] 
[9.20] fix: usr:  Restore values when dig prints command line

Options of the form `[+-]option=<value>` failed to display the value on the printed command line. This has been fixed.

Closes #4993

Backport of MR !9653

Merge branch 'backport-4993-dig-restore-command-line-values-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9666

19 months agoCorrectly get final token
Mark Andrews [Thu, 17 Oct 2024 01:31:25 +0000 (12:31 +1100)] 
Correctly get final token

(cherry picked from commit df5b4ba894589d4a36c173b7a3be7ecc322ff0f9)

19 months agoRestore seperator values
Mark Andrews [Thu, 17 Oct 2024 01:03:22 +0000 (12:03 +1100)] 
Restore seperator values

strtok_r is destructive.  Restore the seperators so that the command
line can be properly displayed.

(cherry picked from commit 609d96aa1283c362e5c03a157e747d218c70aa17)

19 months ago[9.20] fix: usr: 'Recursive-clients 0;' triggers an assertion
Mark Andrews [Thu, 17 Oct 2024 22:47:36 +0000 (22:47 +0000)] 
[9.20] fix: usr: 'Recursive-clients 0;' triggers an assertion

BIND 9.20.0 broke `recursive-clients 0;`.  This has now been fixed.

Closes #4987

Backport of MR !9621

Merge branch 'backport-4987-fix-recursive-clients-0-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9654