2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

43778 Commits

Author SHA1 Message Date
Michal Nowak
754ef7152a chg: doc: Update Sphinx to 8.2.3
Update Sphinx to its current version pulled in by "pip install
sphinx-rtd-theme" run in a fresh Debian "bookworm" container.

Merge branch 'mnowak/update-sphinx-to-8.2.3' into 'main'

See merge request isc-projects/bind9!10603
2025-06-19 13:30:37 +00:00
Michal Nowak
e6234542e2
Update Sphinx to 8.2.3
Update Sphinx to its current version pulled in by "pip install
sphinx-rtd-theme" run in a fresh Debian "bookworm" container.
2025-06-19 15:22:02 +02:00
Nicki Křížek
f58964dc9d chg: test: Improve logging from isctest.run.retry_with_timeout
Allow use of exception (and by extension, assert statements) in the
called function in order to extract essential debug information about
the type of failure that was encountered.

In case the called function fails to succeed on the last retry and
raised an exception, log it as error and set it as the assert message to
propagate it through the pytest framework.

Closes #5324

Merge branch '5324-pytest-isctest-run-logging' into 'main'

See merge request isc-projects/bind9!10580
2025-06-19 13:05:56 +00:00
Nicki Křížek
069e4ef0f7 Use time.monotonic() for time measumeremts in pytest
For duration measurements, i.e. deadlines and timeouts, it's more
suitable to use monotonic time as it's guaranteed to only go forward,
unlike time.time() which can be affected by local clock settings.
2025-06-19 14:11:28 +02:00
Nicki Křížek
481b46ffcc Move param to isctest.util 2025-06-19 14:11:28 +02:00
Nicki Křížek
620c884133 Improve logging from isctest.run.retry_with_timeout
Allow use of exception (and by extension, assert statements) in the
called function in order to extract essential debug information about
the type of failure that was encountered.

In case the called function fails to succeed on the last retry and
raised an exception, log it as error and set it as the assert message to
propagate it through the pytest framework.
2025-06-19 14:11:27 +02:00
Michal Nowak
ce090c1bd2 BIND 9.21.9
-----BEGIN SSH SIGNATURE-----
 U1NIU0lHAAAAAQAAARcAAAAHc3NoLXJzYQAAAAMBAAEAAAEBANamVSTMToLcHCXRu1f52e
 tTJWV3T1GSVrPYXwAGe6EVC7m9CTl06FZ9ZG/ymn1S1++dk4ByVZXf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ydiVSCsc9XjB+tWtIGUpQsfaXqZ7Hs6t+1f1vsnu88oJ
 oi1dRBo3YNRl49UiCukXWayQrPJa8wwxURS9W28JMAAAADZ2l0AAAAAAAAAAZzaGE1MTIA
 AAEUAAAADHJzYS1zaGEyLTUxMgAAAQDDixAWV/o5tDUge27FQsBWfED9HueToMVBQ/jGez
 j+jHw/Cla5HfA3keNs1xqvY4Oodw5bIsfGeja/JjfKkd0du+n4SLa5jsGhIzINBrfxZMMt
 j+caGVOE4qZKofkzRXoBPmkQz1mlW9KvHNM/IfKs4ZWOX5u09Xhd+LX1Jp3Teh+W3s+0Om
 7i2uoOS9E31rK4z9gia6FAvkdbg487W8RFcxMz3nP2BxeJS9WetOg57Oe/UTtIDBJIuzjf
 GlqqRt8YcZI4Sea+/WNrT2Xsi4ogHFnsShVWNPmmc+9axEmxLWW8Q66wV4GFUd5D1QG3eq
 lSTANlzZycVBDB4eGzwyG4
 -----END SSH SIGNATURE-----

Merge tag 'v9.21.9'

BIND 9.21.9
2025-06-19 12:26:58 +02:00
Matthijs Mekking
29c69d26d9 fix: usr: Fix purge-keys bug when using views
Previously, when a DNSSEC key was purged by one zone view, other zone views would return an error about missing key files. This has been fixed.

Closes #5315

Merge branch '5315-fix-spurious-some-key-files-are-missing' into 'main'

