Commit Graph

38795 Commits

Author SHA1 Message Date
Matthijs Mekking
47f7cb0a36 Add two checkds test servers
Add two new checkds test servers, that are hidden secondaries (hidden
as in not published in the NS RRset), that can be used specifically
for testing explicitly configured parental-agents.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
a921cabb8c Remove obsoleted checkds test name servers
These resolver based parental-agents have been replaced by ns3.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
148ce1f678 Add CHANGES and release notes for #3901
This is a new feature that deserves attention.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
e72b0df50b Implement auto parental-agents (checkds yes)
Implement the new feature, automatic parental-agents. This is enabled
with 'checkds yes'.

When set to 'yes', instead of querying the explicit configured
parental agents, look up the parental agents by resolving the parent
NS records. The found parent NS RRset is considered to be the list
of parental agents that should be queried during a KSK rollover,
looking up the DS RRset corresponding to the key signing keys.

For each NS record, look up the addresses in the ADB. These addresses
will be used to send the DS requests. Count the number of servers and
keep track of how many good DS responses were seen.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
dc651cbf3f Add test case with no empty non-terminals
The previous test cases already test the more complex case where there
are empty non-terminals between the child apex and the parent domain.

Add a test case where this is not the case, to execute the other code
path.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
a2735810d9 Add test cases for 'checkds no'
Add test cases for when checkds is disabled. Copy the test cases that
would have resulted in a DSPublish or DSRemoved and make sure that
with 'checkds no' the metadata is not set.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
6bb862d10f Add test cases for 'checkds yes'
Add the test cases for automatic parental-agents, i.e. when 'checkds'
is set to 'yes'. Split out the special cases that use a reference
or a resolver as parental-agent so that the common use cases can be
tested with the same function.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
226b6e385e Update checkds system test
Make the checkds system test more structured with the many more test
cases to come. Add a README for clarity.

Update the 'has_signed_apex_nsec' helper function so it can take any
domain name regardless of the number of labels.

Change the DNS tree structure such that we have different TLD names
for the various test scenarios, because we need servers that respond
differently to DS queries. Note that this isn't applicable to the
existing "checkds explicit" test cases, but is preparation work for
testing "checkds yes" (automatic parental agents).

Add a trust-anchor to the server that will be querying for parent
NS records.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
d842adb23f Update documenation for 'checkds' option
Add text about the 'checkds' option in the ARM reference and
DNSSEC guide.
2023-04-03 14:01:22 +00:00
Matthijs Mekking
06cd8b52db Add new 'checkds' configuration option
Add a new configuration option to set how the checkds method should
work. Acceptable values are 'yes', 'no', and 'explicit'.

When set to 'yes', the checkds method is to lookup the parental agents
by querying the NS records of the parent zone.

When set to 'no', no checkds method is enabled. Users should run
the 'rndc checkds' command to signal that DS records are published and
withdrawn.

When set to 'explicit', the parental agents are explicitly configured
with the 'parental-agents' configuration option.
2023-04-03 14:01:22 +00:00
Ondřej Surý
7d0b88ebb0 Merge branch '3930-gcc-12-static-analyzer-warning-dereference-of-null-in-in-siphash-c' into 'main'
Resolve "GCC 12 static analyzer: warning: dereference of NULL 'in' in siphash.c"

Closes #3930

See merge request isc-projects/bind9!7656
2023-04-03 13:32:53 +00:00
Mark Andrews
bf58c10dce Silence NULL pointer dereferene false positive
Only attempt to digest 'in' if it is non NULL.  This will prevent
false positives about NULL pointer dereferences against 'in' and
should also speed up the processing.
2023-04-03 13:32:40 +00:00
Ondřej Surý
94e42daa0f Merge branch '3974-rpz-testlib-test-data-c-compilation-fails-on-openbsd' into 'main'
Resolve "rpz/testlib/test-data.c compilation fails on OpenBSD"

Closes #3974

See merge request isc-projects/bind9!7748
2023-04-03 13:32:32 +00:00
Mark Andrews
da999a7a1b Define and use DLOPEN_LIBS 2023-04-03 13:31:56 +00:00
Mark Andrews
30b9ebfa2c Handle old <arpa/nameser.h> with old API
Define the types and classes we use from the new API.
2023-04-03 13:31:56 +00:00
Ondřej Surý
8c475a1d31 Merge branch 'artem-streamdns-avoid-copying-on-reading' into 'main'
Stream DNS: try to handle incoming data directly - avoid memory copying/buffer resizing when reading data

