]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoCHANGES for [GL #4702]
Evan Hunt [Tue, 30 Apr 2024 22:22:03 +0000 (15:22 -0700)] 
CHANGES for [GL #4702]

2 years agohandle QP lookups involving escaped characters better
Evan Hunt [Tue, 30 Apr 2024 21:23:43 +0000 (14:23 -0700)] 
handle QP lookups involving escaped characters better

in QP keys, characters that are not common in DNS names are
encoded as two-octet sequences. this caused a glitch in iterator
positioning when some lookups failed.

consider the case where we're searching for "\009" (represented
in a QP key as {0x03, 0x0c}) and a branch exists for "\000"
(represented as {0x03, 0x03}). we match on the 0x03, and continue
to search down. at the point where we find we have no match,
we need to pop back up to the branch before the 0x03 - which may
be multiple levels up the stack - before we position the iterator.

2 years agoadd another test case for an incorrect QP iterator position
Evan Hunt [Tue, 30 Apr 2024 07:16:45 +0000 (00:16 -0700)] 
add another test case for an incorrect QP iterator position

build a database tree with names containing control characters,
search for another control character, and verify the iterator is
positioned correctly.

2 years agoAdd a unit test case for converting \000\009
Matthijs Mekking [Tue, 30 Apr 2024 15:36:47 +0000 (17:36 +0200)] 
Add a unit test case for converting \000\009

Sanity checking that this domain converts to the key I am expecting.

Also fix some of the other names that had trailing 0x02 bits.

2 years agoadd a test method to print QP keys
Evan Hunt [Tue, 30 Apr 2024 08:22:39 +0000 (01:22 -0700)] 
add a test method to print QP keys

add a method qp_test_printkey() to print the name encoded in a QP key.

2 years agoMerge branch 'each-qpcache-cleanup' into 'main'
Evan Hunt [Tue, 30 Apr 2024 20:28:52 +0000 (20:28 +0000)] 
Merge branch 'each-qpcache-cleanup' into 'main'

clean up and speed up qpcache

See merge request isc-projects/bind9!8987

2 years agofix more ambiguous struct names
Evan Hunt [Mon, 29 Apr 2024 22:45:26 +0000 (15:45 -0700)] 
fix more ambiguous struct names

there were some structure names used in qpcache.c and qpzone.c that
were too similar to each other and could be confusing when debugging.
they have been changed as follows:

in qcache.c:
- changed_t was unused, and has been removed
- search_t -> qpc_search_t
- qpdb_rdatasetiter_t -> qpc_rditer_t
- qpdb_dbiterator_t -> qpc_dbiter_t

in qpzone.c:
- qpdb_changed_t -> qpz_changed_t
- qpdb_changedlist_t -> qpz_changedlist_t
- qpdb_version_t -> qpz_version_t
- qpdb_versionlist_t -> qpz_versionlist_t
- qpdb_search_t -> qpz_search_t
- qpdb_load_t -> qpz_search_t

2 years agouse dns_qp_getname() where possible
Evan Hunt [Thu, 11 Apr 2024 17:00:22 +0000 (10:00 -0700)] 
use dns_qp_getname() where possible

some calls to dns_qp_lookup() do not need partial matches, QP chains
or QP iterators. in these cases it's more efficient to use
dns_qp_getname().

2 years agoget foundname from the node
Evan Hunt [Thu, 11 Apr 2024 03:48:24 +0000 (23:48 -0400)] 
get foundname from the node

when calling dns_qp_lookup() from qpcache, instead of passing
'foundname' so that a name would be constructed from the QP key,
we now just use the name field in the node data. this makes
dns_qp_lookup() run faster.

the same optimization has also been added to qpzone.

the documentation for dns_qp_lookup() has been updated to
discuss this performance consideration.

2 years agoinclude the nodenames when calculating memory to purge
Evan Hunt [Thu, 14 Mar 2024 23:46:52 +0000 (16:46 -0700)] 
include the nodenames when calculating memory to purge

when the cache is over memory, we purge from the LRU list until
we've freed the approximate amount of memory to be added. this
approximation could fail because the memory allocated for nodenames
wasn't being counted.

add a dns_name_size() function so we can look up the size of nodenames,
then add that to the purgesize calculation.

2 years agosimplify qpcache iterators
Evan Hunt [Wed, 13 Mar 2024 05:19:47 +0000 (22:19 -0700)] 
simplify qpcache iterators

in a cache database, unlike zones, NSEC3 records are stored in
the main tree. it is not necessary to maintain a separate 'nsec3'
tree, nor to have code in the dbiterator implementation to traverse
from one tree to another.

(if we ever implement synth-from-dnssec using NSEC3 records, we'll
need to revert this change. in the meantime, simpler code is better.)

2 years agoclean up unnecessary dbiterator code related to origin
Evan Hunt [Mon, 29 Apr 2024 21:57:42 +0000 (14:57 -0700)] 
clean up unnecessary dbiterator code related to origin

the QP database doesn't support relative names as the RBTDB did, so
there's no need for a 'new_origin' flag or to handle `DNS_R_NEWORIGIN`
result codes.

2 years agomore cleanups in qpcache.c
Evan Hunt [Tue, 12 Mar 2024 08:05:07 +0000 (01:05 -0700)] 
more cleanups in qpcache.c

- remove unneeded struct members and misleading comments.
- remove unused parameters for static functions.
- rename 'find_callback' to 'delegating' for consistency with qpzone;
  the find callback mechanism is not used in QP databases.

2 years agorename QPDB_HEADERNODE to HEADERNODE
Evan Hunt [Mon, 29 Apr 2024 22:54:37 +0000 (15:54 -0700)] 
rename QPDB_HEADERNODE to HEADERNODE

this makes the macro consistent between qpcache.c and qpzone.c.

also removed a redundant definition of HEADERNODE in qpzone.c.

2 years agofix structure names in qpcache.c and qpzone.c
Evan Hunt [Mon, 29 Apr 2024 22:29:33 +0000 (15:29 -0700)] 
fix structure names in qpcache.c and qpzone.c

- change dns_qpdata_t to qpcnode_t (QP cache node), and dns_qpdb_t to
  qpcache_t, as these types are only accessed locally.
- also change qpdata_t in qpzone.c to qpznode_t (QP zone node), for
  consistency.
- make the refcount declarations for qpcnode_t and qpznode_t static,
  using the new ISC_REFCOUNT_STATIC macros.

2 years agoclean up unnecessary requirements in qpcache.c
Evan Hunt [Mon, 29 Apr 2024 22:09:43 +0000 (15:09 -0700)] 
clean up unnecessary requirements in qpcache.c

qpcache can only support cache semantics now, so there's
no longer any need to check for that internally.

2 years agoadd static macros for ISC_REFCOUNT_DECL/IMPL
Evan Hunt [Tue, 12 Mar 2024 08:02:48 +0000 (01:02 -0700)] 
add static macros for ISC_REFCOUNT_DECL/IMPL

this commit adds a mechanism to statically declare attach/detach
and ref/unref methods, for objects that are only accessed within
a single C file.

2 years agoMerge branch 'ondrej/improve-newref-checks' into 'main'
Ondřej Surý [Tue, 30 Apr 2024 18:43:39 +0000 (18:43 +0000)] 
Merge branch 'ondrej/improve-newref-checks' into 'main'

Improve the reference counting in newref()

See merge request isc-projects/bind9!8914

2 years agoImprove the reference counting checks in newref()
Ondřej Surý [Tue, 26 Mar 2024 13:13:24 +0000 (14:13 +0100)] 
Improve the reference counting checks in newref()

In qpcache (and rbtdb), there are some functions that acquire
neither the tree lock nor the node lock when calling newref().
In theory, this could lead to a race in which a new reference
is added to a node that was about to be deleted.

We now detect this condition by passing the current tree and node
lock status to newref(). If the node was previously unreferenced
and we don't hold at least one read lock, we will assert.

2 years agoMerge branch 'mnowak/stress-tests-freebsd-instance-autoscaler' into 'main'
Michal Nowak [Mon, 29 Apr 2024 18:10:52 +0000 (18:10 +0000)] 
Merge branch 'mnowak/stress-tests-freebsd-instance-autoscaler' into 'main'

Use FreeBSD autoscaler for "stress" tests

See merge request isc-projects/bind9!8968

2 years agoUse FreeBSD autoscaler for "stress" tests
Michal Nowak [Thu, 4 Apr 2024 10:59:50 +0000 (12:59 +0200)] 
Use FreeBSD autoscaler for "stress" tests

The FreeBSD autoscaler has been configured to utilize the new "instance"
GitLab Runner executor to spawn "stress" test CI jobs on AWS EC2
dynamically. A shared GitLab Runner named "freebsd-instance-autoscaler"
has been set up in GitLab CI/CD to communicate with EC2, provisioning VM
instances on demand based on a FreeBSD 13 AMI image. This image is the
same as the one previously used for FreeBSD "stress" tests before the
implementation of autoscaling (specifically, the
"freebsd13-amd64-bind9stress.aws.lab.isc.org" GitLab Runner in CI/CD).

2 years agoMerge branch 'michal/update-urls-and-paths-for-the-bind-9-qa-repository' into 'main'
Michał Kępień [Mon, 29 Apr 2024 09:48:06 +0000 (09:48 +0000)] 
Merge branch 'michal/update-urls-and-paths-for-the-bind-9-qa-repository' into 'main'

Update URLs and paths for the BIND 9 QA repository

See merge request isc-projects/bind9!8990

2 years agoUpdate URLs and paths for the BIND 9 QA repository
Michał Kępień [Fri, 26 Apr 2024 16:43:07 +0000 (18:43 +0200)] 
Update URLs and paths for the BIND 9 QA repository

Since the BIND 9 QA repository has been made public, adjust the relevant
URLs and paths used in .gitlab-ci.yml so that they work with the public
version of that repository.

2 years agoMerge branch '4523-dnstap-support-for-new-transport-protocols' into 'main'
Aydın Mercan [Fri, 26 Apr 2024 15:47:46 +0000 (15:47 +0000)] 
Merge branch '4523-dnstap-support-for-new-transport-protocols' into 'main'

Emit and read correct DoT and DoH dnstap entries

Closes #4523

See merge request isc-projects/bind9!8697

2 years agoAdd CHANGES and release note for [GL #4523]
Aydın Mercan [Tue, 6 Feb 2024 12:28:12 +0000 (15:28 +0300)] 
Add CHANGES and release note for [GL #4523]

2 years agoProvide an early escape hatch for ns_client_transport_type
Aydın Mercan [Thu, 15 Feb 2024 10:30:42 +0000 (13:30 +0300)] 
Provide an early escape hatch for ns_client_transport_type

Because some tests don't have a legtimate handle, provide a temporary
return early that should be fixed and removed before squashing. This
short circuiting is still correct until DoQ/DoH3 support is introduced.

2 years agoAdd fallback to ns_client_get_type despite unreachable
Aydın Mercan [Wed, 7 Feb 2024 08:35:59 +0000 (11:35 +0300)] 
Add fallback to ns_client_get_type despite unreachable

GCC might fail to compile because it expects a return after UNREACHABLE.
It should ideally just work anyway since UNREACHABLE is either a
noreturn or UB (__builtin_unreachable / C23 unreachable).

Either way, it should be optimized almost always so the fallback is
free or basically free anyway when it isn't optimized out.

2 years agoEmit and read correct DoT and DoH dnstap entries
Aydın Mercan [Thu, 1 Feb 2024 07:20:12 +0000 (10:20 +0300)] 
Emit and read correct DoT and DoH dnstap entries

Other protocols still pretend to be TCP/UDP.
This only causes a difference when using dnstap-read on a file with DoQ
or DNSCrypt entries

2 years agoUpdate the dnstap protobuf definition
Aydın Mercan [Fri, 19 Jan 2024 12:33:31 +0000 (15:33 +0300)] 
Update the dnstap protobuf definition

The new definition includes the missing protocol definitions and
specifies the protobuf version.

2 years agoMerge branch 'each-qpzone-oneheap' into 'main'
Evan Hunt [Fri, 26 Apr 2024 01:19:42 +0000 (01:19 +0000)] 
Merge branch 'each-qpzone-oneheap' into 'main'

simplify qpzone database by using only one heap for resigning

See merge request isc-projects/bind9!8889

2 years agoavoid a race in the qpzone getsigningtime() implementation
Ondřej Surý [Tue, 26 Mar 2024 00:23:19 +0000 (17:23 -0700)] 
avoid a race in the qpzone getsigningtime() implementation

the previous commit introduced a possible race in getsigningtime()
where the rdataset header could change between being found on the
heap and being bound.

getsigningtime() now looks at the first element of the heap, gathers the
locknum, locks the respective lock, and retrieves the header from the
heap again.  If the locknum has changed, it will rinse and repeat.
Theoretically, this could spin forever, but practically, it almost never
will as the heap changes on the zone are very rare.

we simplify matters further by changing the dns_db_getsigningtime()
API call. instead of passing back a bound rdataset, we pass back the
information the caller actually needed: the resigning time, owner name
and type of the rdataset that was first on the heap.

2 years agosimplify qpzone database by using only one heap for resigning
Evan Hunt [Wed, 13 Mar 2024 22:59:53 +0000 (15:59 -0700)] 
simplify qpzone database by using only one heap for resigning

in RBTDB, the heap was used by zone databases for resigning, and
by the cache for TTL-based cache cleaning. the cache use case required
very frequent updates, so there was a separate heap for each of the
node lock buckets.

qpzone is for zones only, so it doesn't need to support the cache
use case; the heap will only be touched when the zone is updated or
incrementally signed. we can simplify the code by using only a single
heap.

2 years agoMerge branch '4659-rootkeysentinel-test-fails-for-certain-values-of-oldid' into ...
Evan Hunt [Thu, 25 Apr 2024 18:10:29 +0000 (18:10 +0000)] 
Merge branch '4659-rootkeysentinel-test-fails-for-certain-values-of-oldid' into 'main'

fix_iterator() bug causes DNSSEC NXDOMAIN responses to be broken

Closes #4659

See merge request isc-projects/bind9!8942

2 years agoCHANGES for [GL #4659]
Evan Hunt [Thu, 25 Apr 2024 17:30:47 +0000 (10:30 -0700)] 
CHANGES for [GL #4659]

2 years agosimplify code by removing return values where possible
Evan Hunt [Fri, 19 Apr 2024 22:57:32 +0000 (15:57 -0700)] 
simplify code by removing return values where possible

fix_iterator() and related functions are quite difficult to read.
perhaps it would be a little clearer if we didn't assign values
to variables that won't subsequently be used, or unnecessarily
pop the stack and then push the same value back onto it.

also, in dns_qp_lookup() we previously called fix_iterator(),
removed the leaf from the top of the iterator stack, and then
added it back on. this would be clearer if we just push the leaf
onto the stack when we need to, but leave the stack alone when
it's already complete.

2 years agoadd another broken testcase
Evan Hunt [Thu, 18 Apr 2024 19:01:25 +0000 (12:01 -0700)] 
add another broken testcase

2 years agoclean up fix_iterator() arguments
Evan Hunt [Thu, 18 Apr 2024 23:25:48 +0000 (16:25 -0700)] 
clean up fix_iterator() arguments

the value passed as 'start' was redundant; it's always the same
as the current top of the iterator stack.

2 years agoyet another fix_iterator() bug
Evan Hunt [Wed, 10 Apr 2024 20:13:48 +0000 (16:13 -0400)] 
yet another fix_iterator() bug

under some circumstances it was possible for the iterator to
be set to the first leaf in a set of twigs, when it should have
been set to the last.

a unit test has been added to test this scenario. if there is a
a tree containing the following values: {".", "abb.", "abc."}, and
we query for "acb.", previously the iterator would be positioned at
"abb." instead of "abc.".

the tree structure is:
    branch (offset 1, ".")
      branch (offset 3, ".ab")
        leaf (".abb")
        leaf (".abc")

we find the branch with offset 3 (indicating that its twigs differ
from each other in the third position of the label, "abB" vs "abC").
but the search key differs from the found keys at position 2
("aC" vs "aB").  we look up the bit value in position 3 of the
search key ("B"), and incorrectly follow it onto the wrong twig
("abB").

to correct for this, we need to check for the case where the search
key is greater than the found key in a position earlier than the
branch offset. if it is, then we need to pop from the current leaf
to its parent, and get the greatest leaf from there.

a further change is needed to ensure that we don't do this twice;
when we've moved to a new leaf and the point of difference between
it and the search key even earlier than before, then we're definitely
at a predecessor node and there's no need to continue the loop.

2 years agoMerge branch 'mnowak/fix-changes-entry-6378' into 'main'
Michal Nowak [Thu, 25 Apr 2024 07:31:29 +0000 (07:31 +0000)] 
Merge branch 'mnowak/fix-changes-entry-6378' into 'main'

Reformat overflowing CHANGES entry 6378

See merge request isc-projects/bind9!8981

2 years agoReformat overflowing CHANGES entry 6378
Michal Nowak [Thu, 25 Apr 2024 07:22:27 +0000 (09:22 +0200)] 
Reformat overflowing CHANGES entry 6378

    $ sh util/check-line-length.sh CHANGES
    CHANGES: Line Too Long
                            previously removed. An attempt to use the option now prints

2 years agoMerge branch '1879-fix-documentation-on-named--U' into 'main'
Ondřej Surý [Wed, 24 Apr 2024 20:50:09 +0000 (20:50 +0000)] 
Merge branch '1879-fix-documentation-on-named--U' into 'main'

Properly document that named -U <n> is no-op now

Closes #1879

See merge request isc-projects/bind9!8976

2 years agoAdd CHANGES and release note for [GL #1879]
Ondřej Surý [Wed, 24 Apr 2024 12:03:50 +0000 (14:03 +0200)] 
Add CHANGES and release note for [GL #1879]

2 years agoProperly document that named -U <n> is no-op now
Ondřej Surý [Wed, 24 Apr 2024 11:55:11 +0000 (13:55 +0200)] 
Properly document that named -U <n> is no-op now

We don't create <n> UDP dispatches anymore and -U <n> option to named is
a no-op for a while.  Properly document that in the named man page.

2 years agoMerge branch 'spdx-custom-test-driver' into 'main'
Petr Špaček [Wed, 24 Apr 2024 09:49:44 +0000 (09:49 +0000)] 
Merge branch 'spdx-custom-test-driver' into 'main'

Use standard SPDX license for custom-test-driver

See merge request isc-projects/bind9!8971

2 years agoChange exception SPDX to Autoconf-exception-generic
Petr Menšík [Tue, 23 Apr 2024 13:26:30 +0000 (15:26 +0200)] 
Change exception SPDX to Autoconf-exception-generic

License text is in fact Autoconf generic exception, with already defined
SPDX identificator. Use that instead.

https://spdx.org/licenses/Autoconf-exception-generic.html

2 years agoMerge branch '4684-unit-test-error-handling-in-dns_name_-api' into 'main'
Mark Andrews [Wed, 24 Apr 2024 02:14:05 +0000 (02:14 +0000)] 
Merge branch '4684-unit-test-error-handling-in-dns_name_-api' into 'main'

test dns_name_fromregion

Closes #4684

See merge request isc-projects/bind9!8967

2 years agoExtract empty name in 'source' into 'name'
Mark Andrews [Tue, 23 Apr 2024 04:16:21 +0000 (14:16 +1000)] 
Extract empty name in 'source' into 'name'

2 years agoExtract non absolute name from source
Mark Andrews [Tue, 23 Apr 2024 04:10:39 +0000 (14:10 +1000)] 
Extract non absolute name from source

The entire source region needs to be consumed for this usage.

2 years agoExtract fully qualified named from source without buffer
Mark Andrews [Tue, 23 Apr 2024 03:34:56 +0000 (13:34 +1000)] 
Extract fully qualified named from source without buffer

'name.ndata' should point to the source.

2 years agoTest dns_name_fromregion
Mark Andrews [Tue, 23 Apr 2024 03:34:56 +0000 (13:34 +1000)] 
Test dns_name_fromregion

with a large source region and a large target buffer, both
larger than DNS_NAME_MAXWIRE.

2 years agoMerge branch '4689-test-invalid-notify-source-address' into 'main'
Mark Andrews [Wed, 24 Apr 2024 01:09:35 +0000 (01:09 +0000)] 
Merge branch '4689-test-invalid-notify-source-address' into 'main'

Check behaviour using invalid notify source address

Closes #4689

See merge request isc-projects/bind9!8966

2 years agocheck behaviour with invalid notify-source-v6 address
Mark Andrews [Tue, 23 Apr 2024 01:26:15 +0000 (11:26 +1000)] 
check behaviour with invalid notify-source-v6 address

This was reported as causing the server to fail to shutdown on
NetBSD.  Look for the expected informational and error messages.

2 years agoMerge branch 'mnowak/llvm-18' into 'main'
Michal Nowak [Tue, 23 Apr 2024 12:48:22 +0000 (12:48 +0000)] 
Merge branch 'mnowak/llvm-18' into 'main'

Bump the LLVM version to 18 and reformat sources

See merge request isc-projects/bind9!8827

2 years agoUpdate sources to Clang 18 formatting
Michal Nowak [Wed, 6 Mar 2024 08:56:51 +0000 (09:56 +0100)] 
Update sources to Clang 18 formatting

2 years agoUpdate Clang to version 18
Michal Nowak [Wed, 6 Mar 2024 08:59:59 +0000 (09:59 +0100)] 
Update Clang to version 18

2 years agoMerge branch 'ondrej/fix-adb-entries-cleaning' into 'main'
Ondřej Surý [Mon, 22 Apr 2024 08:37:45 +0000 (08:37 +0000)] 
Merge branch 'ondrej/fix-adb-entries-cleaning' into 'main'

Always set ADB entry expiration to now + ADB_ENTRY_WINDOW

See merge request isc-projects/bind9!8934

2 years agoChange the ADB_ENTRY_WINDOW to 60 seconds
Ondřej Surý [Wed, 3 Apr 2024 10:07:41 +0000 (12:07 +0200)] 
Change the ADB_ENTRY_WINDOW to 60 seconds

The previous value of 30 minutes used to cache the ADB names and entries
was quite long.  Change the value to 60 seconds for faster recovery
after cached intermittent failure of the remote nameservers.

2 years agoUnify the expiration time handling for all ADB expiration
Ondřej Surý [Wed, 3 Apr 2024 09:51:58 +0000 (11:51 +0200)] 
Unify the expiration time handling for all ADB expiration

The algorithm from the previous commit[1] is now used to calculate all
the expiration values through the code (ncache results, cname/dname
targets).

1. ISC_MIN(cur, ISC_MAX(now + ADB_ENTRY_WINDOW, now + rdataset->ttl))

2 years agoFix the expire_v4 and expire_v6 logic
Ondřej Surý [Wed, 3 Apr 2024 09:36:54 +0000 (11:36 +0200)] 
Fix the expire_v4 and expire_v6 logic

Correct the logic to set the expiration period of expire_{v4,v6} as
follows:

1. If the trust is ultimate (local entry), immediately set the entry as
   expired, so the changes to the local zones have immediate effect.

3. If the expiration is already set and smaller than the new value, then
   leave the expiration value as it is.

2. Otherwise pick larger of `now + ADB_ENTRY_WINDOW` and `now + TTL` as
   the new expiration value.

2 years agoAlways set ADB entry expiration to now + ADB_ENTRY_WINDOW
Ondřej Surý [Wed, 3 Apr 2024 09:33:48 +0000 (11:33 +0200)] 
Always set ADB entry expiration to now + ADB_ENTRY_WINDOW

When ADB entry was created it was set to never expire.  If we never
called any of the functions that adjust the expiration, it could linger
in the ADB forever.

Set the expiration (.expires) to now + ADB_ENTRY_WINDOW when creating
the new ADB entry to ensure the ADB entry will always expire.

2 years agoMerge branch '4687-validator-c-1280-insist-val-nfails-0-failed' into 'main'
Mark Andrews [Mon, 22 Apr 2024 04:57:45 +0000 (04:57 +0000)] 
Merge branch '4687-validator-c-1280-insist-val-nfails-0-failed' into 'main'

Resolve "validator.c:1280: INSIST((*val->nfails) > 0) failed"

Closes #4687

See merge request isc-projects/bind9!8963

2 years agoBreak out of the switch if we have already reached the quota
Mark Andrews [Mon, 22 Apr 2024 02:32:36 +0000 (12:32 +1000)] 
Break out of the switch if we have already reached the quota

This prevents consume_validation_fail being called and causing an
INSIST.

2 years agoMerge branch 'mnowak/drop-respdiff-short-ci-jobs' into 'main'
Michal Nowak [Fri, 19 Apr 2024 15:56:00 +0000 (15:56 +0000)] 
Merge branch 'mnowak/drop-respdiff-short-ci-jobs' into 'main'

Drop respdiff-short CI jobs

See merge request isc-projects/bind9!8958

2 years agoDrop respdiff-short CI jobs
Michal Nowak [Fri, 19 Apr 2024 09:58:19 +0000 (11:58 +0200)] 
Drop respdiff-short CI jobs

In the past, our CI infrastructure was more sensitive to the number of
CI jobs running on it. We tried to limit long-running jobs in merge
request-triggered pipelines, as there are many of them, and spawned them
only in daily scheduled ones. Moving most of the CI infrastructure to
AWS has made it way better to run jobs in parallel, and the existence of
short respdiff jobs has lost its original merit. It can also be harmful
as some problems are detected only by the longer respdiff variant when a
faulty merge request has already been merged. We should run all long
respdiff tests in merge request-triggered pipelines.

Also, move the former respdiff-long job (now just "respdiff") to AWS as
old instance memory constraints (see
f09cf69594c6aab4d0c5608226424c566b833f3c) are no longer an issue.

2 years agoMerge branch 'pspacek/auto-backports' into 'main'
Petr Špaček [Fri, 19 Apr 2024 13:40:51 +0000 (13:40 +0000)] 
Merge branch 'pspacek/auto-backports' into 'main'

Attempt automatic MR backports after every merge

See merge request isc-projects/bind9!8959

2 years agoAttempt automatic MR backports after every merge
Petr Špaček [Fri, 19 Apr 2024 12:29:10 +0000 (14:29 +0200)] 
Attempt automatic MR backports after every merge

2 years agoMerge branch '1128-offline-ksk' into 'main'
Matthijs Mekking [Fri, 19 Apr 2024 11:56:50 +0000 (11:56 +0000)] 
Merge branch '1128-offline-ksk' into 'main'

Introduce new DNSSEC tool dnssec-ksr

See merge request isc-projects/bind9!8188

2 years agodnssec-keygen: Change flag options into booleans
Matthijs Mekking [Wed, 17 Apr 2024 13:27:39 +0000 (15:27 +0200)] 
dnssec-keygen: Change flag options into booleans

We now have ctx.kskflag, ctx.zskflag, and ctx.revflag, but zskflag is
not quite like the other two, as it doesn't have a special bit in the
DNS packet, and is used as a boolean.

This patch changes so that we use booleans for all three, and
construct the flags based on which ones are set.

patch by @aram

2 years agoDon't leak
Matthijs Mekking [Mon, 4 Mar 2024 16:01:43 +0000 (17:01 +0100)] 
Don't leak

Make tsan happy, fix memory leaks by keeping track of the buffers
to be cleaned up.

2 years agoAdd test cases for CDS/CDNSKEY
Matthijs Mekking [Mon, 4 Mar 2024 10:36:16 +0000 (11:36 +0100)] 
Add test cases for CDS/CDNSKEY

Add two more test cases to ensure that a Signed Key Response file
creates signed CDNSKEY and/or CDS RRsets according to the policy.

2 years agoAdjust system test to expect CDS and CDNSKEY
Matthijs Mekking [Fri, 1 Mar 2024 13:51:11 +0000 (14:51 +0100)] 
Adjust system test to expect CDS and CDNSKEY

Requires storing the KSK keyfile identifier to calculate the expected
CDS and CDNSKEY.

2 years agoAdd option to dnssec-dsfromkey to chop up rdata
Matthijs Mekking [Mon, 4 Mar 2024 09:14:56 +0000 (10:14 +0100)] 
Add option to dnssec-dsfromkey to chop up rdata

The new option 'w' allows us to print DS rdata with the base64 portions
split up in chunks. This is mainly done for testing purposes.

2 years agoAdd CDS and CDNSKEY to SKR
Matthijs Mekking [Fri, 1 Mar 2024 13:48:35 +0000 (14:48 +0100)] 
Add CDS and CDNSKEY to SKR

Add signed CDS and CDNSKEY RRsets to the Signed Key Response (SKR) for the
used KSKs.

We only print one bundle header for all three RRsets.

2 years agosh the fmt up
Matthijs Mekking [Mon, 26 Feb 2024 15:29:59 +0000 (16:29 +0100)] 
sh the fmt up

Apply shfmt patch. Ideally I fixup every commit that changes testing,
but that is just too much at this point.

2 years agoAdd CHANGES and release note
Matthijs Mekking [Thu, 22 Feb 2024 14:39:20 +0000 (15:39 +0100)] 
Add CHANGES and release note

Introduce the new 'dnssec-ksr' tool.

2 years agoTest dnssec-ksr sign
Matthijs Mekking [Thu, 22 Feb 2024 14:18:30 +0000 (15:18 +0100)] 
Test dnssec-ksr sign

Add test cases for the 'sign' command. Reuse the earlier generated KSR
files.

Also update dnssec-ksr.c to have better cleanup.

2 years agoImplement dnssec-ksr sign
Matthijs Mekking [Thu, 22 Feb 2024 14:16:03 +0000 (15:16 +0100)] 
Implement dnssec-ksr sign

Add code that can create a Signed Key Response (SKR) given a Key
Signing Request (KSR), a DNSSEC policy, a set of keys and an interval.

2 years agoChange ksr format
Matthijs Mekking [Thu, 21 Dec 2023 10:16:40 +0000 (11:16 +0100)] 
Change ksr format

Make the ksr format compatible with knot.

2 years agoRefactor dnssec-ksr
Matthijs Mekking [Tue, 15 Aug 2023 10:20:40 +0000 (12:20 +0200)] 
Refactor dnssec-ksr

Refactor some more, making the cleanup a generic function.

2 years agoTest dnssec-ksr request
Matthijs Mekking [Tue, 15 Aug 2023 09:56:06 +0000 (11:56 +0200)] 
Test dnssec-ksr request

Add test cases for the 'request' command. Reuse the earlier
pregenerated ZSKs. We also need to set up some KSK files, that can
be done with 'dnssec-keygen -k <policy> -fK' now.

The 'check_keys()' function is adjusted such that the expected active
time of the successor key is set to the inactive time of the
predecessor. Some additional information is saved to make 'request'
testing easier.

2 years agoImplement dnssec-ksr request
Matthijs Mekking [Tue, 15 Aug 2023 09:52:36 +0000 (11:52 +0200)] 
Implement dnssec-ksr request

Add code that can create a Key Signing Request (KSR) given a DNSSEC
policy, a set of keys and an interval.

Multiple keys that match the bundle and kasp parameters are sorted by
keytag, mainly for testing purposes.

2 years agoAlso free the dst_key after keygen
Matthijs Mekking [Wed, 17 Apr 2024 10:19:11 +0000 (12:19 +0200)] 
Also free the dst_key after keygen

During cleanup, we also need to free the dst_key structure that is part
of the dns_dnsseckey.

2 years agoRefactor dnssec-ksr keygen
Matthijs Mekking [Tue, 15 Aug 2023 09:46:53 +0000 (11:46 +0200)] 
Refactor dnssec-ksr keygen

Create some helper functions for code that is going to be reused by the
other commands (request, sign), such as setting and checking the context
parameters, and retrieving the dnssec-policy/kasp.

2 years agodnssec-keygen: allow -f and -k together
Matthijs Mekking [Tue, 15 Aug 2023 08:30:36 +0000 (10:30 +0200)] 
dnssec-keygen: allow -f and -k together

The 'dnssec-keygen' tool now allows the options '-k <dnssec-policy>'
and '-f <flags>' together to create keys from a DNSSEC policy that only
match the given role. Allow setting '-fZ' to only create ZSKs, while
'-fK' will only create KSKs.

2 years agoImplement dnssec-ksr keygen
Matthijs Mekking [Wed, 9 Aug 2023 12:50:38 +0000 (14:50 +0200)] 
Implement dnssec-ksr keygen

Add code that can pregenerate ZSKs given a DNSSEC policy and an
interval.

Fix configuration shell scripts, fixing the ksr system test.

2 years agoMove kasp key match function to kasp header
Matthijs Mekking [Wed, 9 Aug 2023 12:10:32 +0000 (14:10 +0200)] 
Move kasp key match function to kasp header

The dnssec-ksr tool needs to check if existing key files match lines
in the keys section of a dnssec-policy, so make this function publicly
available.

2 years agoMove common create key functions to dnssectool.c
Matthijs Mekking [Wed, 9 Aug 2023 12:07:54 +0000 (14:07 +0200)] 
Move common create key functions to dnssectool.c

The dnssec-ksr tool needs to read a dnssec-policy from configuration
too, as well as deal with FIPS mode checks.

2 years agoAdd ksr system test
Matthijs Mekking [Wed, 9 Aug 2023 12:04:54 +0000 (14:04 +0200)] 
Add ksr system test

Add a system test for testing dnssec-ksr, initally for the keygen
command. This should be able to create or select key files given a
DNSSEC policy and a time window.

2 years agoIntroduce new DNSSEC tool dnssec-ksr
Matthijs Mekking [Mon, 7 Aug 2023 08:58:05 +0000 (10:58 +0200)] 
Introduce new DNSSEC tool dnssec-ksr

Introduce a new DNSSEC tool, dnssec-ksr, for creating signed key
response (SKR) files, given one or more key signing requests (KSRs).

For now it is just a dummy tool, but the future purpose of this utility
is to pregenerate ZSKs and signed RRsets for DNSKEY, CDNSKEY, and CDS
for a given period that a KSK is to be offline.

2 years agoMerge branch 'mnowak/revert-874329b3b1a56e58e8caf61d89127441d2cc79a1' into 'main'
Michal Nowak [Fri, 19 Apr 2024 08:37:47 +0000 (08:37 +0000)] 
Merge branch 'mnowak/revert-874329b3b1a56e58e8caf61d89127441d2cc79a1' into 'main'

Revert "Temporarily allow failure of respdiff-long:tsan job"

See merge request isc-projects/bind9!8957

2 years agoRevert "Temporarily allow failure of respdiff-long:tsan job"
Michal Nowak [Fri, 19 Apr 2024 08:28:51 +0000 (10:28 +0200)] 
Revert "Temporarily allow failure of respdiff-long:tsan job"

This reverts commit 874329b3b1a56e58e8caf61d89127441d2cc79a1.

Addressed in isc-projects/bind9#4475.

2 years agoMerge branch '4416-fix-reading-multiple-rndc-messages-in-single-TCP-message' into...
Ondřej Surý [Thu, 18 Apr 2024 18:10:56 +0000 (18:10 +0000)] 
Merge branch '4416-fix-reading-multiple-rndc-messages-in-single-TCP-message' into 'main'

Rework isccc_ccmsg to support multiple messages per tcp read

Closes #4416

See merge request isc-projects/bind9!8956

2 years agoAdd CHANGES note for [GL #4416]
Ondřej Surý [Thu, 18 Apr 2024 14:46:38 +0000 (16:46 +0200)] 
Add CHANGES note for [GL #4416]

2 years agoRework isccc_ccmsg to support multiple messages per tcp read
Dominik Thalhammer [Thu, 9 Nov 2023 09:26:43 +0000 (10:26 +0100)] 
Rework isccc_ccmsg to support multiple messages per tcp read

Previously, only a single controlconf message would be processed from a
single TCP read even if the TCP read buffer contained multiple messages.
Refactor the isccc_ccmsg unit to store the extra buffer in the internal
buffer and use the already read data first before reading from the
network again.

Co-authored-by: Ondřej Surý <ondrej@isc.org>
Co-authored-by: Dominik Thalhammer <dominik@thalhammer.it>
2 years agoMerge branch '4586-don-t-count-expired-future-rrsigs-in-verification-failure-quota...
Ondřej Surý [Thu, 18 Apr 2024 15:07:43 +0000 (15:07 +0000)] 
Merge branch '4586-don-t-count-expired-future-rrsigs-in-verification-failure-quota' into 'main'

Don't count expired / future RRSIGs in verification failure quota

Closes #4586

See merge request isc-projects/bind9!8746

2 years agoAdd CHANGES and release notes for [GL #4586]
Ondřej Surý [Mon, 15 Apr 2024 10:44:41 +0000 (12:44 +0200)] 
Add CHANGES and release notes for [GL #4586]

2 years agoDon't count expired / future RRSIG against quota
Ondřej Surý [Mon, 15 Apr 2024 10:45:01 +0000 (12:45 +0200)] 
Don't count expired / future RRSIG against quota

These don't trigger a public key verification unless
dnssec-accept-expired is set.

2 years agoMerge branch 'pspacek/update-sphinx' into 'main'
Petr Špaček [Thu, 18 Apr 2024 14:00:33 +0000 (14:00 +0000)] 
Merge branch 'pspacek/update-sphinx' into 'main'

Update Sphinx version used for documentation build

See merge request isc-projects/bind9!8952

2 years agoUpdate Sphinx version used for documentation build
Petr Špaček [Thu, 18 Apr 2024 10:46:13 +0000 (12:46 +0200)] 
Update Sphinx version used for documentation build

2 years agoMerge branch 'ondrej-offload-statschannel' into 'main'
Ondřej Surý [Thu, 18 Apr 2024 08:56:06 +0000 (08:56 +0000)] 
Merge branch 'ondrej-offload-statschannel' into 'main'

Offload the isc_http response processing to worker thread

Closes #4680

See merge request isc-projects/bind9!7647