2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 21:47:59 +00:00

41111 Commits

Author SHA1 Message Date
Michal Nowak
c030a677ae
Update BIND version for release v9.19.21 2024-02-02 10:56:43 +01:00
Michal Nowak
4dd683526d
Add a CHANGES marker 2024-02-02 10:55:35 +01:00
Michal Nowak
a4e39f1e5a Merge branch 'michal/prepare-documentation-for-bind-9.19.21' into 'v9.19.21-release'
Prepare documentation for BIND 9.19.21

See merge request isc-private/bind9!643
2024-02-02 09:54:26 +00:00
Michał Kępień
265deccb85
Prepare release notes for BIND 9.19.21 2024-02-02 09:21:49 +01:00
Michał Kępień
bf6a16c17b Merge branch 'ondrej/dns-validator-async' into 'v9.19.21-release'
[CVE-2023-50387] Fix KeyTrap

See merge request isc-private/bind9!606
2024-02-01 20:47:06 +00:00
Ondřej Surý
abed39ec0d
Add CHANGES and release note for [GL #4424] 2024-02-01 21:45:06 +01:00
Ondřej Surý
15096aefdf
Make the dns_validator validations asynchronous and limit it
Instead of running all the cryptographic validation in a tight loop,
spread it out into multiple event loop "ticks", but moving every single
validation into own isc_async_run() asynchronous event.  Move the
cryptographic operations - both verification and DNSKEY selection - to
the offloaded threads (isc_work_enqueue), this further limits the time
we spend doing expensive operations on the event loops that should be
fast.

Limit the impact of invalid or malicious RRSets that contain crafted
records causing the dns_validator to do many validations per single
fetch by adding a cap on the maximum number of validations and maximum
number of validation failures that can happen before the resolving
fails.
2024-02-01 21:45:06 +01:00
Michał Kępień
1e40c0b124 Merge branch '4234-confidential-parser-regression-main' into 'v9.19.21-release'
fix a message parsing regression

See merge request isc-private/bind9!632
2024-02-01 20:22:37 +00:00
Matthijs Mekking
3818a80bb8 Merge branch '4553-return-value-for-checkds-shadows' into 'main'
Don't also skip keymgr run if checkds is skipped

Closes #4553

See merge request isc-projects/bind9!8681
2024-02-01 11:40:59 +00:00
Matthijs Mekking
07c2acf15d Don't also skip keymgr run if checkds is skipped
Checking the DS at the parent only happens if dns_zone_getdnsseckeys()
returns success. However, if this function somehow fails, it can also
prevent the keymgr from running.

Before adding the check DS functionality, the keymgr should only run
if 'dns_dnssec_findmatchingkeys()' did not return an error (either
ISC_R_SUCCESS or ISC_R_NOTFOUND). After this change the correct
result code is used again.
2024-02-01 12:06:08 +01:00
Matthijs Mekking
6391ad4660 Merge branch '4551-dnssec-keygen-does-not-generate-tsig-keys' into 'main'
dnssec-keygen man page still says it can do TSIG

Closes #4551

See merge request isc-projects/bind9!8678
2024-02-01 10:53:41 +00:00
Matthijs Mekking
8a8c573be6 Put reference to RFC 2845 in tsig-keygen man page 2024-02-01 11:20:33 +01:00
Matthijs Mekking
aabb452953 dnssec-keygen man page still says it can do TSIG
Remove text in man page that says the program can also be used for
generate TSIG keys, this was removed in 9.13.0 but this text was still
not yet removed.
2024-02-01 11:17:39 +01:00
Evan Hunt
37bd2a405f Merge branch '362-check-fetch-quota-param' into 'main'
check range of fetch-quota-param parameters

Closes #362

See merge request isc-projects/bind9!8444
2024-02-01 02:54:02 +00:00
Evan Hunt
05c0e24cbe CHANGES for [GL #362] 2024-01-31 18:20:17 -08:00
Evan Hunt
86fdc66ed3 check range of fetch-quota-param parameters
the 'low', 'high' and 'discount' parameters to 'fetch-quota-param'
are meant to be ratios with values between zero and one, but higher
values can be assigned. this could potentially lead to an assertion
in maybe_adjust_quota().
2024-01-31 18:19:38 -08:00
Michał Kępień
04ba284e1a
Add a CHANGES entry 2024-01-31 15:52:46 +01:00
Aram Sargsyan
510f1de8a6
fix another message parsing regression
The fix for CVE-2023-4408 introduced a regression in the message
parser, which could cause a crash if an rdata type that can only
occur in the question was found in another section.

Use 'dns__message_putassociatedrdataset()' instead of
'dns__message_puttemprdataset()', because after calling the
'dns_rdatalist_tordataset()' function earlier the 'rdataset'
is associated.
2024-01-31 15:52:46 +01:00
Evan Hunt
4c19d35614
fix a message parsing regression
the fix for CVE-2023-4408 introduced a regression in the message
parser, which could cause a crash if duplicate rdatasets were found
in the question section. this commit ensures that rdatasets are
correctly disassociated and freed when this occurs.
2024-01-31 15:52:46 +01:00
Michał Kępień
fec06dce51 Merge branch 'michal/shift-CHANGES-entries' into 'main'
Shift CHANGES entries by two

See merge request isc-projects/bind9!8679
2024-01-31 10:19:29 +00:00
Michał Kępień
1b48c99392
Shift CHANGES entries by two
Account for additional entries that will be included in February 2024
releases.
2024-01-31 11:11:11 +01:00
Matthijs Mekking
6b00e831e1 Merge branch 'matthijs-fix-kasp-test' into 'main'
Make max search depth variable in kasp system test

See merge request isc-projects/bind9!8674
2024-01-29 08:46:57 +00:00
Matthijs Mekking
b14c0546c1 Make max search depth variable in kasp system test
In the second test we are looking for key files and extract the key
id numbers. Because keys can be in different directories, we needed
to change the maxdepth when searching for keys.

For the second kasp system test, check that 'dnssec-keygen -k' (default
policy) creates valid files, the 'get_keyids' returned more than one
keytag, namely the ones that are inside the keys/ directory, that were
created for the predecessor test, check that 'dnssec-keygen -k'
(configuredd policy) creates valid files.

This caused the system test to spew out errors that key files were
missing (we were looking for key files in the current directory, but
when looking for key id numbers we included the keys/ directory). It
could also cause the next test to fail, check that 'dnssec-settime' by
default does not edit key state file, because the STATE_FILE environment
variable was overwritten with the key file path of one of the keys that
were created with the configured policy.

We fix this by adjusting the maxdepth for the test in question. Other
tests don't need adjusting because they use unique zone names.
2024-01-29 08:45:34 +01:00
Michal Nowak
965b0a08ac Merge branch 'mnowak/drop-freebsd-12' into 'main'
Drop FreeBSD 12

See merge request isc-projects/bind9!8670
2024-01-26 09:44:17 +00:00
Michal Nowak
98bfa22381
Drop FreeBSD 12
Support for FreeBSD 12.4, the last FreeBSD 12.x release, ended on
December 31, 2023.

Link: https://www.freebsd.org/security/unsupported/

Move the --with-readline=editline ./configure option to FreeBSD 14.
2024-01-26 10:28:00 +01:00
Matthijs Mekking
b51d8f2c5d Merge branch '1129-hsm-kasp' into 'main'
HSM support for dnssec-policy

Closes #1129

See merge request isc-projects/bind9!5924
2024-01-25 16:31:59 +00:00
Matthijs Mekking
8602beecd1 Replace keystore attach/detach with ISC_REFCOUNT_IMPL/ISC_REFCOUNT_DECL
This is now the default way to implement attaching to/detaching from
a pointer.

Also update cfg_keystore_fromconfig() to allow NULL value for the
keystore pointer. In most cases we detach it immediately after the
function call.
2024-01-25 15:37:40 +01:00
Matthijs Mekking
2615b8a8b5 Update pkcs11 documentation
Update the minimum required version of pkcs11-provider that contains the
fixes needed in order to make it work with dnssec-policy.

Update documentation to not recommend using engine_pkcs11 in conjunction
with dnssec-policy.
2024-01-25 15:37:40 +01:00
Matthijs Mekking
daaa70f48b Refactor dns_keystore_directory()
Add a default key-directory parameter to the function that can
be returned if there is no keystore, or if the keystore directory
is NULL (the latter is also true for the built-in keystore).
2024-01-25 15:37:40 +01:00
Matthijs Mekking
cb12b42839 Rename "uri" to "pkcs11-uri"
The name "uri" was considered to be too generic and could potentially
clash with a future URI configuration option. Renamed to "pkcs11-uri".

Note that this option name was also preferred over "pkcs11uri", the
dash is considered to be the more clearer form.
2024-01-25 15:37:40 +01:00
Matthijs Mekking
624034125f Add test case with special characters in zone name
Add a zone to the system test that has special characters to
ensure it does not mess up PKCS#11 labels when creating keys.
2024-01-25 15:37:40 +01:00
Matthijs Mekking
934d17255e Better PKCS#11 label creation
When using the same PKCS#11 URI for a zone that uses different
DNSSEC policies, the PKCS#11 label could collide, i.e. the same
label could be used for different keys. Add the policy name to
the label to make it more unique.

Also, the zone name could contain characters that are interpreted
as special characters when parsing the PKCS#11 URI string. Mangle
the zone name through 'dns_name_tofilenametext()' to make it
PKCS#11 safe.

Move the creation to a separate function for clarity.

Furthermore, add a log message whenever a PKCS#11 object has been
successfully created.
2024-01-25 15:37:40 +01:00
Matthijs Mekking
89cf3049d4 Test dnssec-policy/hsm with multiple views
Add test cases for zones in different views that are using PKCS#11
tokens to store its keys.

If it is using the same DNSSEC policy, only one PKCS#11 token should be
created and the same key should be used for the zone in both views.

If it is using a different DNSSEC policy, multiple PKCS#11 token should
be created and each view should use their respective key.
2024-01-25 15:37:40 +01:00
Matthijs Mekking
dd6cfb464f Remove "error reading" grep from kasp system test
This log may still occur if there is a DNSKEY in the unsigned zone.
This may happen in a multi-signer setup for example.

Ideally this should not log a warning, but that requires looking up
keys a different way (by searching for key files only). However, that
requires adapting a bunch of system tests, and is out of scope for now.
2024-01-25 15:37:40 +01:00
Matthijs Mekking
c59c2ac85f Minor fixes in enginepkcs11 system test
- Shell function body should be in between curly braces.
- Some erroneous '|| return 1' are replaced with '|| ret=1'.
- Fix a variable name (was 'ret', should be '_ret').
- Clean up when setting up a new test.
2024-01-25 15:37:40 +01:00
Matthijs Mekking
1ac02b0f1d The use of isc_dir_t in keymgr is not needed
The internal keymgr used 'isc_dir_open(&dir)' and 'isc_dir_close(&dir)',
but was not using the variable 'dir`, other than checking if the
directory can be opened. Errors like these will be be caught already
in the dst_api function calls.
2024-01-25 15:37:40 +01:00
Matthijs Mekking
750536f74d No longer need to get generated key from label
The pkcs11-provider did not yet support getting X/Y coordinates
on newly generated EC PKEY keys, thus we attempted to get the
key from the label after it was generated in the keystore.

This has been fixed in:

  https://github.com/latchset/pkcs11-provider/pull/293

Thus now we should be able to use the generated key structure
immediately.
2024-01-25 15:37:40 +01:00
Matthijs Mekking
2e9fd6d0c1 Only run pkcs11engine test if pkcs11-provider is available
The bullseye and bookworm images are not set up with pkcs11-provider,
so we need to add an additional prerequisite for running the
pkcs11engine test. Check the path of OPENSSL_CONF.
2024-01-25 15:37:40 +01:00
Matthijs Mekking
62e7cc66d0 Specify key usage to be digital signature
If not set, the created keys allows signing plus decrypt which is bad
practice. Setting the key usage explicitly will generate keys that
allow only signing.
2024-01-25 14:48:07 +01:00
Matthijs Mekking
1e88bb0186 Create keys with PKCS#11 URI instead of object
The pkcs11-provider has changed to take a PKCS#11 URI instead of an
object identifier. Change the BIND 9 code accordingly to pass through
the label instead of just the object identifier.

See: https://github.com/latchset/pkcs11-provider/pull/284
2024-01-25 14:48:07 +01:00
Matthijs Mekking
3dff3eac0a Fix tsan errors
When working internally on the zone, we can access the zone's
variables directly.
2024-01-25 14:48:07 +01:00
Matthijs Mekking
18b566ccea Refactor findzonekeys
Move dns_dnssec_findzonekeys from the dnssec.{c,h} source code to
zone.{c,h} (the header file already commented that this should be done
inside dns_zone_t).

Alter the function in such a way, that keys are searched for in the
key stores if a 'dnssec-policy' (kasp) is attached to the zone,
otherwise keep using the zone's key-directory.
2024-01-25 14:48:07 +01:00
Matthijs Mekking
b0f14a604d dnssec-keygen: -K keydir takes priority
When using dnssec-policy with dnssec-keygen in combination with setting
the key-directory on the command line, the commandline argument takes
priority over the key-directory from the default named.conf.
2024-01-25 14:48:07 +01:00
Matthijs Mekking
224a6a6cf8 Add documentation for key-store
Add grammar and statement sections to the ARM. Add a note about
when changing dnssec-policy you should take into account the key
directory paths.
2024-01-25 14:48:07 +01:00
Matthijs Mekking
006bc4e1a7 Add CHANGES and release note for #1129
Newsworthy.
2024-01-25 14:48:06 +01:00
Matthijs Mekking
4b5bba3a99 Test dnssec-policy with multiple key stores
Make sure that if a dnssec-policy uses multiple key stores, the keys
have the right attributes and are stored in their appropriate directory.
2024-01-25 14:47:44 +01:00
Matthijs Mekking
118e545045 Add support for key-store to dnssec-keygen
If the provided policy in the configuration file uses a key-store,
use that to generate the key, instead of 'dst_key_generate()'.
2024-01-25 14:47:43 +01:00
Matthijs Mekking
49b668171a Test key-store with non-default directory
Add a test case where dnssec-policy uses key stores with a directory
other than the zone's key-directory.

This requires changing the kasp shell script to take into account that
keys can be in different directories. When looking for keys, the
'find' command now takes a maxdepth of 3 to also look for keys in
subdirectories. Note this maxdepth value is arbitrary, the added
'keystore.kasp' test only requires a maxdepth of 2.

Because of this change, the dnssec-keygen tests no longer work because
they are for the same zone (although different directories). Change
the test to use a different zone ('kasp2' instead of 'kasp').
2024-01-25 14:47:43 +01:00
Matthijs Mekking
80387532cd Use dst_key's directory when writing key files
When writing key files to disk, use the internally stored directory.

Add an access function 'dst_key_directory()'.

Most calls to keymgr functions no longer need to provide the
key-directory value. Only 'dns_keymgr_run' still needs access to
the zone's key-directory in case the key-store is set to the built-in
key-directory.
2024-01-25 14:47:43 +01:00
Matthijs Mekking
0701a140d3 Add directory to dst_key structure
Store key directory when reading the key from file. This is the
directory it was read from and can be used when saving the key back
to disk.
2024-01-25 14:41:25 +01:00