Commit Graph

38091 Commits

Author SHA1 Message Date
Aram Sargsyan
d02be5e693 Fix nsupdate system test CA certificate signing validity days
The validity default days value of 1 was used for debugging and
left as such accidentally.

Use 10950 days, as used elsewhere (for example, in doth test CA).

This does not affect anything, the value will be effective when
generating new test certificates in the future.
2023-01-20 14:45:30 +00:00
Aram Sargsyan
154cdbd861 Test query forwarding to DoT-enabled upstream servers
Change the 'forward' system test to enable DoT on ns2 server,
and test that forwarding from ns4 to the DoT-enabled ns2 works.

In order to test different scenarios, create a test CA (based on
similar CAs for 'doth' and 'nsupdate' system tests), and test
both insecure (no certificate validation) and secure (also with
mutual TLS) TLS configurations, as well as a configuration with an
expired certificate.
2023-01-20 14:45:30 +00:00
Aram Sargsyan
6ea05ac3fe Resolver query forwarding to DoT-enabled upstream servers
Implement TLS transport usage in the resolver.

Use the configured TLS transport for the forwarders in the resolver.
2023-01-20 14:45:30 +00:00
Aram Sargsyan
3aa2d84880 Load and validate the configured TLS transport for forwarders
Add support for loading and validating the 'tls' parameter from
the forwarders' configuration.

