Commit graph

44859 commits

Author SHA1 Message Date
Aydın Mercan
35eeefb437
initial openssl version splitting
Dealing with OpenSSL has been rapidly turning into an unwieldy situation
as post-3.0 changes turn the library into a different beast.

Start treating pre and post-3.0 versions differently for easier
maintenance.
2026-02-02 11:12:53 +03:00
Colin Vidal
8dfa96b91b chg: dev: dns_rdataset_clone() and dns_rdataset_isassociated() const parameters
`dns_rdataset_clone()` takes now a const source rdataset. Also,
`dns_rdataset_isassociated()` also takes a const rdataset.

Merge branch 'colin/rdataset-const' into 'main'

See merge request isc-projects/bind9!11462
2026-01-30 20:28:39 +01:00
Colin Vidal
d0d4b40b62 dns_rdataset_* const parameters
dns_rdataset_clone() now have a const source rdataset. Also,
dns_rdataset_isassociated() also takes a const rdataset.
2026-01-30 19:33:42 +01:00
Ondřej Surý
40bffcc8a6 chg: usr: Enable minimal ANY answers by default
ANY queries are widely abused by attackers doing reflection attacks as
they return the largest answers.  Enable minimal ANY answers by default
to reduce the attack surface of the DNS servers.

Closes #5723

Merge branch '5723-change-minimal_any-default-to-yes' into 'main'

See merge request isc-projects/bind9!11505
2026-01-29 04:29:45 +01:00
Ondřej Surý
0bebf8ee9d
Enable minimal ANY answers by default
ANY queries are widely abused by attackers doing reflection attacks as
they return the largest answers.  Enable minimal ANY answers by default
to reduce the attack surface of the DNS servers.
2026-01-28 15:38:18 +01:00
Mark Andrews
6c1bc49ec7 fix: test: ISC_RUN_TEST_IMPL should use a static declaration
These functions don't need to be called from multiple places and
by making them static we will detect when they are not added to the
list functions to be tested.

Closes #5715

Merge branch '5715-isc_run_test_impl-should-use-a-static-declaration' into 'main'

See merge request isc-projects/bind9!11480
2026-01-28 21:23:48 +11:00
Mark Andrews
22d664aa15 ISC_RUN_TEST_IMPL should use a static declaration
These functions don't need to be called from multiple places and
by making them static we will detect when they are not added to the
list functions to be tested.
2026-01-28 07:26:04 +11:00
Mark Andrews
7e39596d57 chg: dev: Use enum rather than numbers for isc_base64_tobuffer and isc_hex_tobuffer
Use isc_one_or_more and isc_zero_or_more rather than (-2) and
(-1) when calling isc_base64_tobuffer. Similarly for
isc_hex_tobuffer. This should help reduce the probability
that the wrong number is used and it makes the intent clearer.

Closes #5713

Merge branch '5713-use-macros-with-isc_base64_tobuffer-and-isc_hex_tobuffer' into 'main'

See merge request isc-projects/bind9!11479
2026-01-28 07:22:59 +11:00
Mark Andrews
d92369cc8f Add spatch for isc_one_or_more and isc_zero_or_more 2026-01-28 00:25:04 +11:00
Mark Andrews
5843289550 Use isc__zero_or_more when calling isc_base64_tobuffer 2026-01-28 00:25:04 +11:00
Mark Andrews
62fd89d4a1 Use isc_one_or_more when calling isc_base64_tobuffer 2026-01-28 00:25:04 +11:00
Mark Andrews
7feb0f5b53 Use isc_one_or_more when calling isc_hex_tobuffer 2026-01-27 23:57:34 +11:00
Mark Andrews
07610f8566 Add enum for use with isc_base64_tobuffer and isc_hex_tobuffer
This adds the following enum isc_one_or_more and isc_zero_or_more
which specify if one or more or zeror or more bytes are required
when reading the unbounded base64 / hex encoded data.
2026-01-27 23:57:34 +11:00
Arаm Sаrgsyаn
fd568032ac fix: usr: Fix a possible issue with reponse policy zones and catalog zones
If a response policy zone (RPZ) or a catalog zone contained an
`$INCLUDE` directive, then manually reloading that zone could
fail to process the changes in the response policy or in the
catalog, respectively. This has been fixed.