See merge request isc-projects/bind9!10550
2025-06-19 06:52:05 +00:00
Matthijs Mekking
d494698852 Fix spurious missing key files log messages
This happens because old key is purged by one zone view, then the other
is freaking out about it.

Keys that are unused or being purged should not be taken into account
when verifying key files are available.

The keyring is maintained per zone. So in one zone, a key in the
keyring is being purged. The corresponding key file is removed.

The key maintenance is done for the other zone view. The key in that
keyring is not yet set to purge, but its corresponding key file is
removed. This leads to "some keys are missing" log errors.

We should not check the purge variable at this point, but the
current time and purge-keys duration.

This commit fixes this erroneous logic.
2025-06-19 08:13:07 +02:00
Matthijs Mekking
752d8617f5 Test purge-keys with views
Create a test scenario where a signed zone is in multiple views and
then a key may be purged. This is a bug case where the key files are
removed by one view and then the other view starts complaining.
2025-06-19 08:13:07 +02:00
Mark Andrews
119f511a45 new: usr: "Add code paths to fully support PRIVATEDNS and PRIVATEOID keys"
Added support for PRIVATEDNS and PRIVATEOID key usage. Added PRIVATEOID
test algorithms using the assigned OIDs for RSASHA256 and RSASHA512.

Added code to support proposed DS digest types that encode the PRIVATEDNS
and PRIVATEOID identifiers at the start of the digest field of the DS record.
This code is disabled by default.

Closes #3240

Merge branch '3240-add-privatedns-and-privateoid-support' into 'main'

See merge request isc-projects/bind9!10341
2025-06-19 01:01:12 +00:00
Mark Andrews
38ef960fd0 Test extended DS digest type support
Add a zone using DS records that embed the private algorithm
identifier in the digest field.  There are 2 DS record for an
unsupported DNSSEC algorithm one of which that doesn't have a
matching DNSKEY.  This zone should validate as insecure as the
validator can establish that both DS records are for unsupported
DNSSEC algorithms.
2025-06-19 07:15:20 +10:00
Mark Andrews
8d554c0c03 Add tests using PRIVATEOID algorithms
There are 4 tests:

1) a zone using a known private OID.  Validations should succeed
and return AD=1.

2) a zone using an unknown private OID.  Validation should succeed
and return AD=0 as the DS to DNSKEY has provably unsupported
algorithm.

3) a zone using a known private OID and an extra DS record. Validation
should succeed as there is DS to DNSKEY with a known algorithm
linkage.

4) a zone using an unknown private OID and an extra DS record.
Validation should fail as only one of the DS records can be matched
to a provable unknown algorithm.  The algorithm of the second DS
is indeterminate.
2025-06-19 07:15:20 +10:00
Mark Andrews
92393f3c97 Add example PRIVATEDNS algorithm identifiers to DS 2025-06-19 07:15:20 +10:00
Mark Andrews
e687710dc7 Add PRIVATEOIDs for RSASHA256 and RSASHA512
Use the existing RSASHA256 and RSASHA512 implementation to provide
working PRIVATEOID example implementations.  We are using the OID
values normally associated with RSASHA256 (1.2.840.113549.1.1.11)
and RSASHA512 (1.2.840.113549.1.1.13).
2025-06-19 07:15:20 +10:00
Mark Andrews
10d094a289 Future: DS private algorithm support
Add support for proposed DS digest types that encode the private
algorithm identifier at the start of the DS digest as is done for
DNSKEY and RRSIG.  This allows a DS record to identify the specific
DNSSEC algorithm, rather than a set of algorithms, when the algorithm
field is set to PRIVATEDNS or PRIVATEOID.
2025-06-19 07:15:20 +10:00
Mark Andrews
c428af5e7a Support PRIVATEOID/PRIVATEDNS in zone.c
- dns_zone_cdscheck() has been extended to extract the key algorithms
  from DNSKEY data when the CDS algorithm is PRIVATEOID or PRIVATEDNS.

- dns_zone_signwithkey() has been extended to support signing with
  PRIVATEDNS and PRIVATEOID algorithms.  The signing record (type 65534)
  added at the zone apex to indicate the current state of automatic zone
  signing can now contain an additional two-byte field for the DST
  algorithm value, when the DNS secalg value isn't enough information.