This prepares ground for adding support to forward queries to
DoT-enabled upstream servers.
2023-01-20 14:45:30 +00:00
Aram Sargsyan
e1dd86aa07 Add 'tls' configuration support for the 'forwarders' option
A 'tls' statement can be specified both for individual addresses
and for the whole list (as a default value when an individual
address doesn't have its own 'tls' set), just as it was done
before for the 'port' value.

Create a new function 'print_rawqstring()' to print a string residing
in a 'isc_textregion_t' type parameter.

Create a new function 'copy_string()' to copy a string from a
'cfg_obj_t' object into a 'isc_textregion_t'.
2023-01-20 14:45:30 +00:00
Mark Andrews
0c14e59215 Merge branch 'marka-mock-openbsd' into 'main'
Enable mock tests for OpenBSD

See merge request isc-projects/bind9!7309
2023-01-20 13:53:16 +00:00
Mark Andrews
5c06c67001 Remove conditional around mock tests for OpenBSD
We now use multiple barriers.
2023-01-20 13:32:25 +00:00
Mark Andrews
1873ad4a06 Merge branch '3800-macos-address-in-use-not-handled-gracefully' into 'main'
Resolve "MacOS address in use not handled gracefully"

Closes #3800

See merge request isc-projects/bind9!7381
2023-01-20 13:29:19 +00:00
Mark Andrews
e706fb81ca Add CHANGES note for [GL #3800] 2023-01-20 11:06:08 +11:00
Mark Andrews
b74dd2e8c2 Use INSIST rather then REQUIRE to meet DBC usage rules 2023-01-20 11:05:24 +11:00
Mark Andrews
08c39736a9 isc_nm_listentcp: treat socket failures gracefully
The old code didn't handle race conditions and errors on systems
with non load balancing sockets gracefully.  Look for an error on
any child socket and if found close all the child sockets and return
an error.
2023-01-20 11:05:24 +11:00
Mark Andrews
624f5a0dae isc_nm_listenudp: treat socket failures gracefully
The old code didn't handle race conditions and errors on systems
with non load balancing sockets gracefully.  Look for an error on
any child socket and if found close all the child sockets and return
an error.
2023-01-20 11:05:24 +11:00
Artem Boldariev
fa7fd32a00 Merge branch 'artem-fix-building-on-dragonflybsd' into 'main'
Fix building BIND on DragonFly BSD

Closes #3796

See merge request isc-projects/bind9!7379
2023-01-19 22:55:45 +00:00
Artem Boldariev
942569a1bb Fix building BIND on DragonFly BSD (on both older an newer versions)
This commit ensures that BIND and supplementary tools still can be
built on newer versions of DragonFly BSD. It used to be the case, but
somewhere between versions 6.2 and 6.4 the OS developers rearranged
headers and moved some function definitions around.

Before that the fact that it worked was more like a coincidence, this
time we, at least, looked at the related man pages included with the
OS.

No in depth testing has been done on this OS as we do not really
support this platform - so it is more like a goodwill act. We can,
however, use this platform for testing purposes, too. Also, we know
that the OS users do use BIND, as it is included in its ports
directory.

Building with './configure' and './configure --without-jemalloc' have
been fixed and are known to work at the time the commit is made.
2023-01-20 00:19:12 +02:00
Mark Andrews
65e3527e66 Merge branch '3799-tsan-race-between-dns_rbtnode_t-bitfields' into 'main'
Add missing lock when setting node->wild

Closes #3799

See merge request isc-projects/bind9!7392
2023-01-19 13:24:32 +00:00
Mark Andrews
5c471c5d2c Add CHANGES for [GL #3799] 2023-01-19 23:52:37 +11:00
Mark Andrews
81c24b8da2 Add missing node lock when setting node->wild in rbtdb.c
The write node lock needs to be held when setting node->wild in
add_wildcard_magic except when being called from loading_addrdataset
which is used to load the zone without locking during its initial
load.
2023-01-19 23:52:08 +11:00
Arаm Sаrgsyаn
1a0b36d8a2 Merge branch '3808-refactor-isc_nm_xfr_allowed' into 'main'
Refactor isc_nm_xfr_allowed()

Closes #3808

See merge request isc-projects/bind9!7395
2023-01-19 11:21:19 +00:00
Aram Sargsyan
5a1707aa8d Add a CHANGES note for [GL #3808] 2023-01-19 10:24:36 +00:00
Aram Sargsyan
41dc48bfd7 Refactor isc_nm_xfr_allowed()
Return 'isc_result_t' type value instead of 'bool' to indicate
the actual failure. Rename the function to something not suggesting
a boolean type result. Make changes in the places where the API
function is being used to check for the result code instead of
a boolean value.
2023-01-19 10:24:08 +00:00
Matthijs Mekking
b0b6b47696 Merge branch '3783-parental-ds-requests-need-rd-bit-set' into 'main'
Set RD=1 on DS requests to parental-agents

Closes #3783

See merge request isc-projects/bind9!7361
2023-01-19 10:20:35 +00:00
Matthijs Mekking
dbbacd910f Add CHANGES and release note for GL #3783
News worthy.
2023-01-19 10:19:43 +00:00
Matthijs Mekking
e34722ed43 Set RD bit on checkds requests
It is allowed to point parental-agents to a resolver. Therefore, the
RD bit should be set on requests.

Upon receiving a DS response, ensure that the message has either the
AA or the RA bit set.
2023-01-19 10:19:43 +00:00
Matthijs Mekking
0b9a9f9955 Add checkds test case with resolver parental-agent
Add a test case for a server that uses a resolver as an parental-agent.

We need two root servers, ns1 and ns10, one that delegates to the
'checkds' tld with the DS published (ns2), and one that delegates to
the 'checkds' tld with the DS removed (ns5). Both root zones are
being setup in the 'ns1/setup.sh' script.

We also need two resolvers, ns3 and ns8, that use different root hints
(one uses ns1 address as a hint, the other uses ns10).

Then add the checks to test_checkds.py is similar to the existing tests.

Update 'types' because for zones that have the DS withdrawn (or to be
withdrawn), the CDS and CDNSKEY records should not be published and
thus should not be in the NSEC bitmap.
2023-01-19 10:19:43 +00:00
Ondřej Surý
e54215e048 Merge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach-lock-order-inversion' into 'main'
Detach the zone views outside of the zone lock

Closes #3801

See merge request isc-projects/bind9!7402
2023-01-19 09:21:18 +00:00
Ondřej Surý
978a0ef84c Detach the zone views outside of the zone lock
Detaching the views in the zone_shutdown() could lead to
lock-order-inversion between adb->namelocks[bucket], adb->lock,
view->lock and zone->lock.  Detach the views outside of the section that
zone-locked.
2023-01-19 09:21:10 +00:00
Ondřej Surý
5c7c1182c0 Merge branch 'ondrej/replace-lgtm-with-codeql-add-python-ply' into 'main'
Add python3-ply for ./configure to succeed on BIND 9.16 branch

See merge request isc-projects/bind9!7405
2023-01-19 09:11:56 +00:00
Ondřej Surý
0622d11366 Add python3-ply to GitHub CodeQL configuration
BIND 9.16 needs Python and PLY packages for configure to succeed.
Unless we want to tweak the build script to exclude python, we need to
add python3-ply package to the CodeQL configuration.
2023-01-19 10:03:37 +01:00
Ondřej Surý
d8f98cec48 Merge branch 'ondrej/replace-lgtm-with-codeql' into 'main'
Add CodeQL GitHub Action

See merge request isc-projects/bind9!7393
2023-01-19 08:45:07 +00:00
Ondřej Surý
77abe612a1 Add CodeQL GitHub Action
Replace the decommissioned LGTM service with CodeQL GitHub action.
2023-01-19 09:43:32 +01:00
Ondřej Surý
bb60d6ab6d Merge branch '3795-speed-up-EVP_DigestInit_ex-fixup' into 'main'
Use thread_local EVP_MD in isc_iterated_hash()

Closes #3795

See merge request isc-projects/bind9!7401
2023-01-18 23:32:06 +00:00
Ondřej Surý
5abbcdadaf Use thread_local EVP_MD in isc_iterated_hash()
Cherry-pick small fixup commit from 9.18/9.16 branches needed for
thread-safety.  This fixup commit is not needed for 9.19+ because of
reworked application setup, but it decouples isc_iterated_hash and
isc_md units and keeps all the branches in sync.
2023-01-18 23:33:43 +01:00
Ondřej Surý
35e2842d00 Merge branch '3795-speed-up-EVP_DigestInit_ex' into 'main'
Avoid implicit algorithm fetch for OpenSSL EVP_MD family

See merge request isc-projects/bind9!7375
2023-01-18 19:24:29 +00:00
Ondřej Surý
401294cf60 Add CHANGES and release note for [GL #3795] 2023-01-18 19:36:26 +01:00
Ondřej Surý
f3753d591f Use thread_local EVP_MD_CTX in isc_iterated_hash()
As this code is on hot path (NSEC3) this introduces an additional
optimization of the EVP_MD API - instead of calling EVP_MD_CTX_new() on
every call to isc_iterated_hash(), we create two thread_local objects
for each thread - a basectx and mdctx, initialize basectx once and then
use EVP_MD_CTX_copy_ex() to flip the initialized state into mdctx.  This
saves us couple more valuable microseconds from the isc_iterated_hash()
call.
2023-01-18 19:36:21 +01:00
Ondřej Surý
25db8d0103 Use OpenSSL 1.x SHA_CTX API in isc_iterated_hash()
If the OpenSSL SHA1_{Init,Update,Final} API is still available, use it.
The API has been deprecated in OpenSSL 3.0, but it is significantly
faster than EVP_MD API, so make an exception here and keep using it
until we can't.
2023-01-18 19:36:17 +01:00
Ondřej Surý
36654df732 Use OpenSSL EVP_MD API directly in isc_iterated_hash()
Instead of going through another layer, use OpenSSL EVP_MD API directly
in the isc_iterated_hash() implementation.  This shaves off couple of
microseconds in the microbenchmark.
2023-01-18 18:32:57 +01:00
Ondřej Surý
e6bfb8e456 Avoid implicit algorithm fetch for OpenSSL EVP_MD family
The implicit algorithm fetch causes a lock contention and significant
slowdown for small input buffers.  For more details, see:

https://github.com/openssl/openssl/issues/19612

Instead of using EVP_DigestInit_ex() initialize empty MD_CTX objects for
each algorithm and use EVP_MD_CTX_copy_ex() to initialize MD_CTX from a
static copy.  Additionally avoid implicit algorithm fetching by using
EVP_MD_fetch() for OpenSSL 3.0.
2023-01-18 18:32:57 +01:00
Ondřej Surý
cfbe01c62f Add microbenchmark for isc_iterated_hash()
Add microbenchmark for isc_iterated_hash() to measure the speed of NSEC3
per second.
2023-01-18 18:32:57 +01:00
Ondřej Surý
05b60f9cd8 Merge branch 'ondrej/openssl3-no-deprecated' into 'main'
Enable OpenSSL 3.x build with -DOPENSSL_NO_DEPRECATED=1

See merge request isc-projects/bind9!7394
2023-01-18 17:18:09 +00:00
Ondřej Surý
61ad7a59e0 Enable OpenSSL 3.x build with -DOPENSSL_NO_DEPRECATED=1
Add a CI job where we explicitly disable any use of OpenSSL functions
that have been deprecated in OpenSSL 3.x.
2023-01-18 11:13:19 +01:00
Evan Hunt
680fdce937 Merge branch 'each-remove-reserved-dispatches' into 'main'
remove dead code for reserved dispatches

See merge request isc-projects/bind9!7391
2023-01-18 02:53:40 +00:00
Evan Hunt
d79a3823ad remove dead code for reserved dispatches
named formerly reserved a set of dispatch objects for use when
sending requests from user-specified source ports. this objects
are no longer used and have been removed.
2023-01-17 18:23:52 -08:00
Evan Hunt
1070f1f56a Merge branch '3781-deprecate-source-port' into 'main'
mark "port" as deprecated for source address options

Closes #3781

See merge request isc-projects/bind9!7307
2023-01-18 01:51:43 +00:00
Evan Hunt
22d1951aa6 CHANGES and release note for [GL #3781] 2023-01-17 17:29:43 -08:00
Matthijs Mekking
531914e660 Test deprecate source port configuration
Add 'port' token to deprecated.conf. Also add options
'use-v4-udp-ports', 'use-v6-udp-ports', 'avoid-v4-udp-ports',
and 'avoid-v6-udp-ports'.

All of these should trigger warnings (except when deprecation warnings
are being ignored).
2023-01-17 17:29:31 -08:00
Evan Hunt
470ccbc8ed mark "port" as deprecated for source address options
Deprecate the use of "port" when configuring query-source(-v6),
transfer-source(-v6), notify-source(-v6), parental-source(-v6),
etc. Also deprecate use-{v4,v6}-udp-ports and avoid-{v4,v6}udp-ports.
2023-01-17 17:29:21 -08:00
Evan Hunt
175ee6b22e Merge branch '3789-remove-dscp' into 'main'
fully remove DSCP

Closes #3789

See merge request isc-projects/bind9!7338
2023-01-18 00:47:24 +00:00
Evan Hunt
d6768d6000 CHANGES and release note revision for [GL #3789] 2023-01-17 16:18:21 -08:00
Evan Hunt
287722ac12 fully remove DSCP
The "dscp" option is now marked as "ancient" and it is a configuration
error to use it or to configure DSCP values for any source-address
option.
2023-01-17 16:18:21 -08:00