Closes #5714

Merge branch '5714-zone_loaddone-rpz-and-catz-bugfix' into 'main'

See merge request isc-projects/bind9!11489
2026-01-27 11:32:07 +00:00
Aram Sargsyan
d81a2457d6 Add a new check in the RPZ system test
Check that reloading a response policy zone which has an '$INCLUDE'
directive defined is working as expected.
2026-01-27 11:31:15 +00:00
Aram Sargsyan
31290eccb1 Fix a bug in zone_loaddone()
The zone_loaddone() function disables database notifications for
a catalog zones and response policy zones (RPZ) when loading had
failed. Howerer, the 'result != ISC_R_SUCCESS' check is insufficient,
because the DNS_R_SEENINCLUDE result also indicates success.

Add a second condition for the "if" block.
2026-01-27 11:31:15 +00:00
Nicki Křížek
f81e90e3e1 fix: test: Resolve the system_test_dir in pytest
If the system_test_dir contains a symlink, then it might cause issues
further down when using relative_to(), unless it is resolved first. This
has been observed on FreeBSD13 in CI where /home is a symlink to
/usr/home.

Merge branch 'nicki/pytest-freebsd13-artifacts-path' into 'main'

See merge request isc-projects/bind9!11490
2026-01-27 11:46:55 +01:00
Nicki Křížek
b1e3469059 Resolve the system_test_dir in pytest
If the system_test_dir contains a symlink, then it might cause issues
further down when using relative_to(), unless it is resolved first. This
has been observed on FreeBSD13 in CI where /home is a symlink to
/usr/home.
2026-01-27 11:05:18 +01:00
Mark Andrews
4195821686 fix: usr: Fix brid and hhit implementation
Fix bugs in BRID and HHIT implementation and enable
the unit tests.

Closes #5710

Merge branch '5710-fix-hhit-and-brid-issues' into 'main'

See merge request isc-projects/bind9!11491
2026-01-27 16:45:55 +11:00
Mark Andrews
97af8fc519 Fix brid and hhit unit tests
These tests were not being run.
2026-01-27 16:05:29 +11:00
Mark Andrews
10366e4f4e Remove extraneous space at start of brid and hhit records 2026-01-27 16:05:29 +11:00
Mark Andrews
bdb9c838a8 Fix isc_base64_tobuffer call for brid and hhit
Zero length records were not being rejected.
2026-01-27 16:05:24 +11:00
Nicki Křížek
0d3b369c6b fix: test: Fix a race condition in dnssec test
When dumpdb command is executed, it might take a while until the file is
written. Rather than checking the file once, use the WatchLog mechanism
to allow the desired line to appear before a timeout happens.

This affected test_validation_recovery and test_cache tests which have
been intermittently failing on EL8 in our CI.

Merge branch 'nicki/fix-dnssec-test-dumpdb-race' into 'main'

See merge request isc-projects/bind9!11487
2026-01-26 13:10:25 +01:00
Nicki Křížek
6eb2088320 Fix a race condition in dnssec test
When dumpdb command is executed, it might take a while until the file is
written. Rather than checking the file once, use the WatchLog mechanism
to allow the desired line to appear before a timeout happens.

This affected test_validation_recovery and test_cache tests which have
been intermittently failing on EL8 in our CI.
2026-01-26 10:45:34 +01:00
Štěpán Balážik
11e6d1c0b9 chg: test: Use isctest.asyncserver in the "resolver" system test
Depends on !11403, !11419

Merge branch 'stepan/resolver-asyncserver' into 'main'

