2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00
Commit Graph

33217 Commits

Author SHA1 Message Date
Evan Hunt
220bca9ebf CHANGES and release notes 2021-01-29 12:07:38 +01:00
Ondřej Surý
e488309da7 implement xfrin via XoT
Add support for a "tls" key/value pair for zone primaries, referencing
either a "tls" configuration statement or "ephemeral". If set to use
TLS, zones will send SOA and AXFR/IXFR queries over a TLS channel.
2021-01-29 12:07:38 +01:00
Matthijs Mekking
778d0c03a9 Merge branch '2442-tsan-error-lib-dns-rbtdb-c' into 'main'
Resolve "TSAN error: lib/dns/rbtdb.c"

Closes #2442

See merge request isc-projects/bind9!4609
2021-01-29 10:45:40 +00:00
Diego Fronza
c75575e350 Fix race condition on check_stale_header
This commit fix a race that could happen when two or more threads have
failed to refresh the same RRset, the threads could simultaneously
attempt to update the header->last_refresh_fail_ts field in
check_stale_header, a field used to implement stale-refresh-time.

By making this field atomic we avoid such race.
2021-01-29 10:29:51 +01:00
Matthijs Mekking
0fab6cf88e Merge branch '2434-fetch-limit-serve-stale' into 'main'
Resolve "Serve stale when fetch limits are hit"

Closes #2434