2025-06-19 07:15:20 +10:00
Mark Andrews
05c5f79d58 Support PRIVATEOID/PRIVATEDNS in the validator
DS records need to checked against the DNSKEY RRset to find
the private algorithm they correspond to.
2025-06-19 07:00:53 +10:00
Mark Andrews
eb184b864c Support PRIVATEOID/PRIVATEDNS in the resolver
dns_resolver_algorithm_supported() has been extended so in addition to
an algorithm number, it can also take a pointer to an RRSIG signature
field in which key information is encoded.
2025-06-19 07:00:53 +10:00
Mark Andrews
62f3c0b501 Extend the trust anchor supported algorithm checks
When a DNSKEY based trust anchor is used extract the algorithm from
the key's data to determine if the private algorithm is supported.
2025-06-19 07:00:53 +10:00
Mark Andrews
71801ab123 Use DST algorithm values instead of dns_secalg where needed
DST algorithm and DNSSEC algorithm values are not necessarily the same
anymore: if the DNSSEC algorithm value is PRIVATEOID or PRIVATEDNS, then
the DST algorithm will be mapped to something else. The conversion is
now done correctly where necessary.
2025-06-19 07:00:53 +10:00
Mark Andrews
6fe09d85ab Support for DST_ALG_PRIVATEDNS and DST_ALG_PRIVATEOID
The algorithm values PRIVATEDNS and PRIVATEOID are placeholders,
signifying that the actual algorithm identifier is encoded into the
key data. Keys using this mechanism are now supported.

- The algorithm values PRIVATEDNS and PRIVATEOID cannot be used to
  build a key file name; dst_key_buildfilename() will assert if
  they are used.

- The DST key values for private algorithms are higher than 255.
  Since DST_ALG_MAXALG now exceeds 256, algorithm arrays that were
  previously hardcoded to size 256 have been resized.

- New mnemonic/text conversion functions have been added.
  dst_algorithm_{fromtext,totext,format} can handle algorithm
  identifiers encoded in PRIVATEDNS and PRIVATEOID keys, as well
  as the traditional algorithm identifiers. (Note: The existing
  dns_secalg_{fromtext,totext,format} functions are similar, but
  do *not* support PRIVATEDNS and PRIVATEOID. In most cases, the
  new functions have taken the place of the old ones, but in a few
  cases the old version is still appropriate.)

- dns_private{oid,dns}_{fromtext,totext,format} converts between
  DST algorithm values and the mnemonic strings for algorithms
  implemented using PRIVATEDNS or PRIVATEOID. (E.g., "RSASHA256OID").

- dst_algorithm_tosecalg() returns the DNSSEC algorithm identifier
  that applies for a given DST algorithm.  For PRIVATEDNS- or
  PRIVATEOID- based algorithms, the result will be PRIVATEDNS or
  PRIVATEOID, respectively.

- dst_algorithm_fromprivatedns() and dst_algorithm_fromprivateoid()
  return the DST algorithm identifier for an encoded algorithm in
  wire format, represented as in DNS name or an object identifier,
  respectively.

- dst_algorithm_fromdata() is a front-end for the above; it extracts
  the private algorithm identifier encoded at the begining of a
  block of key or signature data, and returns the matching DST
  algorithm number.

- dst_key_fromdns() and dst_key_frombuffer() now work with keys
  that have PRIVATEDNS and PRIVATEOID algorithm identifiers at the
  beginning.
2025-06-19 07:00:53 +10:00
Mark Andrews
e6f1363964 Make system test changes needed for PRIVATEOID/PRIVATEDNS
- When the algorithm value for a DNSSEC key is set to PRIVATEOID
  or PRIVATEDNS, that's a placeholder value indicating that the
  real algorithm identifier is encoded into the key or signature
  data.  That means the DNSKEY algorithm value and the DST algorithm
  value may not be identical, so we must now add environment variables
  DEFAULT_ALGORITHM_DST_NUMBER, ALTERNATIVE_ALGORITHM_DST_NUMBER
  and DISABLED_ALGORITHM_DST_NUMBER to the test suite, with support
  for mapping from DST algorithm value to PRIVATEDNS or PRIVATEOID.