See merge request isc-projects/bind9!11411
2026-01-24 15:23:35 +00:00
Štěpán Balážik
c336c1feab Fix bugs in 'resolver/ans2' and 'resolver/ans3'
There were multiple typos and omissions regarding query minimization.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
cef851740b Reimplement 'resolver/ans10' server using AsyncDnsServer
Ensure packet-for-packet compatibility with the old server.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
8f2526a27d Reimplement 'resolver/ans8' server using AsyncDnsServer
Ensure packet-for-packet compatibility with the old server.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
5004d278e4 Reimplement 'resolver/ans3' server using AsyncDnsServer
Ensure packet-for-packet compatibility with the old server including
bugs.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
d203a39314 Reimplement 'resolver/ans2' server using AsyncDnsServer
Ensure packet-for-packet compatibility with the old server including
bugs.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
23d9055617 Add common parts of resolver test custom servers
These will be shared by all the ans*/ans.py files.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
eba89fd38b Add StaticResponseHandler to isctest.asyncserver
It is used to prepare and yield one DNS response and avoid the
`get_responses` boiler-plate.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
8a45f5b485 Add QnameQtypeHandler for matching QNAME, QTYPE pairs
This is a pattern in the resolver system test and also elsewhere.
2026-01-24 13:04:09 +01:00
Štěpán Balážik
7d5ec7167b Delete unused ResponseHandlers from statistics ans server
Turns out the original ans.pl implementation before (!10928) was a copy
of an old version of the ans2 server from the resolver system test.

I reimplemented it fully, even though only two ResponseHandlers are
actually used in the statistics test.
2026-01-23 16:39:00 +01:00
Štěpán Balážik
b89cc2bd86 Store the most specific matched domain in DomainHandler
Store the most specific matching domain in DomainHandler and
expose it through the `matched_domain` property for subclasses
to use in their implementations of `get_responses`.
2026-01-23 16:39:00 +01:00
Mark Andrews
7878281048 fix: test: unit test tsig_badsig was not being called
Additionally, the test was badly implemented. This has been fixed.

Closes #5712

Merge branch '5712-unit-test-tsig_badsig-was-not-being-called' into 'main'

See merge request isc-projects/bind9!11478
2026-01-24 02:27:34 +11:00
Mark Andrews
8da2310511 Fix and call tsig_badsig unit test 2026-01-24 01:25:55 +11:00
Mark Andrews
a20bbb629a fix: usr: DSYNC record incorrectly used two octets for the Scheme Field
When creating the `DSYNC` record from a structure, `uint16_tobuffer` was used instead of `uint8_tobuffer` when adding the scheme, causing a `DSYNC` record that was one octet too long. This has been fixed.

Closes #5711

Merge branch '5711-dsync_fromstruct-produces-an-invalid-record' into 'main'

See merge request isc-projects/bind9!11477
2026-01-24 01:24:04 +11:00
Mark Andrews
2159f74a1f Fix dsync unit test
The dsync unit test was not being run and the domain names in
the test data should have been fully qualified.
2026-01-24 00:38:51 +11:00
Mark Andrews
3180e50459 dsync_from struct produced an invalid record
uint16_tobuffer was used instead of uint8_tobuffer when adding the
scheme to the buffer.  This produced a record that was one octet
too long.  This has been fixed.
2026-01-24 00:38:51 +11:00
Matthijs Mekking
dd8651ff36 chg: usr: Lowercase the NSEC next owner name when signing
When building the NSEC rdata, lowercase the next owner name before
storing it in the Next Domain Name Field.

Note that this is not required according to RFC 6840, but since there
is inconsistency in the documents over time, having uppercase next
owner names in the NSEC records may cause validation failures if
validators are not following RFC 6840.

Closes #5702

Merge branch '5702-lowercase-nsec-next-owner-name' into 'main'