See merge request isc-projects/bind9!7280
2023-04-03 13:31:51 +00:00
Artem Boldariev
2b3a3c21dc Stream DNS: avoid memory copying/buffer resizing when reading data
This commit optimises isc_dnsstream_assembler_t in such a way that
memory copying and reallocation are avoided when receiving one or more
complete DNS messages at once. We try to handle the data from the
messages directly, without storing them in an intermediate memory
buffer.
2023-04-03 13:31:46 +00:00
Ondřej Surý
33a0588113 Merge branch '3990-remove-dead-code-from-dst_api' into 'main'
Eliminate the dead code in dst_api.c

Closes #3990

See merge request isc-projects/bind9!7773
2023-04-03 13:29:52 +00:00
Ondřej Surý
766366e934 Eliminate the dead code in dst_api.c
In write_public_key() and write_key_state(), there were left-over checks
for result, that were effectively dead code after the last refactoring.
Remove those.
2023-04-03 14:09:13 +02:00
Tony Finch
c74f389100 Merge branch 'fanf-histo' into 'main'
Add isc_histo histograms, and use it for message size statistics

Closes #3464

See merge request isc-projects/bind9!7696
2023-04-03 11:41:25 +00:00
Tony Finch
fdcbbc2a20 CHANGES note for [GL !7696]
[func]		Add isc_histo_t general-purpose log-linear histograms,
		and use them for message size statistics.
2023-04-03 12:08:37 +01:00
Tony Finch
0d353704fb Use isc_histo for the message size statistics
This should have no functional effects.

The message size stats are specified by RSSAC002 so it's best not
to mess around with how they appear in the statschannel. But it's
worth changing the implementation to use general-purpose histograms,
to reduce code size and benefit from sharded counters.
2023-04-03 12:08:05 +01:00
Tony Finch
2354e56ebb Remove obsolete code from dns_stats
It became obsolete in 2008
2023-04-03 12:08:05 +01:00
Tony Finch
cd0e7f853a Simplify histogram quantiles
The `isc_histosummary_t` functions were written in the early days of
`hg64` and carried over when I brought `hg64` into BIND. They were
intended to be useful for graphing cumulative frequency distributions
and the like, but in practice whatever draws charts is better off with
a raw histogram export. Especially because of the poor performance of
the old functions.

The replacement `isc_histo_quantiles()` function is intended for
providing a few quantile values in BIND's stats channel, when the user
does not want the full histogram. Unlike the old functions, the caller
provides all the query fractions up-front, so that the values can be
found in a single scan instead of a scan per value. The scan is from
larger values to smaller, since larger quantiles are usually more
interesting, so the scan can bail out early.
2023-04-03 12:08:05 +01:00
Tony Finch
bc2389b828 Add per-thread sharded histograms for heavy loads
Although an `isc_histo_t` is thread-safe, it can suffer
from cache contention under heavy load. To avoid this,
an `isc_histomulti_t` contains a histogram per thread,
so updates are local and low-contention.
2023-04-03 12:08:05 +01:00
Tony Finch
82213a48cf Add isc_histo for histogram statistics
This is an adaptation of my `hg64` experiments for use in BIND.

As well as renaming everything according to ISC style, I have
written some more extensive tests that ensure the edge cases are
correct and the fenceposts are in the right places.

I have added utility functions for working with precision in terms of
decimal significant figures as well as this code's native binary.
2023-04-03 12:08:05 +01:00
Ondřej Surý
4c7e773a31 Merge branch '3710-properly-document-DF-flag-on-outbound-UDP' into 'main'
Clarify the documentation about DF-flag

Closes #3710