- Some test cases use RRSIGs that have been modified to force
  validation to fail. When making those modifications, we now
  preserve the first part of the signature, so that PRIVATEDNS and
  PRIVATEOID algorithm identifier values will still work.  (This
  assumes that the identifiers are short and fit into the first
  base64 block.)
2025-06-19 07:00:53 +10:00
Mark Andrews
215bde91c6 Check the DS trust anchor algorithm is supported
This make DS based trust anchors consistent with DNSKEY based
trust anchors.
2025-06-19 07:00:53 +10:00
Mark Andrews
9ab4160be6 Add DS digest type code points SM3 and GOST-2012
Provide mapping between mnemonic and value.
2025-06-19 07:00:53 +10:00
Mark Andrews
dfee0e64ed Check that the specified DS digest is supported
dnssec-dsfromkey and dnssec-cds failed to properly check if the
specified DS digest type is supported or not.
2025-06-19 07:00:53 +10:00
Matthijs Mekking
cbb0f165dc chg: test: Rewrite kasp system test to pytest (6)
These test cases involve a reconfig, dnssec policy changes.

Merge branch 'matthijs-pytest-rewrite-kasp-system-test-6' into 'main'

See merge request isc-projects/bind9!10295
2025-06-18 12:20:05 +00:00
Matthijs Mekking
6994a604a7 Remove kasp shell script remainders
Now that all tests have been converted, we can remove 'kasp/tests.sh'
and 'kasp/tests_sh_kasp.py'.
2025-06-18 10:01:24 +02:00
Matthijs Mekking
80992c7b96 Convert algorithm rollover tests to pytest
Roll the algorithm rollover test cases over to the rollover directory
and rewrite using pytest.
2025-06-18 10:01:24 +02:00
Matthijs Mekking
b1d8217d1a Convert going insecure kasp test to pytest
When going insecure, we publish CDS and CDNSKEY DELETE records. Update
the check_apex function to test this.

Also, skip some tests in the 'check_rollover_step()' function. If
we change the DNSSEC Policy, keys that no longer match the policy will
be retired. When this exactly happens is hard to determine, as it
happens on the reconfigure. So for these tests, we skip the key timing
metadata checks.

Also, the zone becomes unsigned, so don't call 'check_zone_is_signed'
in those cases.
2025-06-18 10:01:24 +02:00
Matthijs Mekking
de3c0970eb Convert policy changes tests to pytest
These test cases involve a reconfiguration. The first one is a zone
that changes from dynamic to inline-signing. The others are tests that
key lifetimes are updated correctly after changing them.
2025-06-18 10:01:24 +02:00
Mark Andrews
2b7ae5f067 fix: test: unstable rollover/tests_rollover.py::test_rollover_manual
The state files need to be written before trying to identify zsk/ksk
keys.  Wait for "keymgr: manual-rollover.kasp done" to appear in
named.run first.

Closes #5371

Merge branch '5371-unstable-rollover-tests_rollover-py-test_rollover_manual' into 'main'

See merge request isc-projects/bind9!10587
2025-06-17 07:54:09 +00:00
Mark Andrews
80fedf7fcf unstable rollover/tests_rollover.py::test_rollover_manual
The state files need to be written before trying to identify zsk/ksk
keys.  Wait for "keymgr: manual-rollover.kasp done" to appear in
named.run first.
2025-06-17 14:32:49 +10:00
Mark Andrews
919bce9f0c fix: test: digdelv tests failing on system:gcc:almalinux9:amd64
Closes #5369

Merge branch '5369-digdelv-tests-failing-on-system-gcc-almalinux9-amd64' into 'main'

See merge request isc-projects/bind9!10583
2025-06-15 04:18:32 +00:00
Mark Andrews
4367106d2f Fix "sending packet from" test
The specific address is not always available.
2025-06-14 17:10:15 +10:00
Evan Hunt
6ef16565b4 new: usr: add "named-makejournal" tool
The `named-makejournal` tool reads two zone files for the same domain, compares them, and generates a journal file from the differences.

