Commit Graph

36804 Commits

Author SHA1 Message Date
Mark Andrews
c549249cb9 CHANGES note for [GL #3469] 2022-07-25 10:32:47 -04:00
Mark Andrews
cd3f00874f Check that we can verify a signature at initialisation time
Fedora 33 doesn't support RSASHA1 in future mode.  There is no easy
check for this other than by attempting to perform a verification
using known good signatures.  We don't attempt to sign with RSASHA1
as that would not work in FIPS mode.  RSASHA1 is verify only.

The test vectors were generated using OpenSSL 3.0 and
util/gen-rsa-sha-vectors.c.  Rerunning will generate a new set of
test vectors as the private key is not preserved.

e.g.
	cc util/gen-rsa-sha-vectors.c -I /opt/local/include \
		-L /opt/local/lib -lcrypto
2022-07-25 10:32:13 -04:00
Matthijs Mekking
2d3ba87808 Merge branch '3462-rndc-dumpdb-expired-doesnt-always-work' into 'main'
Fix rndc dumpdb -expired for stuck cache contents

Closes #3462

See merge request isc-projects/bind9!6596
2022-07-25 14:27:08 +00:00
Matthijs Mekking
44bbc0175c Add change entry and release note for #3462
News worthy.
2022-07-25 16:05:29 +02:00
Matthijs Mekking
930ba2c914 Fix rndc dumpdb -expired for stuck cache contents
The command 'rndc dumpdb -expired' will include expired RRsets in the
output, but only for the RBTDB_VIRTUAL time (of 5 minutes). This means
that if there is a cache cleaning problem and contents are not cleaned
up, the rndc command has little diagnostic value. Fix this by including
all RRsets in the dumpdb output if the '-expired' flag is set.
2022-07-25 16:05:21 +02:00
Arаm Sаrgsyаn
8920cfa945 Merge branch '3419-dig-nssearch-query-failure-robustness' into 'main'
Fix DiG query error handling robustness in NSSEARCH mode

Closes #3419

See merge request isc-projects/bind9!6484
2022-07-22 10:11:14 +00:00
Aram Sargsyan
e038970872 Add CHANGES note for [GL #3419] 2022-07-22 09:37:05 +00:00
Aram Sargsyan
76bee507b7 dig +nssearch: send more queries even if setting up one of them fails
In the NSSEARCH followup lookup, when one of the queries fails to be
set up (UDP) or connected (TCP), DiG doesn't start the next query.
This is a mistake, because in NSSEARCH mode the queries are independent
and DiG shouldn't stop the lookup process just because setting up (or
connecting to) one of the name servers returns an error code in the
`udp_ready()` or `tcp_connected()` callbacks.

Write a new `nssearch_next()` function which takes care of starting the
next query in NSSEARCH mode, so it can be used in several places without
code repetition.

Make sure that the `udp_ready()` and `tcp_connected()` functions call
`nssearch_next()` in case they won't be calling `send_udp()` and
`send_tcp()` respectively, because in that case the `send_done()`
callback, which usually does the job, won't be called.

Refactor `send_done()` to use the newly written `nssearch_next()`
function.
2022-07-22 09:37:05 +00:00
Aram Sargsyan
49ac879dfa dig +nssearch: send more queries even if sending the previous one fails
In the NSSEARCH followup lookup, when one of the queries fails to be
sent, DiG doesn't start the next query. This is a mistake, because in
NSSEARCH mode the queries are independent and DiG shouldn't stop the
lookup process just because sending a query to one of the name servers
returns an error code.

Restructure the `send_done()` function to unconditionally send the next
query in NSSEARCH mode, if it exists.
2022-07-22 09:26:25 +00:00
Arаm Sаrgsyаn
60731b4a28 Merge branch '3407-dighost-udp-fail-over-other-nameservers' into 'main'
Fix DiG query retry and fail-over issues

Closes #3407

See merge request isc-projects/bind9!6462
2022-07-22 09:20:35 +00:00
Aram Sargsyan
a5b2aa7c97 Suppress warning/error comments in dig outputs for "rrsetorder" test
In the CI dig sometimes produces warning/error comments when
communicating with the server, which produces problems when comparing
the outputs.

Here is an example of a dig output with a warning message which
is benign, because dig, after a retry, managed to query the server.

;; communications error to 10.53.0.3#7529: timed out
1.2.3.1
1.2.3.2
1.2.3.3
1.2.3.4

When comparing this to the expected output, which doesn't contain
the comment line (starting with double ';'), the outputs don't match.

Use grep inverse logic to strip the comments from the dig outputs.
2022-07-22 08:35:35 +00:00
Aram Sargsyan
1554faa476 Add CHANGES note for [GL #3407] 2022-07-22 08:35:35 +00:00
Aram Sargsyan
626fbf325e Add "digdelv" test to simulate DiG network unreachable error
There are existing tests for simulating timeouts, read errors, and
refused connecion errors. Implement also "network unreachable"
simulation.

Use "fixed" string search mode `-F` for `grep` in more places where
it is appropriate to do so.
2022-07-22 08:35:35 +00:00
Aram Sargsyan
abfd0d363f DiG: use the same retry and fail-over logic for different failure types
DiG implements different logic in the `recv_done()` callback function
when processing a failure:

1. For a timed-out query it applies the "retries" logic first, then,
   when it fails, fail-overs to the next server.

2. For an EOF (end-of-file, or unexpected disconnect) error it tries to
   make a single retry attempt (even if the user has requested more
   retries), then, when it fails, fail-overs to the next server.

3. For other types of failures, DiG does not apply the "retries" logic,
   and tries to fail-over to the next servers (again, even if the user
   has requested to make retries).

Simplify the logic and apply the same logic (1) of first retries, and
then fail-over, for different types of failures in `recv_done()`.
2022-07-22 08:35:35 +00:00
Aram Sargsyan
c2329dd110 Fix DiG query retry and fail-over bug
When the `send_done()` callback function gets called with a failure
result code, DiG erroneously cancels the lookup.

Stop canceling the lookup and give DiG a chance to retry the failed
query, or fail-over to another server, using the logic implemented in
the `recv_done()` callback function.
2022-07-22 08:35:35 +00:00
Aram Sargsyan
3f31085525 Fix DiG UDP query retry and fail-over bug
When the `udp_ready()` callback function gets called with a failure
result code, DiG erroneously cancels the lookup.

Copy the logic behind `tcp_connected()` callback function into
`udp_ready()` so that DiG will now retry the failed query (if retries
are enabled) and then, if it fails again, it will fail-over to the next
server in the list, which synchronizes the behavior between TCP and UDP
modes.

Also, `udp_ready()` was calling `lookup_detach()` without calling
`lookup_attach()` first, but the issue was masked behind the fact
that `clear_current_lookup()` wasn't being called when needed, and
`lookup_detach()` was compensating for that. This also has been fixed.
2022-07-22 08:34:32 +00:00
Petr Špaček
e918825cd5 Merge branch 'pspacek/arm-zombie-support' into 'main'
Support ancient build tools for the ARM

See merge request isc-projects/bind9!6598
2022-07-21 13:25:51 +00:00
Petr Špaček
8796ad7fe8 Support Sphinx 1.6.7
Luckily we don't rely on SphinxDirective functionality which does not
exist in 1.6.7. Replace it with docutils Directive.

transform_content() callback was added only in Sphinx 3.0.0.
Detect if it was not called and call it manually.
The transform_content() function requires access to inner "contentnode"
which is created inside run(). This workaround relies on the order of
node as it was in the pre-3.0.0 versions, but it should not matter as
new versions will not trigger the workaround.
2022-07-21 15:21:21 +02:00
Petr Špaček
af5bbb433a Support docutils 0.14+dfsg-4
Ancient versions of docutils cannot cope with bare text inside a table
cell. Wrap text in a paragraph to work around that.
2022-07-21 15:21:21 +02:00
Petr Špaček
fef6111172 Merge branch 'pspacek/minor-arm-tweaks-and-fixes' into 'main'
Fix dnssec-signzone examples in DNSSEC Guide

See merge request isc-projects/bind9!6589
2022-07-21 13:18:06 +00:00
Petr Špaček
beae857288 Avoid opt-out flag in dnssec-signzone examples
Since !6413 we discourage opt-out, so we should not be advertising it in
the examples. Even worse, it was just thrown into the command line
without even mentioning its meaning in the surrounding text.

Related: !6413
2022-07-21 15:12:06 +02:00
Petr Špaček
1ab564d605 Remove errorneous shell output redirection from dnssec-signzone example
The > looked like shell output redirection. It was present since we
imported DNSSEC Guide into the ARM.
2022-07-21 15:12:03 +02:00
Michal Nowak
f80256da4a Merge tag 'v9_19_3'
BIND 9.19.3
2022-07-21 11:48:25 +02:00
Evan Hunt
4eec9f4402 Merge branch '2918-deprecate-max-zone-ttl' into 'main'
mark max-zone-ttl deprecated in options and zone

Closes #2918

See merge request isc-projects/bind9!6542
2022-07-20 19:24:18 +00:00
Evan Hunt
8c8c648395 CHANGES and release note for [GL #2918] 2022-07-20 11:57:41 -07:00
Evan Hunt
bbd159349a Forbid zones with both dnssec-policy and max-zone-ttl
Since max-zone-ttl in zone/view/options is a no-op if dnssec-policy
is in use, let's make that a fatal error.
2022-07-20 11:57:37 -07:00
Matthijs Mekking
a130737ea5 Reject zones with TTL higher than dnssec-policy max-zone-ttl
Reject loading of zones with TTL higher than the max-zone-ttl
from the dnssec-policy.

With this change, any zone with a dnssec-policy in use will ignore
the max-zone-ttl option in zone/view/options.
2022-07-20 11:55:07 -07:00
Matthijs Mekking
c52a82cbd9 Test dnssec-policy max-zone-ttl rejects zone with too high TTL
Similar to the 'max-zone-ttl' zone option, the 'dnssec-policy' option
should reject zones with TTLs that are out of range.
2022-07-20 11:55:07 -07:00
Evan Hunt
71d6752544 mark max-zone-ttl deprecated in options and zone
The "max-zone-ttl" option should now be configured as part of
"dnssec-policy". The option with the same name in "zone" and
"options" is hereby flagged as deprecated, and its functionality
will be removed in a future release.
2022-07-20 11:55:03 -07:00
Mark Andrews
2c3eea1917 Merge branch 'marka-placeholder' into 'main'
Add placeholder for [GL #3460]

See merge request isc-projects/bind9!6594
2022-07-19 02:45:11 +00:00
Mark Andrews
2e49dd0a34 Add placeholder for [GL #3460] 2022-07-19 12:39:29 +10:00
Petr Špaček
dce9614ffd Merge branch 'ron-server' into 'main'
ARM tagging: logging, server, view, zone

See merge request isc-projects/bind9!6535
2022-07-18 16:26:16 +00:00
Greg Choules
9a69b4b883 Document qname-minimization off equals disabled 2022-07-18 18:22:01 +02:00
Suzanne Goldlust
493578bebe Fix http block short description 2022-07-18 18:21:42 +02:00
Suzanne Goldlust
7a9a388e86 Add headings for server, logging, zone, and view statements 2022-07-18 18:16:33 +02:00
Suzanne Goldlust
72082e653d Add tags/short descriptions for the "view" category 2022-07-18 18:16:33 +02:00
Suzanne Goldlust
c742c46d2c Add tags/short descriptions for "zone" category 2022-07-18 18:16:33 +02:00
Suzanne Goldlust
7e19ef6af6 Add tags/short descriptions for "logging" category 2022-07-18 18:10:44 +02:00
Suzanne Goldlust
c55056597c Add tags and short descriptions for tag "server" 2022-07-18 18:10:44 +02:00
Michał Kępień
8c0bb8dd44 Merge branch 'michal/run-a-short-respdiff-test-for-all-merge-requests' into 'main'
Run a short respdiff test for all merge requests

See merge request isc-projects/bind9!6585
2022-07-18 13:16:01 +00:00
Michał Kępień
31ee43a314 Run a short respdiff test for all merge requests
Now that the respdiff tests can detect memory leaks, it is worth running
them for every merge request.  However, the existing respdiff-based
tests take a while to complete (about half an hour with our current CI
infrastructure), which does not make them a good fit for this purpose.
Add a new GitLab CI job, "respdiff-short", which uses a smaller query
set that gets processed within a couple of minutes on our current CI
infrastructure.  Rename the existing respdiff-based jobs to make
distinguishing them easier.
2022-07-18 14:39:02 +02:00
Michał Kępień
ca20a189f7 Extract respdiff job definition to a YAML anchor
Ensure the common parts of all jobs using respdiff are available in the
form of a reusable YAML anchor, to reduce code duplication and to
simplify adding more respdiff-based jobs to GitLab CI.
2022-07-18 14:39:02 +02:00
Michał Kępień
ab90a4705a Use a pre-built executable as the reference named
The "respdiff" GitLab CI job compares DNS responses produced by the
current version of named with those produced by a reference version.
The latter is built from source in each "respdiff" job, despite the fact
that the reference version changes very rarely.  Use a pre-built named
executable as the reference version instead, assuming it is available in
the OS image used for "respdiff" tests.
2022-07-18 14:39:02 +02:00
Ondřej Surý
858732d08b Merge branch 'ossl-fixes' into 'main'
Clean up OpenSSL usage a bit

See merge request isc-projects/bind9!6436
2022-07-18 12:14:34 +00:00
David Benjamin
e819866a2d Remove DH_clear_flags call
These calls have not been needed since OpenSSL 0.9.7h.

This dates to commit 704d6eeab1, "Work
around non-reentrancy in openssl by disabling precomputation in keys".
This was in the bundled OpenSSL 0.9.3a era and made two changes. First,
it registered a locking callback because, in those days, OpenSSL needed
a callback to support locks. Second, it set flags to disable various
bits of cached state on DH, DSA, and RSA objects.

Looking back in OpenSSL 0.9.3a, that cached state was not protected by a
lock:
https://github.com/openssl/openssl/blob/OpenSSL_0_9_3a/crypto/rsa/rsa_eay.c#L137-L142

However, this was fixed in OpenSSL 0.9.7h:
6ec8e63af6

The other flags (DSA and RSA) have since fallen away, DSA with the
removal of DSA altogether (3994b1f9c2) and
RSA with 3a8d4a316e, "openssl 0.9.6a and
higher don't have the RSA locking bug [...] other algorithms still don't
do locking when performing precomputation [...]".

That seems to be referring to this OpenSSL change, which indeed fixed it
for RSA but not others:
bb617a9646

The 0.9.7h change above fixed it across the board, but there was never a
similar update to the workaround for DSA and DH. With such OpenSSL
versions long since out of support, the last remains of this workaround
can finally be removed.
2022-07-18 13:38:47 +02:00
David Benjamin
f607cad47a Simplify BN_GENCB handling
When callback was NULL, bind9 would use BN_GENCB_set_old to set a NULL
callback because OpenSSL happened to allow a NULL "old" callback, but
not a NULL "new" callback. Instead, the way to turn off the callback is
to pass a NULL BN_GENCB itself.

Switch to doing that.
2022-07-18 13:38:44 +02:00
Ondřej Surý
04d6363a64 Merge branch '3453-cope-with-too-small-BUFSIZ' into 'main'
Increase the BUFSIZ-long buffers

Closes #3453

See merge request isc-projects/bind9!6579
2022-07-15 17:30:03 +00:00
Ondřej Surý
b19d932262 Increase the BUFSIZ-long buffers
The BUFSIZ value varies between platforms, it could be 8K on Linux and
512 bytes on mingw.  Make sure the buffers are always big enough for the
output data to prevent truncation of the output by appropriately
enlarging or sizing the buffers.
2022-07-15 10:33:46 +00:00
Michał Kępień
d0f6d309e3 Merge branch '3443-memory-related-cleanups' into 'main'
Memory-related cleanups

Closes #3443

See merge request isc-projects/bind9!6567
2022-07-15 08:31:23 +00:00
Michał Kępień
f0c31ceb3b Update documentation for named's -M option
Remove "external" from the list of legal values for the -M command-line
option as it has not been allowed since the internal memory allocator
was removed by commit 55ace5d3aa.

Make the style of the relevant paragraph more in line with the next one
and split its contents up into an unordered list of options for improved
readability.
2022-07-15 10:23:03 +02:00