See merge request isc-projects/bind9!7770
2023-04-03 10:28:47 +00:00
Ondřej Surý
d5921fafed Add CHANGES note for [GL #3710] 2023-04-03 10:28:43 +00:00
Ondřej Surý
61f276d5a4 Clarify the documentation about DF-flag
Remove the reference to setting the DF-flag as we don't do that right
now.  Rephrase the paragraph that the default value should not be
causing fragmentation.
2023-04-03 10:28:43 +00:00
Ondřej Surý
5e6ed08ac2 Merge branch 'ondrej/replace-DE_CONST-with-simpler-UNCONST' into 'main'
Replace DE_CONST(k, v) with v = UNCONST(k) macro

See merge request isc-projects/bind9!7760
2023-04-03 10:26:02 +00:00
Ondřej Surý
3a6a0fa867 Replace DE_CONST(k, v) with v = UNCONST(k) macro
Replace the complicated DE_CONST macro that required union with much
simple reference-dereference trick in the UNCONST() macro.
2023-04-03 10:25:56 +00:00
Ondřej Surý
2351c746a9 Merge branch 'ondrej/cleanup-windows-bits' into 'main'
Cleanup the last Windows / MSC ifdefs and comments

See merge request isc-projects/bind9!7754
2023-04-03 09:06:27 +00:00
Ondřej Surý
4ec9c4a1db Cleanup the last Windows / MSC ifdefs and comments
Cleanup the remnants of MS Compiler bits from <isc/refcount.h>, printing
the information in named/main.c, and cleanup some comments about Windows
that no longer apply.

The bits in picohttpparser.{h,c} were left out, because it's not our
code.
2023-04-03 09:06:20 +00:00
Tom Krizek
01218f16e2 Merge branch '3915-check-dig-output-for-errors' into 'main'
Find errors in dig output in system tests

Closes #3915

See merge request isc-projects/bind9!7679
2023-04-03 08:50:01 +00:00
Tom Krizek
940e160c06 Find errors in dig output in system tests
Facilitate faster system test failure identification and debugging by
checking any dig outputs for errors, which are typically indicative of
CI runner network / load issues.
2023-04-03 10:25:31 +02:00
Mark Andrews
18f7d954dc Merge branch 'mnowak/fix-fips-in-tests' into 'main'
FIPS fixes and enhancements

See merge request isc-projects/bind9!4281
2023-04-03 04:30:43 +00:00
Mark Andrews
5e68be6a03 Disable leak detection in FIPS mode 2023-04-03 12:44:27 +10:00
Mark Andrews
2abd6c7ab4 Handle MD5 not being supported by lib crypto
When initialising the message digests in lib/isc/md.c no
longer assume that the initialisation cannot fail.
2023-04-03 12:44:27 +10:00
Mark Andrews
f138a1447a forward: Check if TLS is working in FIPS mode
Skip test that depend on TLS working in FIPS mode
2023-04-03 12:44:27 +10:00
Mark Andrews
a3172c8f9c Don't check for OPENSSL_cleanup failures by default
OPENSSL_cleanup is supposed to free all remaining memory in use
provided the application has cleaned up properly.  This is not the
case on some operating systems.  Silently ignore memory that is
freed after OPENSSL_cleanup has been called.
2023-04-03 12:44:27 +10:00
Mark Andrews
97627c554b Test whether the crypto library supports the HMAC algorithm
When initialising HMAC support check that the crypto library
supports the algorithm rather than just assuming it is supported.
2023-04-03 12:44:27 +10:00
Mark Andrews
ffebd217f5 make feature-test --md5 --with-fips aware 2023-04-03 12:44:27 +10:00
Mark Andrews
4c5de4f15c Cleanup on error paths
Rather that call 'exit' cleanup on error paths as that allows OpenSSL
to cleanup properly in its exit handlers.
2023-04-03 12:44:27 +10:00
Mark Andrews
e029803704 Handle fatal and FIPS provider interactions
When fatal is called we may be holding memory allocated by OpenSSL.
This may result in the reference count for the FIPS provider not
going to zero and the shared library not being unloaded during
OPENSSL_cleanup.  When the shared library is ultimately unloaded,
when all remaining dynamically loaded libraries are freed, we have
already destroyed the memory context we where using to track memory
leaks / late frees resulting in INSIST being called.

Disable triggering the INSIST when fatal has being called.
2023-04-03 12:44:27 +10:00
Mark Andrews
4e7dadd205 get_algorithms.py: use FIPS compatible bit size
The minimum RSA key size that can be used in FIPS mode is 2048 bits.
2023-04-03 12:44:27 +10:00
Mark Andrews
c80ccf5a25 nsupdate: tls does not work in FIPS mode prior to OpenSSL 3.0.0 2023-04-03 12:44:27 +10:00
Mark Andrews
b82811d0b5 check that 'dnssec-signzone -F' fails for rsasha1 2023-04-03 12:44:27 +10:00
Mark Andrews
826e2563b3 wildcard: Require hypothesis 4.41.2 or greater for FIPS compliance
hypothesis prior to 4.41.2 uses hashlib.md5 which is not FIPS
compliant causing the wildcard system test to fail.  Check if
we are running if FIPS mode and if so make the minimum version
of hypothesis we will accept to be 4.41.2.
2023-04-03 12:44:27 +10:00
Mark Andrews
5da1fb25b1 upforwd: use FIPS compatible key size
Don't override the default key size.
2023-04-03 12:44:27 +10:00
Mark Andrews
56d2bf1141 tsiggss: regenerate kerberos credentials
The existing set of kerberos credential used deprecated algorithms
which are not supported by some implementations in FIPS mode.
Regenerate the saved credentials using more modern algorithms.

Added tsiggss/krb/setup.sh which sets up a test KDC with the required
principals for the system test to work.  The tsiggss system test
needs to be run once with this active and KRB5_CONFIG appropriately.
set.  See tsiggss/tests.sh for an example of how to do this.
2023-04-03 12:44:27 +10:00