Closes #5164

Merge branch '5164-makejournal' into 'main'

See merge request isc-projects/bind9!10081
2025-06-14 06:27:09 +00:00
Evan Hunt
27a34fdac1 exercise named-makejournal with multiple transactions
the journal system test now checks that named-makejournal is
able to create journal files with multiple transactions.
2025-06-13 21:20:13 -07:00
Evan Hunt
365e4de077 load the journal file if it already exists
apply the existing journal file, if any, to the old version of the
database before diffing it against the new version. then, append
the diff to the end of the journal. this allows easy creation of
a journal file with multiple deltas, by running named-makejournal
successively.
2025-06-13 21:20:13 -07:00
Evan Hunt
669e304bd1 improvements to named-makejournal
- write the journal to a default location (file1.jnl) if it was not
  specified on the commandline.
- exit with a clear error message if file2's SOA serial number is
  not changed from file1.
2025-06-13 18:16:56 -07:00
Evan Hunt
20fb3d0524 move makejournal to bin/tools
move the "makejournal" tool from bin/tests/system to bin/tools
and rename it to "named-makejournal". add a man page. update
tests to use the new file location.
2025-06-13 18:16:56 -07:00
Mark Andrews
29eaae06e4 fix: dev: Add rdata type header files to dns_header_depfiles macro
The header file dns/rdatastruct.h was not being rebuilt when the
rdata type header files where modified.
    
Removed proforma.c from the list.  It is a starting point for new
types.

Closes #5368

Merge branch '5368-add-rdata-header-files-to-dns_header_depfiles' into 'main'

See merge request isc-projects/bind9!10574
2025-06-13 14:23:08 +00:00
Mark Andrews
cf968a1a58 Add rdata type header files to dns_header_depfiles macro
The header file dns/rdatastruct.h was not being rebuilt when the
rdata type header files where modified.

Removed proforma.c from the list.  It is a starting point for new
types.
2025-06-13 12:49:36 +00:00
Mark Andrews
419ad06023 new: usr: Add support to set and display the CO flag
Add support to display the CO (Compact denial of existence Ok flag) when displaying messages.

Add support to set the CO flag when making queries in dig (+coflag).

Closes #5319

Merge branch '5319-add-support-to-set-and-display-the-co-flag' into 'main'

See merge request isc-projects/bind9!10482
2025-06-13 09:50:06 +00:00
Mark Andrews
bbfb7ebda2 Add "undefined" to +ednsflags description
Reflow help message.
2025-06-13 07:50:16 +00:00
Mark Andrews
c56af212f0 Add tests for 'dig +coflag' 2025-06-13 07:50:16 +00:00
Mark Andrews
6c28411c55 Add CO support to dig
Dig now support setting the EDNS CO as flag using "+coflag" /
"+nocoflag" rather than as part of +ednsflags.
2025-06-13 07:50:16 +00:00
Mark Andrews
519dc5e681 fix: test: nsec3 test updates nsec3-ent.kasp.db too fast
Add a 1 second delay to ensure file time stamp is different
from last load.

Closes #5365

Merge branch '5365-nsec3-test-updates-nsec3-ent-kasp-db-too-fast' into 'main'

See merge request isc-projects/bind9!10570
2025-06-13 07:44:02 +00:00
Mark Andrews
52c29e3ab2 nsec3-ent.kasp.db is updated too fast for rndc reload
ensure a second has elasped before updating the zone file
by adding 'sleep 1' to test.sh
2025-06-13 07:08:51 +00:00
Mark Andrews
a9c2a844f7 fix: test: test_xferquota.py reloads zone file too fast
Add a 1 second delay to ensure file time stamp is different
from last load.

Closes #5366

Merge branch '5366-test_xferquota-py-reloads-zone-file-too-fast' into 'main'

See merge request isc-projects/bind9!10571
2025-06-13 07:08:00 +00:00
Mark Andrews
d8d14cb780 changing.db is updated too fast
ensure a second has elasped before updating the zone file
by adding 'time.sleep(1)' to xferquota/tests_xferquota.py
2025-06-13 06:23:28 +00:00