2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00
Commit Graph

39168 Commits

Author SHA1 Message Date
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
Mark Andrews
c3ba38f89f tsiggss: skip test in FIPS mode when DH is broken
'tsiggss' depends on a working DH implementation.  This is not
properly supported in all FIPS implementations.
2023-04-03 12:44:27 +10:00
Mark Andrews
e8177ac605 tsig: only use FIPS compatible HMAC in FIPS mode
HMACMD5 is not permitted in FIPS mode.  Only test HMACMD5 when not
in FIPS mode.
2023-04-03 12:44:27 +10:00
Mark Andrews
175d0c6d85 tkey: skip TKEY system test in FIPS mode
TKEY uses MD5 which is incompatible with FIPS.
2023-04-03 12:44:27 +10:00
Mark Andrews
0ed16a561e rndc: don't test hmac-md5 in FIPS mode
HMACMD5 is not permitted in FIPS mode.  Only test HMACMD5 when not
in FIPS mode.
2023-04-03 12:44:27 +10:00
Mark Andrews
ff7e73db6a nsupdate: use FIPS compatible algorithms
HMACMD5 is not permitted in FIPS mode, use HMACSHA256 instead.
2023-04-03 12:44:27 +10:00
Mark Andrews
bcb3846603 nsec3: use fips configuration if rsasha1 is not supported 2023-04-03 12:44:27 +10:00
Mark Andrews
1362360e8f nsec3: skip tests that depend on RSASHA1 in FIPS mode 2023-04-03 12:44:27 +10:00
Mark Andrews
2e997e2248 doth: skip 'doth' test if FIPS mode when DH is broken
'doth' depends on a working DH implementation.
2023-04-03 12:44:27 +10:00
Mark Andrews
530142b2a1 dnssec: check that dnssec-signzone -F work with allowed algorithm 2023-04-03 12:44:27 +10:00
Mark Andrews
78764f99ca dnssec: test dnssec-keygen -F switches to FIPS mode 2023-04-03 12:44:27 +10:00
Mark Andrews
ba6ee5af50 dnssec: check if RSASHA1 is supported by the OS
If not skip RSASHA1 based system tests which are supposed to succeed
even in FIPS mode.
2023-04-03 12:44:27 +10:00
Mark Andrews
333693ddf5 dnssec: Check validation with short RSA key size FIPS mode
use a pregenerated zone signed with RSASHA1 keys at 1024 bits.
2023-04-03 12:44:27 +10:00
Mark Andrews
ed7750be56 dnssec: Check that RSASHA1 still validates in FIPS mode
Add a pregenerated RSASHA1 signed zone and verify that
answers still validate.
2023-04-03 12:44:27 +10:00
Mark Andrews
ae1109f321 dnssec: use FIPS compatible algorithms and key sizes
RSASHA1 is verify only in FIPS mode.  Use RSASHA256 instead with
key of at least 2048 bits (minimum RSA FIPS size).
2023-04-03 12:44:27 +10:00
Mark Andrews
701ffb2daa Only pass OPENSSL_CONF in the environment if it set
OPENSSL_CONF="" is treated differently to no OPENSSL_CONF in
the environment by OpenSSL.  OPENSSL_CONF="" lead to crypto
failure being reported in FIPS mode.
2023-04-03 12:44:27 +10:00
Mark Andrews
a830adff1c Allow named-checkconf to selectively check dnssec-policy algorithms
There are times where you want named-checkconf to check whether the
dnssec-policies should be constrained by the cryptographic algorithms
supported by the operation system or to just accept all possible
algorithms.  This provides a mechanism to make that selection.
2023-04-03 12:15:57 +10:00
Mark Andrews
1eaff9a670 dnssec-signzone can now enable FIPS mode from the commandline
'dnssec-signzone -F' will now enable FIPS mode if supported
by the crypto provider and not already enabled.
2023-04-03 12:07:44 +10:00
Mark Andrews
439f24fc80 dnssec-keygen: enable FIPS from the command line
'dnssec-keygen -F' will now turn on FIPS mode if supported by
the crypto provider and is not already enabled.
2023-04-03 12:06:04 +10:00
Mark Andrews
d42b636d5a named-checkconf needs to know if named will be running in FIPS mode
Call dst_lib_init to set FIPS mode if it was turned on at configure
time.

Check that named-checkconf report that dnssec policies that wont
work in FIPS mode are reported if named would be running in FIPS
mode.
2023-04-03 12:06:04 +10:00
Mark Andrews
d7cc90c032 Add --fips-provider to feature-test
Check that an FIPS provider is available.  This only works with
OpenSSL 3
2023-04-03 12:06:04 +10:00
Mark Andrews
d6d85a6a2d Add --rsasha1 to feature-test 2023-04-03 12:06:04 +10:00
Mark Andrews
6be00b3042 Add --have-fips-dh to feature-test
Diffie-Hellman key echange doesn't appear to work in FIPS mode for
OpenSSL 1.x.x.  Add feature test (--have-fips-dh) to identify builds
where DH key exchanges work (non FIPS builds and OpenSSL 3.0.0+) and
exclude test that would otherwise fail.
2023-04-03 12:06:04 +10:00
Michal Nowak
fe8b41286f Add FIPS-detecting option to feature-test helper
The '--have-fips' option of feature-test detects FIPS mode.
2023-04-03 12:06:04 +10:00
Mark Andrews
c51a39e97a Probe if ED448 and ED25519 are supported
ED448 and ED25519 may or may not be supported in FIPS mode depending
upon the implementation.
2023-04-03 12:06:04 +10:00
Mark Andrews
ba34255648 Report file and line when converting OpenSSL errors
This provides more detail about which instance of specific OpenSSL
calls that have failed by reporting the file name and line numbers
involved when dst__openssl_toresult2 and dst__openssl_toresult3 are
called.
2023-04-03 12:06:04 +10:00
Mark Andrews
2baa58c59f Report when loading of dhparam-file fails
prior to this loading of the configuration could fail without
an informative error message being logged.
2023-04-03 12:06:04 +10:00
Mark Andrews
1246fd3b5f Report when dnssec-policy has an unsupported algorithn 2023-04-03 12:06:04 +10:00