See merge request isc-projects/bind9!11442
2026-01-23 12:46:51 +00:00
Matthijs Mekking
bcb65f52f2 Add kasp test zone with uppercase characters
The test ensures that such zone is signed correctly.  In addition, test
that the next owner name field of the NSEC record is lowercased.
2026-01-23 11:52:59 +00:00
Matthijs Mekking
24aa490a9b Lower case the NSEC next owner name when signing
When building the NSEC rdata, lower case the next owner name before
storing it in the Next Domain Name Field.

Note that this is not required according to RFC 6840, Section 5.1:

  When canonicalizing DNS names (for both ordering and signing), DNS
  names in the RDATA section of NSEC resource records are not converted
  to lowercase.  DNS names in the RDATA section of RRSIG resource
  records are converted to lowercase.

  The guidance in the above paragraph differs from what has been
  published before but is consistent with current common practice.
  Item 3 of Section 6.2 of [RFC4034] says that names in both of these
  RR types should be converted to lowercase.  The earlier [RFC3755]
  says that they should not.

Since there is inconsistency in the documents over time, having
uppercase next owner names in the NSEC records may cause validation
failures if validators are not implementing RFC 6840.

Also, RFC 4034 section 6.2 is not about how NSEC record content is
created, but how RRset content is normalized in order to produce and
validate RRSIG records for a given RRset. Since the next owner name
of the NSEC record is about ordening, and the canonical DNS name order
requires that uppercase US-ASCII letters must be treated as if they
were lowercase US-ASCII letters, case is not meaningful for NSEC
next owner names, as it cannot be compressed on the wire, so we may
lowercase the next owner name in the NSEC rdata before signing, being
more kind to validators.
2026-01-23 11:52:59 +00:00
Andoni Duarte
a30fc2ded6 chg: ci: Use a small always-on runner for lightweight CI jobs
Some CI jobs spend more time pulling the docker image and setting up their environment than running the script. This MR adds a tag `smalljob` to jobs considered lightweight in order to run them on a dedicated small VM.

Merge branch 'andoni/try-small-vm-for-lightweight-ci-jobs' into 'main'

See merge request isc-projects/bind9!11266
2026-01-23 11:33:53 +00:00
Andoni Duarte Pintado
e9f2b7944e Add smalljob tag to small jobs not in the quick-checks stage
Jobs using the "post_merge" and "manual_release_job_qa" anchors also
complete in less than a minute, so they now include the "smalljob" tag.

Since the "release" job is also a fast one, but without an anchor, the
"smalljob" tag is added to its definition.
2026-01-23 11:57:40 +01:00
Andoni Duarte Pintado
66175b448c De-duplicate yaml for "other-checks" jobs
In .gitlab-ci.yml, since "&other_checks_job" has "needs: []", remove
that line from the jobs that use that anchor.
2026-01-23 11:57:40 +01:00
Andoni Duarte Pintado
432b7d7954 Move "needs: []" to the "quick_checks_job" anchor
Most jobs in this stage have it by default, so it makes sense to
add it to their common anchor. Jobs with different "needs:" will
override it.
2026-01-23 11:57:40 +01:00
Andoni Duarte Pintado
b3ac6b47d9 Group CI jobs in "quick-checks" stage together
Move the jobs in the "quick-checks" stage to the same place in
.gitlab-ci.yml.
2026-01-23 11:57:40 +01:00
Andoni Duarte Pintado
ae76829157 Add faster CI jobs to the "quick-checks" stage
Given the short runtime (<1min) of the "linkcheck" and
"generate-tsan-stress-test-configs" CI jobs, move them to the
"quick-checks" stage.
2026-01-23 11:57:40 +01:00
Andoni Duarte Pintado
4f89d32bff Move CI stage "other-checks" right after "quick-checks"
Move CI stage "other-checks" right after "quick-checks" and get the jobs
in it as close to each other as possible in .gitlab-ci.yml.

Since no job is allowed to depend (via "needs") on any job that is
assigned to a stage later than its own, move the "tsan:stress" and
"gcov" jobs to the "system" stage.
2026-01-23 11:57:40 +01:00