See merge request isc-projects/bind9!4607
2021-01-28 16:57:20 +00:00
Matthijs Mekking
ed8421693c Add notes and change entry for [#2434]
This concludes the serve-stale improvements.
2021-01-28 17:02:56 +01:00
Matthijs Mekking
11b74fc176 Add test for serve-stale /w fetch-limits
Add a test case when fetch-limits are reached and we have stale data
in cache.

This test starts with a positive answer for 'data.example/TXT' in
cache.

1. Reload named.conf to set fetch limits.
2. Disable responses from the authoritative server.
3. Now send a batch of queries to the resolver, until hitting the
   fetch limits. We can detect this by looking at the response RCODE,
   at some point we will see SERVFAIL responses.
4. At that point we will turn on serve-stale.
5. Clients should see stale answers now.
6. An incoming query should not set the stale-refresh-time window,
   so a following query should still get a stale answer because of a
   resolver failure (and not because it was in the stale-refresh-time
   window).
2021-01-28 16:39:30 +01:00
Matthijs Mekking
aabdedeae3 Only start stale refresh window when resuming
If we did not attempt a fetch due to fetch-limits, we should not start
the stale-refresh-time window.

Introduce a new flag DNS_DBFIND_STALESTART to differentiate between
a resolver failure and unexpected error. If we are resuming, this
indicates a resolver failure, then start the stale-refresh-time window,
otherwise don't start the stale-refresh-time window, but still fall
back to using stale data.

(This commit also wraps some docstrings to 80 characters width)
2021-01-28 16:38:34 +01:00
Matthijs Mekking
c6fd02aed5 Use stale data also if we are not resuming
Before this change, BIND will only fallback to using stale data if
there was an actual attempt to resolve the query. Then on a timeout,
the stale data from cache becomes eligible.

This commit changes this so that on any unexpected error stale data
becomes eligble (you would still have to have 'stale-answer-enable'
enabled of course).

If there is no stale data, this may return in an error again, so don't
loop on stale data lookup attempts. If the DNS_DBFIND_STALEOK flag is
set, this means we already tried to lookup stale data, so if that is
the case, don't use stale again.
2021-01-28 16:36:46 +01:00
Mark Andrews
c1c7e1ac5c Merge branch '2420-xmlfreetextwriter-could-be-called-twice' into 'main'
Resolve "CID 316510: Memory - corruptions (USE_AFTER_FREE)"

Closes #2420

See merge request isc-projects/bind9!4613
2021-01-28 05:19:53 +00:00
Mark Andrews
95114f7d60 Add CHANGES entry for [GL #2420] 2021-01-28 04:15:06 +00:00
Mark Andrews
b5cf54252a Stop xmlFreeTextWriter being called twice
xmlFreeTextWriter could be called twice if xmlDocDumpFormatMemoryEnc
failed.
2021-01-28 04:15:06 +00:00
Mark Andrews
838d3673a8 Merge branch 'marka-changes-line-length' into 'main'
Detect overly long CHANGES lines

See merge request isc-projects/bind9!4603
2021-01-28 04:06:14 +00:00
Mark Andrews
28449acded fix overly long line 2021-01-28 14:12:40 +11:00
Mark Andrews
b1ecab6383 Detect overly long CHANGES lines 2021-01-28 13:49:02 +11:00
Mark Andrews
12c5b2a1b8 Merge branch '2413-after-upgrade-to-bind9-9-16-11-named-is-killed-with-status-11-segv' into 'main'
Resolve "after upgrade to bind9 9.16.11 named is killed with status=11/SEGV"

Closes #2413

See merge request isc-projects/bind9!4592
2021-01-28 02:34:43 +00:00
Mark Andrews
79fad620a2 Add release note for [GL #2413] 2021-01-28 01:54:59 +00:00
Mark Andrews
5ec9999b28 Add CHANGES for [GL #2413] 2021-01-28 01:54:59 +00:00
Mark Andrews
3dee62cfa5 Add a named acl example 2021-01-28 01:54:59 +00:00
Mark Andrews
a8b55992a8 Require 'ctx' to be non-NULL in cfg_acl_fromconfig{,2} 2021-01-28 01:54:59 +00:00
Mark Andrews
2b3fcd7156 Pass an afg_aclconfctx_t structure to cfg_acl_fromconfig
in named_zone_inlinesigning.  A NULL pointer does not work.
2021-01-28 01:54:59 +00:00
Mark Andrews
b111592dca Merge branch '2391-check-nsupdate-y-for-all-hmac-algorithms' into 'main'
Resolve "Check 'nsupdate -y' for all hmac algorithms."

Closes #2391

See merge request isc-projects/bind9!4569
2021-01-28 01:54:30 +00:00
Mark Andrews
4b01ba44ea Check that 'nsupdate -y' works for all HMAC algorithms 2021-01-28 01:21:27 +00:00
Mark Andrews
5921af4c7f Merge branch '2073-dnssec-verify-tries-all-keys-which-results-in-poor-performance' into 'main'
Resolve "dnssec-verify tries all keys which results in poor performance"

Closes #2073

See merge request isc-projects/bind9!4411
2021-01-28 01:06:47 +00:00
Mark Andrews
3f0859d223 Add CHANGES note 2021-01-28 11:07:52 +11:00
Mark Andrews
c75b325832 Optimise dnssec-verify
dns_dnssec_keyfromrdata() only needs to be called once per DNSKEY
rather than once per verification attempt.
2021-01-28 11:07:03 +11:00
Mark Andrews
d7f41c3dce Merge branch '2342-rndc-retransfer-issues-misleading-diagnostic-on-primary-zone' into 'main'
Resolve "rndc retransfer issues misleading diagnostic on primary zone"

Closes #2342

See merge request isc-projects/bind9!4482
2021-01-27 22:42:05 +00:00
Mark Andrews
1f55f49f21 Add CHANGES 2021-01-28 08:43:50 +11:00
Mark Andrews
8f36b8567a Check 'rndc retransfer' of primary error message 2021-01-28 08:43:03 +11:00
Mark Andrews
dd3520ae41 Improve the diagnostic 'rndc retransfer' error message 2021-01-28 08:43:03 +11:00
Matthijs Mekking
1fcc6132c4 Merge branch '2178-dnssec-fromlabel-ec_crash' into 'main'
Resolve "dnssec-keyfromlabel  ECDSAP256SHA256 error on AEP Keypers HSM"

Closes #2178

See merge request isc-projects/bind9!4495
2021-01-26 14:02:49 +00:00
Matthijs Mekking
57ac70ad46 Make opensslecdsa_parse use fromlabel
When 'opensslecdsa_parse()' encounters a label tag in the private key
file, load the private key with 'opensslecdsa_fromlabel()'. Otherwise
load it from the private structure.

This was attempted before with 'load_privkey()' and 'uses_engine()',
but had the same flaw as 'opensslecdsa_fromlabel()' had previously,
that is getting the private and public key separately, juggling with
pointers between EC_KEY and EVP_PKEY, did not create a valid
cryptographic key that could be used for signing.
2021-01-26 15:01:26 +01:00
Matthijs Mekking
393052d6ff Simplify opensslecdsa_fromlabel
The 'opensslecdsa_fromlabel()' function does not need to get the
OpenSSL engine twice to load the private and public key. Also no need
to call 'dst_key_to_eckey()' as the EC_KEY can be derived from the
loaded EVP_PKEY's.

Add some extra checks to ensure the key has the same base id and curve
(group nid) as the dst key.

Since we already have the EVP_PKEY, no need to call 'finalize_eckey()',
instead just set the right values in the key structure.
2021-01-26 15:01:26 +01:00
Matthijs Mekking
1fcd0ef8bd Replace EVP_DigestFinal with EVP_DigestFinal_ex
The openssl docs claim that EVP_DigestFinal() is obsolete and that
one should use EVP_DigestFinal_ex() instead.
2021-01-26 15:01:26 +01:00
Matthijs Mekking
37d11f5be0 Add notes and changes for [#2178] 2021-01-26 15:01:24 +01:00
Matthijs Mekking
06b9724152 Don't set pubkey if eckey already has public key
The 'ecdsa_check()' function tries to correctly set the public key
on the eckey, but this should be skipped if the public key is
retrieved via the private key.
2021-01-26 15:01:04 +01:00
Matthijs Mekking
46afeca8bf ECDSA code should not use RSA label
The 'opensslecdsa_tofile()' function tags the label as an RSA label,
that is a copy paste error and should be of course an ECDSA label.
2021-01-26 15:01:04 +01:00
Matthijs Mekking
01239691a1 Correctly update pointers to pubkey and privkey
The functions 'load_pubkey_from_engine()' and
'load_privkey_from_engine()' did not correctly store the pointers.

Update both functions to add 'EC_KEY_set_public_key()' and
'EC_KEY_set_private_key()' respectively, so that the pointers to
the public and private keys survive the "load from engine" functions.
2021-01-26 15:01:04 +01:00
Matthijs Mekking
370285a62d load_pubkey_from_engine() should load public key
The 'function load_pubkey_from_engine()' made a call to the libssl
function 'ENGINE_load_private_key'.  This is a copy paste error and
should be 'ENGINE_load_public_key'.
2021-01-26 15:01:04 +01:00
Ondřej Surý
61ba7b9cba Merge branch '2403-dig-has-a-fit-with-option-multi-typo-on-multi' into 'main'
Report unknown dash option during the pre-parse phase

Closes #2403

See merge request isc-projects/bind9!4590
2021-01-26 13:17:02 +00:00
Mark Andrews
0b6da18f31 Add CHANGES note for [GL #2403] 2021-01-26 13:26:29 +01:00
Mark Andrews
3361c0d6f8 Report unknown dash option during the pre-parse phase 2021-01-26 13:26:10 +01:00
Michal Nowak
1869846858 Merge branch 'mnowak/add-rsabigexponent-README' into 'main'
Add README.md file to rsabigexponent system test

See merge request isc-projects/bind9!4579
2021-01-26 10:44:10 +00:00
Michal Nowak
a247f24dfa Add README.md file to rsabigexponent system test
This README.md describes why is bigkey needed.
2021-01-26 11:40:42 +01:00
Diego dos Santos Fronza
e96bf1f3dc Merge branch '2247-add-serve-stale-option-to-set-client-timeout' into 'main'
Resolve "Add serve-stale option to set client timeout"

Closes #2247

See merge request isc-projects/bind9!4514
2021-01-25 14:25:32 +00:00
Matthijs Mekking
d8c6655d7d Rewrap comments to 80 char width serve-stale test 2021-01-25 10:48:16 -03:00
Matthijs Mekking
fa0c9280d2 Update code flow in query.c wrt stale data
First of all, there was a flaw in the code related to the
'stale-refresh-time' option. If stale answers are enabled, and we
returned stale data, then it was assumed that it was because we were
in the 'stale-refresh-time' window. But now we could also have returned
stale data because of a 'stale-answer-client-timeout'. To fix this,
introduce a rdataset attribute DNS_RDATASETATTR_STALE_WINDOW to
indicate whether the stale cache entry was returned because the
'stale-refresh-time' window is active.

Second, remove the special case handling when the result is
DNS_R_NCACHENXRRSET. This can be done more generic in the code block
when dealing with stale data.

Putting all stale case handling in the code block when dealing with
stale data makes the code more easy to follow.

Update documentation to be more verbose and to match then new code
flow.
2021-01-25 10:48:16 -03:00
Diego Fronza
966060c03b Extracted common function from query_lookup and query_refresh_rrset
Both functions employed the same code lines to allocate query context
buffers, which are used to store query results, so this shared portion
of code was extracted out to a new function, qctx_prepare_buffers.

Also, this commit uses qctx_init to initialize the query context whitin
query_refresh_rrset function.
2021-01-25 10:48:16 -03:00
Diego Fronza
f89ac07b28 Small optimization in query_usestale
This commit makes the code in query_usestale easier to follow, it also
doesn't attach/detach to the database if stale answers are not enabled.
2021-01-25 10:48:16 -03:00
Diego Fronza
42c789c763 Add CHANGES note for [GL #2247] 2021-01-25 10:48:09 -03:00