Compare commits

...
Author SHA1 Message Date
Ondřej SurýandArtem Boldariev b6889fbf10 WIP: Add preliminary DoH client support to dig 2021-02-02 20:20:10 +02:00
Ondřej SurýandArtem Boldariev 81340a9ee0 Unit-test fixes and manual page updates for DoH configuration
This commit contains fixes to unit tests to make them work well on
various platforms (in particular ones shipping old versions of
OpenSSL) and fo different configurations.

It also updates the generated manpage to include DoH configuration
options.
2021-02-02 20:20:10 +02:00
Artem Boldariev bc1b832603 Initial support for DNS-over-HTTP(S)
This commit completes the support for DNS-over-HTTP(S) built on top of
nghttp2 and plugs it into the BIND. Support for both GET and POST
requests is present, as required by RFC8484.

Both encrypted (via TLS) and unencrypted HTTP/2 connections are
supported. The latter are mostly there for debugging/troubleshooting
purposes and for the means of encryption offloading to third-party
software (as might be desirable in some environments to simplify TLS
certificates management).
2021-02-02 20:20:01 +02:00
Witold KręcickiandArtem Boldariev 16966e5174 nghttp2-based HTTP layer in netmgr
This commit includes work-in-progress implementation of
DNS-over-HTTP(S).

Server-side code remains mostly untested, and there is only support
for POST requests.
2021-02-02 20:02:13 +02:00
Witold KręcickiandArtem Boldariev ba72d6f015 Add isc_mem_strndup() function
This commit adds an implementation of strndup() function which
allocates memory from the supplied isc_mem_t memory context.
2021-02-02 19:53:34 +02:00
Evan HuntandArtem Boldariev 37f81ca5fb Add parser support for DoH configuration options
This commit adds stub parser support and tests for:
- an "https-server" global option for HTTP/2 configuration.
- an "https-endpoint" view option for DoH configuration.
- add specific -p options to set dns, tls, or https port numbers by
  specifying -p dns-PORT, -p tls=PORT, or -p https=PORT.  NOTE: this
  change only affects syntax; specifying the TLS port on the command
  line DOES NOT CURRENTLY HAVE ANY EFFECT.
- change option names to tls-port and https-port for consistency.
- change variable names in system tests to TLSPORT and HTTPSPORT,
  and report them when running tests.

Documentation for these options has also been added to the ARM, but
needs further work.
2021-02-02 19:44:52 +02:00
Artem Boldariev fcb0b6a781 Resurrect old TLS code
This commit resurrects the old TLS code from
8f73c70d23.

It also includes numerous stability fixes and support for
isc_nm_cancelread() for the TLS layer.

The code was resurrected to be used for DoH.
2021-02-02 19:29:56 +02:00
Ondřej Surý 48a89e5fbe Merge branch '2444-call-freeaddrinfo-in-test_client' into 'main'
Fix addrinfo leak in test_client.c

Closes #2444

See merge request isc-projects/bind9!4629
2021-01-29 14:54:42 +00:00
Ondřej Surý 6aa4d59526 Fix addrinfo leak in test_client.c
The addrinfo we got from getaddrinfo() was never freed.
2021-01-29 13:26:28 +01:00
Ondřej Surý b42137c453 Merge branch '2392-xot-xfrin' into 'main'
Add support for incoming tranfers via XoT

Closes #2392

See merge request isc-projects/bind9!4571
2021-01-29 11:55:16 +00:00
Evan HuntandOndřej Surý 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 FronzaandMatthijs Mekking 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 AndrewsandOndřej Surý 0b6da18f31 Add CHANGES note for [GL #2403] 2021-01-26 13:26:29 +01:00
Mark AndrewsandOndřej Surý 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 MekkingandDiego Fronza d8c6655d7d Rewrap comments to 80 char width serve-stale test 2021-01-25 10:48:16 -03:00
Matthijs MekkingandDiego Fronza 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
Diego Fronza 6ab9070457 Add documentation for stale-answer-client-timeout 2021-01-25 10:47:14 -03:00
Diego Fronza 35fd039d03 Add system tests for stale-answer-client-timeout
This commit add 4 tests for the new option:
	1. Test default configuration of stale-answer-client-timeout, a
	   value of 1.8 seconds, with stale-refresh-time disabled.

	2. Test disabling of stale-answer-client-timeout.

	3. Test stale-answer-client-timeout with a value of zero, in this
	   case we take advantage of a log entry which shows that a stale
	   answer was promptly used before an attempt to refresh the RRset
	   is made. We also check, by activating a disabled authoritative
	   server, that the RRset was successfully refreshed after that.

	4. Test stale-answer-client-timeout 0 with stale-refresh-time 4, in
	   this test we want to ensure a couple things:

	   - If we have a stale RRSet entry in cache, a request must be
		 promptly answered with this data, while BIND must also attempt
		 to refresh the RRSet in background.

	   - If the attempt to refresh the RRSet times out, the RRSet must
		 have its stale-refresh-time window activated.

	   - If a new request for the same RRSet arrives, it must be
		 promptly answered with stale data due to stale-refresh-time
		 being active for this RRSet, in this case no attempt to refresh
		 the RRSet is made.

	   - Enable authoritative server, ensure that the RRSet was not
		 refreshed, to honor stale-refresh-time.

	   - Wait for stale-refresh-window time pass, send another request
		 for the same RRSet, this time we expect the answer to be the
		 stale entry in cache being hit due to
		 stale-answer-client-timeout 0.

	    - Send another request, this time we expect the answer to be an
		  active RRSet, since it must have been refreshed during the
		  previous request.
2021-01-25 10:47:14 -03:00
Diego Fronza e219422575 Allow stale data to be used before name resolution
This commit allows stale RRset to be used (if available) for responding
a query, before an attempt to refresh an expired, or otherwise resolve
an unavailable RRset in cache is made.

For that to work, a value of zero must be specified for
stale-answer-client-timeout statement.

To better understand the logic implemented, there are three flags being
used during database lookup and other parts of code that must be
understood:

. DNS_DBFIND_STALEOK: This flag is set when BIND fails to refresh a
  RRset due to timeout (resolver-query-timeout), its intent is to
  try to look for stale data in cache as a fallback, but only if
  stale answers are enabled in configuration.

  This flag is also used to activate stale-refresh-time window, since it
  is the only way the database knows that a resolution has failed.

. DNS_DBFIND_STALEENABLED: This flag is used as a hint to the database
  that it may use stale data. It is always set during query lookup if
  stale answers are enabled, but only effectively used during
  stale-refresh-time window. Also during this window, the resolver will
  not try to resolve the query, in other words no attempt to refresh the
  data in cache is made when the stale-refresh-time window is active.

. DNS_DBFIND_STALEONLY: This new introduced flag is used when we want
  stale data from the database, but not due to a failure in resolution,
  it also doesn't require stale-refresh-time window timer to be active.
  As long as there is a stale RRset available, it should be returned.
  It is mainly used in two situations:

    1. When stale-answer-client-timeout timer is triggered: in that case
       we want to know if there is stale data available to answer the
       client.
    2. When stale-answer-client-timeout value is set to zero: in that
       case, we also want to know if there is some stale RRset available
       to promptly answer the client.

We must also discern between three situations that may happen when
resolving a query after the addition of stale-answer-client-timeout
statement, and how to handle them:

	1. Are we running query_lookup() due to stale-answer-client-timeout
       timer being triggered?

       In this case, we look for stale data, making use of
       DNS_DBFIND_STALEONLY flag. If a stale RRset is available then
       respond the client with the data found, mark this query as
       answered (query attribute NS_QUERYATTR_ANSWERED), so when the
       fetch completes the client won't be answered twice.

       We must also take care of not detaching from the client, as a
       fetch will still be running in background, this is handled by the
       following snippet:

       if (!QUERY_STALEONLY(&client->query)) {
           isc_nmhandle_detach(&client->reqhandle);
       }

       Which basically tests if DNS_DBFIND_STALEONLY flag is set, which
       means we are here due to a stale-answer-client-timeout timer
       expiration.

    2. Are we running query_lookup() due to resolver-query-timeout being
       triggered?

       In this case, DNS_DBFIND_STALEOK flag will be set and an attempt
       to look for stale data will be made.
       As already explained, this flag is algo used to activate
       stale-refresh-time window, as it means that we failed to refresh
       a RRset due to timeout.
       It is ok in this situation to detach from the client, as the
       fetch is already completed.

    3. Are we running query_lookup() during the first time, looking for
       a RRset in cache and stale-answer-client-timeout value is set to
       zero?

       In this case, if stale answers are enabled (probably), we must do
       an initial database lookup with DNS_DBFIND_STALEONLY flag set, to
       indicate to the database that we want stale data.

       If we find an active RRset, proceed as normal, answer the client
       and the query is done.

       If we find a stale RRset we respond to the client and mark the
       query as answered, but don't detach from the client yet as an
       attempt in refreshing the RRset will still be made by means of
       the new introduced function 'query_resolve'.

       If no active or stale RRset is available, begin resolution as
       usual.
2021-01-25 10:47:14 -03:00
Diego Fronza 0ad6f594f6 Added option for disabling stale-answer-client-timeout
This commit allows to specify "disabled" or "off" in
stale-answer-client-timeout statement. The logic to support this
behavior will be added in the subsequent commits.

This commit also ensures an upper bound to stale-answer-client-timeout
which equals to one second less than 'resolver-query-timeout'.
2021-01-25 10:47:14 -03:00
Diego Fronza a12bf4b61b Adjusted serve-stale test
After the addition of stale-answer-client-timeout a test was broken due
to the following behavior expected by the test.

1. Prime cache data.example txt.
2. Disable authoritative server.
3. Send a query for data.example txt.
4. Recursive server will timeout and answer from cache with stale RRset.
5. Recursive server will activate stale-refresh-time due to the previous
   failure in attempting to refresh the RRset.
6. Send a query for data.example txt.
7. Expect stale answer from cache due to stale-refresh-time
window being active, even if authoritative server is up.

Problem is that in step 4, due to the new option
stale-answer-client-timeout, recursive server will answer with stale
data before the actual fetch completes.

Since the original fetch is still running in background, if we re-enable
the authoritative server during that time, the RRset will actually be
successfully refreshed, and stale-refresh-window will not be activated.

The next queries will fail because they expect the TTL of the RRset to
match the one in the stale cache, not the one just refreshed.

To solve this, we explicitly disable stale-answer-client-timeout for
this test, as it's not the feature we are interested in testing here
anyways.
2021-01-25 10:47:14 -03:00
Diego Fronza 171a5b7542 Add stale-answer-client-timeout option
The general logic behind the addition of this new feature works as
folows:

When a client query arrives, the basic path (query.c / ns_query_recurse)
was to create a fetch, waiting for completion in fetch_callback.

With the introduction of stale-answer-client-timeout, a new event of
type DNS_EVENT_TRYSTALE may invoke fetch_callback, whenever stale
answers are enabled and the fetch took longer than
stale-answer-client-timeout to complete.

When an event of type DNS_EVENT_TRYSTALE triggers fetch_callback, we
must ensure that the folowing happens:

1. Setup a new query context with the sole purpose of looking up for
   stale RRset only data, for that matters a new flag was added
   'DNS_DBFIND_STALEONLY' used in database lookups.

    . If a stale RRset is found, mark the original client query as
      answered (with a new query attribute named NS_QUERYATTR_ANSWERED),
      so when the fetch completion event is received later, we avoid
      answering the client twice.

    . If a stale RRset is not found, cleanup and wait for the normal
      fetch completion event.

2. In ns_query_done, we must change this part:
	/*
	 * If we're recursing then just return; the query will
	 * resume when recursion ends.
	 */
	if (RECURSING(qctx->client)) {
		return (qctx->result);
	}

   To this:

	if (RECURSING(qctx->client) && !QUERY_STALEONLY(qctx->client)) {
		return (qctx->result);
	}

   Otherwise we would not proceed to answer the client if it happened
   that a stale answer was found when looking up for stale only data.

When an event of type DNS_EVENT_FETCHDONE triggers fetch_callback, we
proceed as before, resuming query, updating stats, etc, but a few
exceptions had to be added, most important of which are two:

1. Before answering the client (ns_client_send), check if the query
   wasn't already answered before.

2. Before detaching a client, e.g.
   isc_nmhandle_detach(&client->reqhandle), ensure that this is the
   fetch completion event, and not the one triggered due to
   stale-answer-client-timeout, so a correct call would be:
   if (!QUERY_STALEONLY(client)) {
        isc_nmhandle_detach(&client->reqhandle);
   }

Other than these notes, comments were added in code in attempt to make
these updates easier to follow.
2021-01-25 10:47:14 -03:00
Diego Fronza 74840ec50b Added dns_view_staleanswerenabled() function
Since it takes a couple lines of code to check whether stale answers
are enabled for a given view, code was extracted out to a proper
function.
2021-01-25 10:47:14 -03:00
Diego Fronza 49c40827f6 Avoid iterating name twice when constructing fctx->info
This is a minor performance improvement, we store the result of the
first call to strlcat to use as an offset in the next call when
constructing fctx->info string.
2021-01-25 10:47:14 -03:00
Michał Kępień 91acd207d2 Merge branch '2387-use--release-for-SONAME' into 'main'
Use -release instead of -version-info for internal library SONAMEs

Closes #2387

See merge request isc-projects/bind9!4552
2021-01-25 13:36:49 +00:00
Ondřej SurýandMichał Kępień b30aaa3748 Add CHANGES and release note for GL #2387 2021-01-25 14:19:53 +01:00
Ondřej SurýandMichał Kępień c605d75ea5 Use -release instead of -version-info for internal library SONAMEs
The BIND 9 libraries are considered to be internal only and hence the
API and ABI changes a lot.  Keeping track of the API/ABI changes takes
time and it's a complicated matter as the safest way to make everything
stable would be to bump any library in the dependency chain as in theory
if libns links with libdns, and a binary links with both, and we bump
the libdns SOVERSION, but not the libns SOVERSION, the old libns might
be loaded by binary pulling old libdns together with new libdns loaded
by the binary.  The situation gets even more complicated with loading
the plugins that have been compiled with few versions old BIND 9
libraries and then dynamically loaded into the named.

We are picking the safest option possible and usable for internal
libraries - instead of using -version-info that has only a weak link to
BIND 9 version number, we are using -release libtool option that will
embed the corresponding BIND 9 version number into the library name.

That means that instead of libisc.so.1701 (as an example) the library
will now be named libisc-9.17.10.so.
2021-01-25 14:19:53 +01:00
Michal Nowak 7939e7fd71 Merge branch '2415-update-coverity-scan-ci-job-to-2020-09' into 'main'
Update Coverity Scan CI job to 2020.09

Closes #2415

See merge request isc-projects/bind9!4593
2021-01-25 11:32:52 +00:00
Michal Nowak 7d428be79b Update Coverity Scan CI job to 2020.09 2021-01-25 12:31:11 +01:00
Ondřej Surý 5c27eef817 Merge branch '2335-tlsdns-refactoring' into 'main'
refactor TLSDNS module to work with libuv/ssl directly

Closes #2335

See merge request isc-projects/bind9!4584
2021-01-25 09:15:52 +00:00
Evan HuntandOndřej Surý f472390bc2 Add CHANGES note for #2335 2021-01-25 09:19:22 +01:00
Ondřej Surý e493e04c0f Refactor TLSDNS module to work with libuv/ssl directly
* Following the example set in 634bdfb16d, the tlsdns netmgr
  module now uses libuv and SSL primitives directly, rather than
  opening a TLS socket which opens a TCP socket, as the previous
  model was difficult to debug.  Closes #2335.

* Remove the netmgr tls layer (we will have to re-add it for DoH)

* Add isc_tls API to wrap the OpenSSL SSL_CTX object into libisc
  library; move the OpenSSL initialization/deinitialization from dstapi
  needed for OpenSSL 1.0.x to the isc_tls_{initialize,destroy}()

* Add couple of new shims needed for OpenSSL 1.0.x

* When LibreSSL is used, require at least version 2.7.0 that
  has the best OpenSSL 1.1.x compatibility and auto init/deinit

* Enforce OpenSSL 1.1.x usage on Windows

* Added a TLSDNS unit test and implemented a simple TLSDNS echo
  server and client.
2021-01-25 09:19:22 +01:00
Michał Kępień 8f73c70d23 Merge branch 'v9_17_9-release' into 'main'
Merge 9.17.9 release branch

See merge request isc-projects/bind9!4586
2021-01-21 08:05:29 +00:00
Michał Kępień 7751a8eaf6 Set up release notes for BIND 9.17.10 2021-01-21 09:02:04 +01:00
Michał Kępień f28804cd98 Bump BIND_BASELINE_VERSION for ABI checks 2021-01-21 09:02:04 +01:00
Michał Kępień 60b3c67cf0 Update GitLab issue number for CHANGES entry 5557 2021-01-21 08:57:22 +01:00
Michał Kępień 49d2aafdc4 Update BIND version to 9.17.9 2021-01-21 08:57:22 +01:00
Michał Kępień cacf290ad2 Add a CHANGES marker 2021-01-21 08:57:22 +01:00
Michał Kępień 347d666b0f Update library API versions 2021-01-21 08:57:22 +01:00
Michał Kępień 5eac635fc0 Merge branch 'michal/prepare-documentation-for-bind-9.17.9' into 'v9_17_9-release'
Prepare documentation for BIND 9.17.9

See merge request isc-private/bind9!230
2021-01-21 08:57:22 +01:00
Michał Kępień 6118f75c70 Prepare release notes for BIND 9.17.9 2021-01-21 08:57:22 +01:00
Michał Kępień cf9d818be3 Add release note for GL #2091 2021-01-21 08:57:22 +01:00
Michał Kępień 09ff03bb1c Reorder release notes 2021-01-21 08:57:22 +01:00
Michał Kępień e343aa5b94 Tweak and reword release notes 2021-01-21 08:57:22 +01:00
Michał Kępień 598a026cae Tweak and reword recent CHANGES entries 2021-01-21 08:57:22 +01:00
Michał Kępień b2b451d0bf Fix location of the CHANGES marker for BIND 9.17.8 2021-01-21 08:57:22 +01:00
Evan Hunt 9ec5dcf79c Merge branch 'each-fix-cpu-test' into 'main'
check whether taskset works before running cpu test

See merge request isc-projects/bind9!4583
2021-01-20 23:42:55 +00:00
Evan Hunt a8a49bb783 check whether taskset works before running cpu test
the taskset command used for the cpu system test seems
to be failing under vmware, causing a test failure. we
can try the taskset command and skip the test if it doesn't
work.
2021-01-20 13:37:52 -08:00
Michal Nowak 56616c783b Merge branch 'mnowak/drop-issue-1941-workaround' into 'main'
Drop #1941 workaround

See merge request isc-projects/bind9!4580
2021-01-19 10:46:31 +00:00
Michal Nowak fe5978f5ba Drop #1941 workaround
Workaround for issue #1941 is not needed anymore as the underlying
performance issue which manifested on FreeBSD was addressed.
2021-01-19 11:45:10 +01:00
Matthijs Mekking 0d6347b55e Merge branch '1086-cleanup-config-option-flags' into 'main'
Resolve "Reduce the number of "bad configuration options" flags"

Closes #1086

See merge request isc-projects/bind9!4476
2021-01-19 09:59:03 +00:00
Matthijs Mekking f411f510f7 Remove the option 'filter-aaaa' options
The 'filter-aaaa', 'filter-aaaa-on-v4', and 'filter-aaaa-on-v6' options
are replaced by the filter-aaaa plugin. This plugin was introduced in
9.13.5 and so it is safe to remove the named.conf options.
2021-01-19 10:12:40 +01:00
Matthijs Mekking 437d271483 Special case tests for lmdb
When compiling BIND 9 without lmdb, this is promoted from
'not operational' to 'not configured', resulting in a failure (and no
longer a warning) if ldmb-related configuration options are set.

Special case certain system tests to avoid test failures on systems
that do not have lmdb.
2021-01-19 10:12:40 +01:00
Matthijs Mekking dc6de216af Update copyrights for [#1086] 2021-01-19 10:12:40 +01:00
Matthijs Mekking 9d96350f4f Add notes for [#1086]
Mention the configuration cleanup.
2021-01-19 10:12:40 +01:00
Matthijs Mekking c6c3e2d074 Update doc files
Run make doc after all the code changes related to #1086.
2021-01-19 10:12:40 +01:00
Matthijs Mekking 87744f218d Remove a lot of obsoleted options
These options were ancient or made obsolete a long time ago, it is
safe to remove them.

Also stop printing ancient options, they should be treated the same as
unknown options.

Removed options: lwres, geoip-use-ecs, sit-secret, use-ixfr,
acache-cleaning-interval, acache-enable, additional-from-auth,
additional-from-cache, allow-v6-synthesis, dnssec-enable,
max-acache-size, nosit-udp-size, queryport-pool-ports,
queryport-pool-updateinterval, request-sit, use-queryport-pool, and
support-ixfr.
2021-01-19 10:12:40 +01:00
Matthijs Mekking df435fc7da Remove the option 'dnssec-lookaside'
Obsoleted in 9.15, we can remove the option in 9.17.
2021-01-19 10:12:40 +01:00
Matthijs Mekking a889ed38ef Remove the option 'cleaning-interval'
Obsoleted in 9.15, we can remove the option in 9.17.
2021-01-19 10:12:40 +01:00
Matthijs Mekking 6e2597b55a Log experimental options
Log a warning for the 'experimental' clause flag similar to
the 'deprecated' flag.
2021-01-19 10:12:40 +01:00
Matthijs Mekking d5f70b2237 Obsolete CLAUSEFLAG NEWDEFAULT
The 'new default' option was introduced in 2002 to signal that a
default option had changed its default value, in this specific case
the value for 'auth-nxdomain'. However, this default has been unchanged
for 18 years now, and logging that the default has changed does not
have significant value nowadays.

This is also a good example that the clause flag 'new default' is
broken: it is easy to get out of date.

It is also easy to forget, because we have changed the default value
for 'max-stale-ttl' and haven't been flagging it with 'new default'

Also, if the operator cares for a specific value it should set it
explicitly. Using the default is telling the software: use whatever
you think is best, and this may change over time. Default value
changes should be mentioned in the release note, but do not require
further special treatment.
2021-01-19 10:12:40 +01:00
Matthijs Mekking dda3a68efc Obsolete CLAUSEFLAG NOOP
The clause flag 'not operational' is promoted to 'not configured'.
2021-01-19 10:12:40 +01:00
Matthijs Mekking ff1957e95b Obsolete CLAUSEFLAG NOTIMP and NYI
The clause flags 'not implented' and 'not implemented yet' are the
same as 'obsoleted' when it comes to behavior. These options will
now be treated similar as obsoleted (the idea being that if an
option is implemented it should be functional).

The new options for DoT are new options and rather than flagging them
obsolete, they should have been flagged as experimental, signalling
that these options are subject to change in the future.
2021-01-19 10:12:40 +01:00
Matthijs Mekking ef28737af8 Merge branch '2380-doc-engine-pkcs11' into 'main'
Resolve "Documentation  update - use of "-E pkcs11""

Closes #2380

See merge request isc-projects/bind9!4572
2021-01-19 09:10:32 +00:00
Matthijs Mekking a9828dd170 Update documentation on -E option
The -E option does not default to pkcs11 if --with-pkcs11 is set,
but always needs to be set explicitly.
2021-01-19 09:05:28 +01:00
Michał Kępień a23c5d2921 Merge branch 'michal/improve-danger-checks' into 'main'
Improve Danger checks

Closes #1923 and #1917

See merge request isc-projects/bind9!4503
2021-01-18 14:12:42 +00:00
Michał Kępień bc42690c99 Skip subject line length check for merge commits
Some merge requests (e.g. those created for release branches) include
merge commits.  Prevent Danger from warning about excessive subject line
length for merge commits.  (While the proper way to detect a merge
commit would be to check the 'parents' attribute of a commit object,
Danger Python does not seem to populate that attribute, so a simple
string search is performed on the commit subject instead.)
2021-01-18 14:57:47 +01:00
Michał Kępień 09964e8085 Skip length check for lines containing references
The Danger GitLab CI job currently flags excessively long lines in
commit log messages.  Exclude lines containing references (i.e. starting
with "[1]", "[2]", etc.) from this check.  This allows e.g. long URLs to
be included in commit log messages without triggering Danger warnings.
2021-01-18 14:57:47 +01:00
Michał Kępień 801d13f62f Only warn about fixup commits once per run
The Danger GitLab CI job currently generates a separate error message
about fixup commits being present in a merge request for every such
commit found.  Prevent that by making it only log that error message
once per run.
2021-01-18 14:57:47 +01:00
Michał Kępień 953c810f41 Flag trailing dots in commit subject lines
Make the Danger GitLab CI job fail when the subject line for any commit
belonging to a merge request contains a trailing dot.
2021-01-18 14:57:47 +01:00
Michał Kępień ff58ec8cef Flag missing pairwise testing markers
Make the Danger GitLab CI job fail when a merge request adds a new
./configure switch without also adding a "# [pairwise: ...]" marker that
the relevant GitLab CI job uses for preparing the pairwise testing
model.  This helps to ensure that any newly added ./configure switches
are tested by the pairwise testing GitLab CI job.
2021-01-18 14:57:47 +01:00
Michał Kępień d81ad454cc Suggest adding release notes for customer issues
Make Danger suggest adding a release note to a merge request if the
latter is marked with the "Customer" label but not with the "Release
Notes" label.
2021-01-18 14:57:47 +01:00
Michał Kępień 2f77c7680a Handle [placeholder] CHANGES entries
Make the Danger GitLab CI job fail when a merge request targeting a
branch different than "main" adds any [placeholder] entries to the
CHANGES file.  Prevent Danger from flagging missing GitLab identifiers
for [placeholder] CHANGES entries.
2021-01-18 14:57:47 +01:00
Michał Kępień 97364f5518 Flag missing CVE identifiers
Make Danger ensure that if a merge request fixes a security issue then
that merge request includes a CHANGES entry and a release note, both of
which contain a CVE identifier.
2021-01-18 14:57:47 +01:00
Matthijs Mekking f5c3863530 Merge branch '2364-cid314969-coverity-deadcode-zoneconf' into 'main'
Fix control flow issue CID 314969 in zoneconf.c

Closes #2364

See merge request isc-projects/bind9!4573
2021-01-18 12:35:30 +00:00
Matthijs Mekking 8df629d0b2 Fix control flow issue CID 314969 in zoneconf.c
Coverity Scan identified the following issue in bin/named/zoneconf.c:

    *** CID 314969:  Control flow issues  (DEADCODE)
    /bin/named/zoneconf.c: 2212 in named_zone_inlinesigning()

    if (!inline_signing && !zone_is_dynamic &&
        cfg_map_get(zoptions, "dnssec-policy", &signing) == ISC_R_SUCCESS &&
        signing != NULL)
    {
        if (strcmp(cfg_obj_asstring(signing), "none") != 0) {
            inline_signing = true;
    >>>     CID 314969:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach the expression ""no"" inside this statement: "dns_zone_log(zone, 1, "inli...".
            dns_zone_log(
                zone, ISC_LOG_DEBUG(1), "inline-signing: %s",
                inline_signing
                ? "implicitly through dnssec-policy"
                : "no");
        } else {
                ...
        }
    }

This is because we first set 'inline_signing = true' and then check
its value in 'dns_zone_log'.
2021-01-18 11:48:09 +01:00
Ondřej Surý 2dd54fa62f Merge branch '2354-placeholder' into 'main'
Add placeholder for GL #2354

Closes #2354

See merge request isc-projects/bind9!4564
2021-01-12 20:19:30 +00:00
Ondřej Surý 4387e4a632 Add placeholder for GL #2354 2021-01-12 21:14:53 +01:00
Matthijs Mekking 739a5ea135 Merge branch '2383-kasp-sig-validity-dnskey-bug' into 'main'
Fix signatures-validity config option

Closes #2383

See merge request isc-projects/bind9!4543
2021-01-12 11:22:22 +00:00
Matthijs Mekking ad63e9e4f8 Fix signatures-validity config option
KASP was using 'signatures-validity-dnskey' instead of
'signatures-validity'.
2021-01-12 10:54:48 +00:00
Michal Nowak 031cc284fc Merge branch 'mnowak/fix-copyright-date-in-man-pages' into 'main'
Update copyright date in man pages

See merge request isc-projects/bind9!4548
2021-01-11 11:35:57 +00:00
Michal NowakandMichał Kępień 358c133ee2 Update copyright date in man pages 2021-01-11 12:27:17 +01:00
Michał Kępień 34cb46aed0 Make sure ddns-confgen man page stays up to date 2021-01-11 12:27:17 +01:00
Matthijs Mekking 98ad051c16 Merge branch 'matthijs-fix-notes' into 'main'
Fix current release notes

See merge request isc-projects/bind9!4549
2021-01-11 11:22:19 +00:00
Matthijs Mekking aa69753470 Fix current release notes
Remove entry that was release in 9.17.8 already.
2021-01-11 12:21:03 +01:00
Matthijs Mekking a559faeaec Merge branch '2248-serve-stale-config-defaults' into 'main'
Update serve-stale config defaults

Closes #2248

See merge request isc-projects/bind9!4477
2021-01-11 10:55:53 +00:00
Matthijs Mekking 3be65246f8 Update serve-stale system test with new defaults 2021-01-11 11:13:45 +01:00
Matthijs Mekking e15a433b23 Update serve-stale config defaults
Change the serve-stale configuration defaults so that they match the
recommendations from RFC 8767.
2021-01-11 11:13:45 +01:00
Michał Kępień 06e4004bf0 Merge branch '606-add-the-isc-dnssec-guide-as-a-bind-9-arm-appendix' into 'main'
Add the ISC DNSSEC Guide as a BIND 9 ARM appendix

Closes #606

See merge request isc-projects/bind9!4471
2021-01-08 12:53:13 +00:00
Michał Kępień f96e6a1e1d Add the ISC DNSSEC Guide as a BIND 9 ARM appendix
Add the ISC DNSSEC Guide to the BIND 9 ARM in order to include the
former in every BIND release.
2021-01-08 13:12:20 +01:00
Michał Kępień b65629f7a5 Merge branch '2366-add-CHANGES-entry' into 'main'
Add CHANGES entry for GL #2366

Closes #2366

See merge request isc-projects/bind9!4544
2021-01-08 11:51:03 +00:00
Michał Kępień 995b72d2b7 Add CHANGES entry for GL #2366 2021-01-08 12:48:37 +01:00
Michal Nowak e797d7caff Merge branch 'marka-explicitly-add-gen.c' into 'main'
Explicitly add gen.c and gen-unix.h to dist

See merge request isc-projects/bind9!4538
2021-01-07 15:24:21 +00:00
Mark AndrewsandMichal Nowak e583fdfed9 Explicitly add gen.c and gen-unix.h to dist 2021-01-07 16:06:12 +01:00
Mark Andrews 35ccdf0583 Merge branch '1978-cross-compilation-doesn-t-work-in-9-17' into 'main'
Resolve "Cross-compilation doesn’t work in 9.17"

Closes #1978

See merge request isc-projects/bind9!4505
2021-01-07 02:49:41 +00:00
Mark Andrews 33c907b1c6 don't enable maintainer mode when cross compiling 2021-01-07 13:23:18 +11:00
Mark Andrews 96f91d7a53 lib/dns/gen should be built with CC_FOR_BUILD 2021-01-07 13:23:18 +11:00
Evan Hunt 2faa0f6676 Merge branch 'jinmei-bind9-fix-async-hook-assertion-failure' into 'main'
fix async hook assertion failure

Closes #2379

See merge request isc-projects/bind9!4537
2021-01-06 22:02:42 +00:00
Evan Hunt 1079701bd7 CHANGES 2021-01-06 13:26:02 -08:00
JINMEI TatuyaandEvan Hunt 2ed12d90c9 more s/recurse/async/ for consistency
(no behavior change)
2021-01-06 13:14:13 -08:00
JINMEI TatuyaandEvan Hunt d520f01c7b detach fetchhandle before resume query processing
otherwise, another hook async event or DNS recursion would
trigger an assertion failure.
2021-01-06 13:14:13 -08:00
Mark Andrews 5a05cbebc4 Merge branch '2366-bind-9-16-10-build-fails-with-libmaxminddb-1-4-3-2' into 'main'
Resolve "BIND 9.16.10 build fails with libmaxminddb-1.4.3"

Closes #2366

See merge request isc-projects/bind9!4532
2021-01-06 08:03:38 +00:00
Mark Andrews fcca836a20 Fix 'configure --with-maxminddb=<path>' 2021-01-06 18:05:58 +11:00
Mark Andrews c668cf6692 Merge branch '2355-incorrect-increment-of-inactive-in-rbtdb-c-maybe_free_rbtdb' into 'main'
Resolve "Incorrect increment of inactive in rbtdb.c:maybe_free_rbtdb()"

Closes #2317 and #2355

See merge request isc-projects/bind9!4504
2021-01-06 05:30:11 +00:00
Mark Andrews 584e589d84 Add release note 2021-01-06 15:28:23 +11:00
Mark Andrews 65702896bd Add CHANGES 2021-01-06 15:27:50 +11:00
Mark Andrews 859d2fdad6 Inactive incorrectly incremented
It is possible to have two threads destroying an rbtdb at the same
time when detachnode() executes and removes the last reference to
a node between exiting being set to true for the node and testing
if the references are zero in maybe_free_rbtdb().  Move NODE_UNLOCK()
to after checking if references is zero to prevent detachnode()
changing the reference count too early.
2021-01-06 15:27:07 +11:00
Matthijs Mekking d86ad80654 Merge branch '2359-too-many-newlines-dnssec-signzone-verify' into 'main'
Fix dnssec-signzone and -verify logging (again)

Closes #2359

See merge request isc-projects/bind9!4523
2021-01-05 12:40:40 +00:00
Matthijs Mekking 18c62a077e Fix dnssec-signzone and -verify logging (again)
While fixing #2359, 'report()' was changed so that it would print the
newline.

Newlines were missing from the output of 'dnssec-signzone'
and 'dnssec-verify' because change
664b8f04f5 moved the printing from
newlines to the library.

This had to be reverted because this also would print redundant
newlines in logfiles.

While doing the revert, some newlines in 'lib/dns/zoneverify.c'
were left in place, now making 'dnssec-signzone' and 'dnssec-verify'
print too many newlines.

This commit removes those newlines, so that the output looks nice
again.
2021-01-05 12:06:23 +01:00
Mark Andrews ba4073ef0d Merge branch 'marka-placeholder' into 'main'
placeholder

See merge request isc-projects/bind9!4521
2021-01-05 00:29:26 +00:00
Mark Andrews 27fa7dd73b placeholder 2021-01-05 11:25:38 +11:00
Mark Andrews 8c6db04f60 Merge branch '2359-missing-newlines-in-log-messages-dnssec-signzone-dnssec-verify-c' into 'main'
Resolve "missing newlines in log messages dnssec-signzone/dnssec-verify"

Closes #2359

See merge request isc-projects/bind9!4511
2021-01-04 06:21:13 +00:00
Mark Andrews 244525a303 Add CHANGES 2021-01-04 03:59:10 +00:00
Mark Andrews c36bd83822 Fix dnssec-signzone and dnssec-verify logging
The newlines need to be appended to the messages generated by report
in a atomic manner.
2021-01-04 03:59:10 +00:00
Mark Andrews fa0171fdeb Merge branch 'marka-copyrights' into 'main'
update for 2021

See merge request isc-projects/bind9!4518
2021-01-04 03:58:45 +00:00
Mark Andrews faf9d8beba update for 2021 2021-01-04 11:52:00 +11:00
Matthijs Mekking 6c0e172308 Merge branch 'matthijs-fixup-notes' into 'main'
Matthijs fixup notes

See merge request isc-projects/bind9!4512
2020-12-23 11:04:45 +00:00
Matthijs Mekking 2e7ccecefe Fixup notes
I screwed up the notes in !4474
2020-12-23 12:03:26 +01:00
Matthijs Mekking 1c26ab64a4 Merge branch '1750-dnssec-policy-none' into 'main'
Resolve 'dnssec-policy' graceful transition to insecure

Closes #2341 and #1750

See merge request isc-projects/bind9!4474
2020-12-23 10:55:20 +00:00
Matthijs Mekking 08b6e8c2c9 Add notes for [#2341]
Mention the bugfix in the release.
2020-12-23 11:43:03 +01:00
Matthijs Mekking 7825d8f916 Add documentation and notes for [#1750] 2020-12-23 09:10:13 +01:00
Matthijs Mekking 2fc42b598b Fix a quirky mkeys test failure
The mkeys system test started to fail after introducing support for
zones transitioning to unsigned without going bogus. This is because
there was actually a bug in the code: if you reconfigure a zone and
remove the "auto-dnssec" option, the zone is actually still DNSSEC
maintained. This is because in zoneconf.c there is no call
to 'dns_zone_setkeyopt()' if the configuration option is not used
(cfg_map_get(zoptions, "auto-dnssec", &obj) will return an error).

The mkeys system test implicitly relied on this bug: initially the
root zone is being DNSSEC maintained, then at some point it needs to
reset the root zone in order to prepare for some tests with bad
signatures. Because it needs to inject a bad signature, 'auto-dnssec'
is removed from the configuration.

The test pass but for the wrong reasons:

I:mkeys:reset the root server
I:mkeys:reinitialize trust anchors
I:mkeys:check positive validation (18)

The 'check positive validation' test works because the zone is still
DNSSEC maintained: The DNSSEC records in the signed root zone file on
disk are being ignored.

After fixing the bug/introducing graceful transition to insecure,
the root zone is no longer DNSSEC maintained after the reconfig.

The zone now explicitly needs to be reloaded because otherwise the
'check positive validation' test works against an old version of the
zone (the one with all the revoked keys), and the test will obviously
fail.
2020-12-23 09:02:11 +01:00
Matthijs Mekking 9134100069 Update keymgr to allow transition to insecure mode
The keymgr prevented zones from going to insecure mode. If we
have a policy with an empty key list this is a signal that the zone
wants to go back to insecure mode. In this case allow one extra state
transition to be valid when checking for DNSSEC safety.
2020-12-23 09:02:11 +01:00
Matthijs Mekking 68d715a229 Publish CDS/CDNSKEY Delete Records
Check if zone is transitioning from secure to insecure. If so,
delete the CDS/CDNSKEY records, otherwise make sure they are not
part of the RRset.
2020-12-23 09:02:11 +01:00
Matthijs Mekking cf420b2af0 Treat dnssec-policy "none" as a builtin zone
Configure "none" as a builtin policy. Change the 'cfg_kasp_fromconfig'
api so that the 'name' will determine what policy needs to be
configured.

When transitioning a zone from secure to insecure, there will be
cases when a zone with no DNSSEC policy (dnssec-policy none) should
be using KASP. When there are key state files available, this is an
indication that the zone once was DNSSEC signed but is reconfigured
to become insecure.

If we would not run the keymgr, named would abruptly remove the
DNSSEC records from the zone, making the zone bogus. Therefore,
change the code such that a zone will use kasp if there is a valid
dnssec-policy configured, or if there are state files available.
2020-12-23 09:02:11 +01:00
Matthijs Mekking 8f2c5e45da Add function to see if dst key uses kasp
For purposes of zones transitioning back to insecure mode, it is
practical to see if related keys have a state file associated.
2020-12-23 09:02:11 +01:00
Matthijs Mekking 756674f6d1 Small adjustments to kasp rndc_checkds function
Slightly better test output, and only call 'load keys' if the
'rndc checkds' call succeeded.
2020-12-23 09:02:11 +01:00
Matthijs Mekking fa2e4e66b0 Add tests for going from secure to insecure
Add two test zones that will be reconfigured to go insecure, by
setting the 'dnssec-policy' option to 'none'.

One zone was using inline-signing (implicitly through dnssec-policy),
the other is a dynamic zone.

Two tweaks to the kasp system test are required: we need to set
when to except the CDS/CDS Delete Records, and we need to know
when we are dealing with a dynamic zone (because the logs to look for
are slightly different, inline-signing prints "(signed)" after the
zone name, dynamic zones do not).
2020-12-23 09:02:11 +01:00
Mark Andrews 89c35b7164 Merge branch '2245-bind-9-16-8-does-not-honor-cpu-affinity' into 'main'
Resolve "bind 9.16.8 does not honor CPU affinity"

Closes #2245

See merge request isc-projects/bind9!4395
2020-12-22 22:17:12 +00:00
Mark Andrews fc4af548e7 Add CHANGES and release notes for [GL #2245] 2020-12-23 09:16:26 +11:00
Mark Andrews 09f00ad5dd PYTHON may be null
When Python is not present, PYTHON=$(command -v "@PYTHON@") will exit
the script with 1, prevent that by adding "|| true".
2020-12-23 09:16:26 +11:00
Matthijs MekkingandMark Andrews f1a097964c Add test for cpu affinity
Add a test to check BIND 9 honors CPU affinity mask. This requires
some changes to the start script, to construct the named command.
2020-12-23 09:16:26 +11:00
Mark AndrewsandMatthijs Mekking 698d9285d4 Only pick CPUs that are part of the existing CPU affinity set when
assigning a thread to a CPU.
2020-12-21 15:09:57 +01:00
Mark Andrews c850a334d9 Merge branch '2348-bin-tools-mdig-compile-link-failure-because-of-missing-isccfg-dependency-3' into 'main'
Resolve "bin/tools/mdig: compile/link failure because of missing isccfg dependency"

Closes #2348

See merge request isc-projects/bind9!4497
2020-12-21 02:07:45 +00:00
Mark Andrews 77372e9e24 Handle shared library platforms that don't support inter library dependancies 2020-12-21 01:09:45 +00:00
Mark Andrews 08df4f420a Reorder in library dependancy order 2020-12-21 01:09:45 +00:00
Ondřej Surý 6990f0bc3e Merge branch 'jpmens-main-patch-60230' into 'main'
Adjust number of rule types from 13 to the 16 there are. (16 is accurately...

See merge request isc-projects/bind9!4507
2020-12-20 16:50:03 +00:00
JP Mens 4658a1e657 Adjust number of rule types from 13 to the 16 there are. (16 is accurately specified further down in the section.) 2020-12-20 09:56:44 +00:00
Michał Kępień 90972fd782 Merge branch 'v9_17_8-release' into 'main'
Merge 9.17.8 release branch

See merge request isc-projects/bind9!4500
2020-12-16 21:15:24 +00:00
Michał Kępień 7c1c021fc5 Set up release notes for BIND 9.17.9 2020-12-16 22:09:14 +01:00
Michał Kępień 909a84c08b Bump BIND_BASELINE_VERSION for ABI checks 2020-12-16 22:09:14 +01:00
Michał Kępień 843c9144c6 Update BIND version to 9.17.8 2020-12-16 22:05:50 +01:00
Michał Kępień 8e47965f41 Add a CHANGES marker 2020-12-16 22:05:50 +01:00
Michał Kępień 2c44266a5a Update library API versions 2020-12-16 22:05:50 +01:00
Michał Kępień 23861dd8a7 Merge branch 'michal/prepare-release-notes-for-bind-9.17.8' into 'v9_17_8-release'
Prepare release notes for BIND 9.17.8

See merge request isc-private/bind9!224
2020-12-16 22:05:50 +01:00
Michał Kępień a5f1af7c14 Prepare release notes for BIND 9.17.8 2020-12-16 22:05:50 +01:00
Michał Kępień af58fcc92a Add release note for GL #2321 2020-12-16 22:05:50 +01:00
Michał Kępień 552418b68c Add release note for GL #1816 2020-12-16 22:05:50 +01:00
Michał Kępień bdc45c82c5 Reorder release notes 2020-12-16 22:05:50 +01:00
Michał Kępień 0f889b9c7d Tweak and reword release notes 2020-12-16 22:05:50 +01:00
Michał Kępień fc111622c2 Tweak and reword recent CHANGES entries 2020-12-16 22:05:50 +01:00
Michał Kępień 2ecff5dc43 Fix formatting of "dnssec-policy" documentation 2020-12-16 22:05:50 +01:00
Michal NowakandMichał Kępień ae05e5b691 Miscellaneous minor documentation updates 2020-12-16 22:05:50 +01:00
Michal Nowak c99fe579b9 Merge branch 'mnowak/fix-rndc-8-reference-in-named-8-man-page' into 'main'
Fix a reference to rndc(8) in named(8) manual page

See merge request isc-projects/bind9!4478
2020-12-14 12:12:54 +00:00
Michal Nowak befcbcac28 Fix a reference to rndc(8) in named(8) manual page 2020-12-14 13:10:10 +01:00
Ondřej Surý 27f0988b52 Merge branch '2058-print-warning-when-fallback-to-soaserial-increment' into 'main'
Resolve "`dnssec-signzone -N unixtime` behaves like `increment`"

Closes #2058

See merge request isc-projects/bind9!4487
2020-12-12 06:52:50 +00:00
Ondřej SurýandOndřej Surý ba887a688c Add CHANGES and release notes for GL #2058 2020-12-12 07:15:45 +01:00
Mark AndrewsandOndřej Surý eb1b29b19e Update dnssec-signzone -N soa-serial-format description
document the autoincrement when the serial would go backwards.
2020-12-11 10:48:28 +01:00
Ondřej SurýandOndřej Surý ef685bab5c Print warning when falling back to increment soa serial method
When using the `unixtime` or `date` method to update the SOA serial,
`named` and `dnssec-signzone` would silently fallback to `increment`
method to prevent the new serial number to be smaller than the old
serial number (using the serial number arithmetics).  Add a warning
message when such fallback happens.
2020-12-11 10:48:28 +01:00
Mark Andrews 3e4f5319ef Merge branch '385-add-a-built-in-ipv4only-arpa-default-zone' into 'main'
Resolve "Add a built-in ipv4only.arpa default zone."

Closes #385

See merge request isc-projects/bind9!479
2020-12-11 06:04:47 +00:00
Mark Andrews ea0dbb5338 Add CHANGES note 2020-12-11 14:21:54 +11:00
Mark Andrews 88943974de Add release note entry 2020-12-11 14:17:52 +11:00
Mark Andrews 6d10a57397 Add RFC 7050 and RFC 8880 to rfc-compliance 2020-12-11 14:17:52 +11:00
Mark Andrews 64c45abab2 Document ipv4only-enable, ipv4only-contact and ipv4only-server. 2020-12-11 14:17:52 +11:00
Mark Andrews 5684c21bcf Generate PTR records for DNS64 mapped ipv4only.arpa reverses.
Rather than generating CNAMES records pointing into IN-ADDR.ARPA,
generate PTR records directly as the names are known as per RFC 8880.
2020-12-11 14:17:52 +11:00
Mark Andrews cdfe660326 Checking synthesis of AAAA of builtin ipv4only.arpa 2020-12-11 14:17:47 +11:00
Mark Andrews c51ef23c22 Implement ipv4only.arpa forward and reverse zones as per RFC 8880. 2020-12-11 14:16:40 +11:00
Mark Andrews e4557f4203 Merge branch 'marka-placeholder' into 'main'
Add placeholders for [GL !4454] and [GL #2324]

See merge request isc-projects/bind9!4485
2020-12-10 02:43:41 +00:00
Mark Andrews 4257415cfb Add placeholders for [GL !4454] and [GL #2324] 2020-12-10 13:40:56 +11:00
Ondřej Surý 8129fce759 Merge branch 'ondrej/release-notes-doesnt-need-copyright' into 'main'
Remove the requirement for the release notes to have copyright

See merge request isc-projects/bind9!4483
2020-12-09 09:48:53 +00:00
Ondřej Surý cb30d9892d Remove the requirement for the release notes to have copyright
The release notes doesn't have to have copyright header, it doesn't add
any value there as the release notes are useless outside the project.
2020-12-09 10:38:05 +01:00
Ondřej Surý afcfb22fc3 Merge branch 'ondrej/clang-format-11' into 'main'
Update the clang version to new stable llvm/clang 11

See merge request isc-projects/bind9!4003
2020-12-08 18:35:25 +00:00
Ondřej Surý c1eb385fdf Bump the clang version to 11 (stable) 2020-12-08 18:36:23 +01:00
Ondřej Surý 7ba18870dc Reformat sources using clang-format-11 2020-12-08 18:36:23 +01:00
Ondřej SurýandOndřej Surý 6c28834354 Explicitly configure new clang-format-11 options 2020-12-08 18:40:43 +01:00
Evan Hunt ff315d328f Merge branch 'placeholder' into 'main'
placeholder for change 5546

See merge request isc-projects/bind9!4473
2020-12-04 19:40:42 +00:00
Evan Hunt 5af9b85eda placeholder for change 5546 2020-12-04 11:37:58 -08:00
Ondřej Surý c64dfadf32 Merge branch 'ondrej/fix-using-the-load-balanced-sockets' into 'main'
Fix s/HAVE_REUSEPORT_LB/HAVE_SO_REUSEPORT_LB/ typo in #define

See merge request isc-projects/bind9!4472
2020-12-04 13:55:56 +00:00
Ondřej Surý 5caf33feda Fix HAVE_SO_REUSEPORT_LB macro name definition
A typo in macro definition caused the load-balanced sockets to be
disabled even on platforms with existing support for load-balanced
sockets.
2020-12-04 14:45:22 +01:00
Ondřej Surý 7176530ecd Merge branch 'ondrej/fix-the-windows-nchildren-problem' into 'main'
Use sock->nchildren instead of mgr->nworkers when initializing NM

See merge request isc-projects/bind9!4469
2020-12-03 17:42:53 +00:00
Ondřej SurýandOndřej Surý 87c5867202 Use sock->nchildren instead of mgr->nworkers when initializing NM
On Windows, we were limiting the number of listening children to just 1,
but we were then iterating on mgr->nworkers.  That lead to scheduling
more async_*listen() than actually allocated and out-of-bound read-write
operation on the heap.
2020-12-03 18:03:25 +01:00
Ondřej Surý ae35829faf Merge branch '2314-fix-datarace-in-nm-connect-functions' into 'main'
Fix datarace when UDP/TCP connect fails and we are in nmthread

Closes #2332 and #2314

See merge request isc-projects/bind9!4468
2020-12-03 14:41:57 +00:00
Ondřej Surý 8e1a05c86b Merge branch 'ondrej/set-openbsd-system-connection-timeout' into 'main'
Configure the system-wide TCP connection timeout on OpenBSD

See merge request isc-projects/bind9!4466
2020-12-03 13:02:57 +00:00
Ondřej SurýandOndřej Surý 8ff15fc028 Configure the system-wide TCP connection timeout on OpenBSD
As there's no TCP connection timeout socket option that we can use, we
need to configure the TCP connection timeout system-wide in the CI, so
the netmgr unit tests doesn't cause assertion failure when there stuck
outgoing TCP connection waiting for 150 second timeout.
2020-12-03 13:02:36 +00:00
Ondřej Surý 151852f428 Fix datarace when UDP/TCP connect fails and we are in nmthread
When we were in nmthread, the isc__nm_async_<proto>connect() function
executes in the same thread as the isc__nm_<proto>connect() and on a
failure, it would block indefinitely because the failure branch was
setting sock->active to false before the condition around the wait had a
chance to skip the WAIT().

This also fixes the zero system test being stuck on FreeBSD 11, so we
re-enable the test in the commit.
2020-12-03 13:56:34 +01:00
Michał Kępień bd59843a4b Merge branch '2333-temporarily-disable-the-legacy-test-on-windows' into 'main'
Temporarily disable the "legacy" test on Windows

See merge request isc-projects/bind9!4462
2020-12-03 11:49:43 +00:00
Michał Kępień 6697f6f066 Temporarily disable the "legacy" test on Windows
The current issues with the way dig handles TCP "connection refused"
errors cause the "legacy" system test to consistently fail on Windows
due to the expected strings not being present in dig output.
Temporarily disable the "legacy" system test on Windows by moving it
from the PARALLEL_COMMON list to the PARALLEL_UNIX list until the
situation is rectified.
2020-12-03 12:48:43 +01:00
Ondřej Surý 48a52234ee Merge branch '2137-so_reuseport-doesn-t-distribute-udp-queries-to-multiple-netmgr-workers-on-macos' into 'main'
Distribute queries among threads even on platforms without SO_REUSEPORT_LB

Closes #2137

See merge request isc-projects/bind9!4459
2020-12-03 09:58:02 +00:00
Ondřej Surý 5e1a23a1b6 Add CHANGES and release note for GL #2137 2020-12-03 09:23:24 +01:00
Ondřej Surý 4adeaab73d Add FreeBSD connection timeout socket option
On FreeBSD, the option to configure connection timeout is called
TCP_KEEPINIT, use it to configure the connection timeout there.

This also fixes the dangling socket problems in the unit test, so
re-enable them.
2020-12-03 09:23:24 +01:00
Ondřej Surý d0f5407825 Merge branch '2332-fix-use-after-free-in-tcpdns_send_direct' into 'main'
Don't use stack allocated buffer for uv_write()

Closes #2332

See merge request isc-projects/bind9!4465
2020-12-03 08:21:10 +00:00
Ondřej Surý 1d066e4bc5 Distribute queries among threads even on platforms without lb sockets
On platforms without load-balancing socket all the queries would be
handle by a single thread.  Currently, the support for load-balanced
sockets is present in Linux with SO_REUSEPORT and FreeBSD 12 with
SO_REUSEPORT_LB.

This commit adds workaround for such platforms that:

1. setups single shared listening socket for all listening nmthreads for
   UDP, TCP and TCPDNS netmgr transports

2. Calls uv_udp_bind/uv_tcp_bind on the underlying socket just once and
   for rest of the nmthreads only copy the internal libuv flags (should
   be just UV_HANDLE_BOUND and optionally UV_HANDLE_IPV6).

3. start reading on UDP socket or listening on TCP socket

The load distribution among the nmthreads is uneven, but it's still
better than utilizing just one thread for processing all the incoming
queries
2020-12-03 09:20:33 +01:00
Ondřej SurýandOndřej Surý 94afea9325 Don't use stack allocated buffer for uv_write()
On FreeBSD, the stack is destroyed more aggressively than on Linux and
that revealed a bug where we were allocating the 16-bit len for the
TCPDNS message on the stack and the buffer got garbled before the
uv_write() sendback was executed.  Now, the len is part of the uvreq, so
we can safely pass it to the uv_write() as the req gets destroyed after
the sendcb is executed.
2020-12-03 08:58:16 +01:00
Artem Boldariev aefe2b9958 Merge branch 'artem/random-additions-to-the-gitignore' into 'main'
Some small, random additions to the .gitignore.

See merge request isc-projects/bind9!4463
2020-12-02 22:25:55 +00:00
Artem Boldariev e6ac4480a4 Some small, random additions to the .gitignore.
Ignores some auxiliary files generated/used by the following tools: -

- clangd
- GNU Global
- Emacs
2020-12-03 00:21:23 +02:00
Michał Kępień 81c080e429 Merge branch '2328-make-netmgr-initialize-and-cleanup-winsock-itself' into 'main'
Make netmgr initialize and cleanup Winsock itself

Closes #2328

See merge request isc-projects/bind9!4458
2020-12-02 21:39:14 +00:00
Michał Kępień 88f96faba8 Make netmgr initialize and cleanup Winsock itself
On Windows, WSAStartup() needs to be called to initialize Winsock before
any sockets are created or else socket() calls will return error code
10093 (WSANOTINITIALISED).  Since BIND's Network Manager is intended to
work as a reusable networking library, it should take care of calling
WSAStartup() - and its cleanup counterpart, WSACleanup() - itself rather
than relying on external code to do it.  Add the necessary WSAStartup()
and WSACleanup() calls to isc_nm_start() and isc_nm_destroy(),
respectively.
2020-12-02 22:36:23 +01:00
Michał Kępień dc2e1dea86 Extend log message for unexpected socket() errors
Make sure the error code is included in the message logged for
unexpected socket creation errors in order to facilitate troubleshooting
on Windows.
2020-12-02 22:36:23 +01:00
Michal Nowak d7f2db0e91 Merge branch '2327-error-uv_wrap-h-no-such-file-or-directory-on-unit-gcc-tarball-ci-job' into 'main'
Add uv_wrap.h to libisctest_la_SOURCES

Closes #2327

See merge request isc-projects/bind9!4451
2020-12-02 15:09:45 +00:00
Michal Nowak 8499825525 Add uv_wrap.h to libisctest_la_SOURCES
uv_wrap.h is included in tcp_test.c and udp_test.c and therefore should
be listed in lib/isc/tests/Makefile.am, otherwise unit test run from
distribution tarball fails to compile:

tcp_test.c:37:10: fatal error: uv_wrap.h: No such file or directory
 #include "uv_wrap.h"
          ^~~~~~~~~~~

udp_test.c:37:10: fatal error: uv_wrap.h: No such file or directory
 #include "uv_wrap.h"
          ^~~~~~~~~~~
2020-12-02 16:08:18 +01:00
Ondřej Surý a6acff5328 Merge branch '2250-dns-flag-day-2020-revert-nocookie-udp-size' into 'main'
Resolve "DNS Flag Day 2020 - EDNS buffer size configuring does not work anymore"

Closes #2250

See merge request isc-projects/bind9!4449
2020-12-02 11:01:16 +00:00
Ondřej SurýandOndřej Surý c7d81f12f8 Add CHANGES and release not for GL #2250 2020-12-02 11:07:01 +01:00
Ondřej SurýandOndřej Surý 79c196fc77 Change the default value for nocookie-udp-size back to 4096
The DNS Flag Day 2020 reduced all the EDNS buffer sizes to 1232.  In
this commit, we revert the default value for nocookie-udp-size back to
4096 because the option is too obscure and most people don't realize
that they also need to change this configuration option in addition to
max-udp-size.
2020-12-02 11:06:42 +01:00
Ondřej Surý a958d646ee Merge branch '2320-avoid-netievent-allocations-if-not-needed' into 'main'
Avoid netievent allocations when the callbacks can be called directly

Closes #2320

See merge request isc-projects/bind9!4452
2020-12-02 10:04:25 +00:00
Ondřej Surý 4e80190663 Add CHANGES note for GL #2320 2020-12-02 10:14:31 +01:00
Ondřej Surý 2e1dd56d0b Fix the data race in accessing the isc_nm_t timers
The following TSAN report about accessing the mgr timers (mgr->init,
mgr->idle, mgr->keepalive and mgr->advertised) has been fixed in this
commit:

    ==================
    WARNING: ThreadSanitizer: data race (pid=2746)
    Read of size 4 at 0x7b440008a948 by thread T18:
    #0 isc__nm_tcpdns_read /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:849:25 (libisc.so.1706+0x2ba0f)
    #1 isc_nm_read /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1679:3 (libisc.so.1706+0x22258)
    #2 tcpdns_connect_connect_cb /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:363:2 (tcpdns_test+0x4bc5fb)
    #3 isc__nm_async_connectcb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1816:2 (libisc.so.1706+0x228c9)
    #4 isc__nm_connectcb /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1791:3 (libisc.so.1706+0x22713)
    #5 tcpdns_connect_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:343:2 (libisc.so.1706+0x2d89d)
    #6 uv__stream_connect /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1381:5 (libuv.so.1+0x27c18)
    #7 uv__stream_io /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1298:5 (libuv.so.1+0x25977)
    #8 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11 (libuv.so.1+0x2e795)
    #9 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:385:5 (libuv.so.1+0x158ec)
    #10 nm_thread /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:530:11 (libisc.so.1706+0x1c94a)

    Previous write of size 4 at 0x7b440008a948 by main thread:
    #0 isc_nm_settimeouts /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:490:12 (libisc.so.1706+0x1dda5)
    #1 tcpdns_recv_two /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:601:2 (tcpdns_test+0x4bad0e)
    #2 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70be)
    #3 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

    Location is heap block of size 281 at 0x7b440008a840 allocated by main thread:
    #0 malloc <null> (tcpdns_test+0x42864b)
    #1 default_memalloc /home/ondrej/Projects/bind9/lib/isc/mem.c:713:8 (libisc.so.1706+0x6d261)
    #2 mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:622:8 (libisc.so.1706+0x69b9c)
    #3 isc___mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:1044:9 (libisc.so.1706+0x6d379)
    #4 isc__mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:2432:10 (libisc.so.1706+0x6889e)
    #5 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:203:8 (libisc.so.1706+0x1c219)
    #6 nm_setup /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:244:11 (tcpdns_test+0x4baaa4)
    #7 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70fd)
    #8 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

    Thread T18 'isc-net-0000' (tid=3513, running) created by main thread at:
    #0 pthread_create <null> (tcpdns_test+0x429e7b)
    #1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:73:8 (libisc.so.1706+0x8476a)
    #2 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:271:3 (libisc.so.1706+0x1c66a)
    #3 nm_setup /home/ondrej/Projects/bind9/lib/isc/tests/tcpdns_test.c:244:11 (tcpdns_test+0x4baaa4)
    #4 cmocka_run_one_test_or_fixture <null> (libcmocka.so.0+0x70fd)
    #5 __libc_start_main /build/glibc-vjB4T1/glibc-2.28/csu/../csu/libc-start.c:308:16 (libc.so.6+0x2409a)

    SUMMARY: ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/isc/netmgr/tcpdns.c:849:25 in isc__nm_tcpdns_read
    ==================
    ThreadSanitizer: reported 1 warnings
2020-12-02 10:14:31 +01:00
Ondřej Surý d6d2fbe0e9 Avoid netievent allocations when the callbacks can be called directly
After turning the users callbacks to be asynchronous, there was a
visible performance drop.  This commit prevents the unnecessary
allocations while keeping the code paths same for both asynchronous and
synchronous calls.

The same change was done to the isc__nm_udp_{read,send} as those two
functions are in the hot path.
2020-12-02 09:45:05 +01:00
Ondřej Surý 886eb5722d Merge branch '2321-netmgr-v2' into 'main'
Refactor netmgr and add more unit tests

Closes #2321, #2061, #1920, #2034, #2266, #2318, #2283, and #2194

See merge request isc-projects/bind9!4444
2020-12-01 17:07:06 +00:00
Ondřej Surý 3e5ee16eb6 Disable the new netmgr tests on non-Linux platforms
The new netmgr tests are not-yet fine-tuned for non-Linux platforms.
Disable them now, so we can move forward and fix the tests of *BSD
in the next iteration.

This commit will get reverted when we add support for netmgr
multi-threading.
2020-12-01 17:24:15 +01:00
Ondřej Surý 0f57732d13 Skip the zero, xfer and ixfr tests on non-Linux platforms
Due to the platform differences, on non-Linux platforms, the xfer and
ixfr tests fails and zero test gets stuck.

This commit will get reverted when we add support for netmgr
multi-threading.
2020-12-01 17:24:06 +01:00
Ondřej Surý 0ba697fe8c The cmocka.h header MUST be included before isc/util.h gets included
The isc/util.h header redefine the DbC checks (REQUIRE, INSIST, ...)  to
be cmocka "fake" assertions.  However that means that cmocka.h needs to
be included after UNIT_TESTING is defined but before isc/util.h is
included.  Because isc/util.h is included in most of the project headers
this means that the sequence MUST be:

    #define UNIT_TESTING
    #include <cmocka.h>

    #include <isc/_anything_.h>

See !2204 for other header requirements for including cmocka.h.
2020-12-01 16:47:25 +01:00
Ondřej Surý c26a2ea134 Add release note for known issue #2137 2020-12-01 16:47:25 +01:00
Ondřej Surý 9811361c4b Add CHANGES note for multiple netmgr issues 2020-12-01 16:47:25 +01:00
Ondřej Surý 634bdfb16d Refactor netmgr and add more unit tests
This is a part of the works that intends to make the netmgr stable,
testable, maintainable and tested.  It contains a numerous changes to
the netmgr code and unfortunately, it was not possible to split this
into smaller chunks as the work here needs to be committed as a complete
works.

NOTE: There's a quite a lot of duplicated code between udp.c, tcp.c and
tcpdns.c and it should be a subject to refactoring in the future.

The changes that are included in this commit are listed here
(extensively, but not exclusively):

* The netmgr_test unit test was split into individual tests (udp_test,
  tcp_test, tcpdns_test and newly added tcp_quota_test)

* The udp_test and tcp_test has been extended to allow programatic
  failures from the libuv API.  Unfortunately, we can't use cmocka
  mock() and will_return(), so we emulate the behaviour with #define and
  including the netmgr/{udp,tcp}.c source file directly.

* The netievents that we put on the nm queue have variable number of
  members, out of these the isc_nmsocket_t and isc_nmhandle_t always
  needs to be attached before enqueueing the netievent_<foo> and
  detached after we have called the isc_nm_async_<foo> to ensure that
  the socket (handle) doesn't disappear between scheduling the event and
  actually executing the event.

* Cancelling the in-flight TCP connection using libuv requires to call
  uv_close() on the original uv_tcp_t handle which just breaks too many
  assumptions we have in the netmgr code.  Instead of using uv_timer for
  TCP connection timeouts, we use platform specific socket option.

* Fix the synchronization between {nm,async}_{listentcp,tcpconnect}

  When isc_nm_listentcp() or isc_nm_tcpconnect() is called it was
  waiting for socket to either end up with error (that path was fine) or
  to be listening or connected using condition variable and mutex.

  Several things could happen:

    0. everything is ok

    1. the waiting thread would miss the SIGNAL() - because the enqueued
       event would be processed faster than we could start WAIT()ing.
       In case the operation would end up with error, it would be ok, as
       the error variable would be unchanged.

    2. the waiting thread miss the sock->{connected,listening} = `true`
       would be set to `false` in the tcp_{listen,connect}close_cb() as
       the connection would be so short lived that the socket would be
       closed before we could even start WAIT()ing

* The tcpdns has been converted to using libuv directly.  Previously,
  the tcpdns protocol used tcp protocol from netmgr, this proved to be
  very complicated to understand, fix and make changes to.  The new
  tcpdns protocol is modeled in a similar way how tcp netmgr protocol.
  Closes: #2194, #2283, #2318, #2266, #2034, #1920

* The tcp and tcpdns is now not using isc_uv_import/isc_uv_export to
  pass accepted TCP sockets between netthreads, but instead (similar to
  UDP) uses per netthread uv_loop listener.  This greatly reduces the
  complexity as the socket is always run in the associated nm and uv
  loops, and we are also not touching the libuv internals.

  There's an unfortunate side effect though, the new code requires
  support for load-balanced sockets from the operating system for both
  UDP and TCP (see #2137).  If the operating system doesn't support the
  load balanced sockets (either SO_REUSEPORT on Linux or SO_REUSEPORT_LB
  on FreeBSD 12+), the number of netthreads is limited to 1.

* The netmgr has now two debugging #ifdefs:

  1. Already existing NETMGR_TRACE prints any dangling nmsockets and
     nmhandles before triggering assertion failure.  This options would
     reduce performance when enabled, but in theory, it could be enabled
     on low-performance systems.

  2. New NETMGR_TRACE_VERBOSE option has been added that enables
     extensive netmgr logging that allows the software engineer to
     precisely track any attach/detach operations on the nmsockets and
     nmhandles.  This is not suitable for any kind of production
     machine, only for debugging.

* The tlsdns netmgr protocol has been split from the tcpdns and it still
  uses the old method of stacking the netmgr boxes on top of each other.
  We will have to refactor the tlsdns netmgr protocol to use the same
  approach - build the stack using only libuv and openssl.

* Limit but not assert the tcp buffer size in tcp_alloc_cb
  Closes: #2061
2020-12-01 16:47:07 +01:00
Mark Andrews 3a36662207 Merge branch '2305-adjust-recursion-limits' into 'main'
Adjust recursion limits

Closes #2305

See merge request isc-projects/bind9!4424
2020-12-01 13:51:16 +00:00
Mark Andrews ab0bf49203 Adjust default value of "max-recursion-queries"
Since the queries sent towards root and TLD servers are now included in
the count (as a result of the fix for CVE-2020-8616),
"max-recursion-queries" has a higher chance of being exceeded by
non-attack queries.  Increase its default value from 75 to 100.
2020-12-01 23:47:23 +11:00
Mark Andrews 1d11013a18 Merge branch '2315-bind-9-11-22-9-11-25-fails-to-build-for-aep-hsm-native-pkcs11' into 'main'
Resolve "BIND 9.11.22 - 9.11.25 fails to build for AEP HSM native pkcs11"

Closes #2315

See merge request isc-projects/bind9!4441
2020-12-01 12:15:57 +00:00
Mark AndrewsandMichał Kępień 356243aaec Add release note for [GL #2315] 2020-12-01 10:52:41 +01:00
Mark Andrews 11a3545e32 Add CHANGES 2020-12-01 10:46:58 +11:00
Mark Andrews 49b9219bb3 Fix misplaced declaration 2020-12-01 10:46:58 +11:00
Michal Nowak 90298dfc18 Merge branch 'mnowak/drop_headerdep_test.sh.in' into 'main'
Drop bin/tests/headerdep_test.sh.in, revise OPTIONS.md

See merge request isc-projects/bind9!4401
2020-11-27 12:14:29 +00:00
Michal Nowak 9567cefd39 Drop bin/tests/headerdep_test.sh.in
The bin/tests/headerdep_test.sh script has not been updated since it was
first created and it cannot be used as-is with the current BIND source
code.  Better tools (e.g. "include-what-you-use") emerged since the
script was committed back in 2000, so instead of trying to bring it up
to date, remove it from the source repository.
2020-11-27 13:11:41 +01:00
Michal Nowak e0e644352c Revise OPTIONS.md
- The STD_CDEFINES build-time variable was dropped when the build
    system was migrated to Automake.  CPPFLAGS is the variable which
    should now be used for setting preprocessor macros.

  - Sort the list of preprocessor macros which affect BIND behavior.
    Remove ISC_BUFFER_USEINLINE from the list as it can be controlled
    using its relevant ./configure option (--enable-buffer-useinline).
    Rename NS_RUN_PID_DIR to NAMED_RUN_PID_DIR to match the source code.

  - Tweak Markdown formatting.
2020-11-27 13:11:41 +01:00
Mark Andrews 3d7a0e7af7 Merge branch '2275-tighten-dns-cookie-response-handling' into 'main'
Resolve "Tighten DNS COOKIE response handling"

Closes #2275

See merge request isc-projects/bind9!4391
2020-11-26 21:10:28 +00:00
Mark Andrews d0dd71380b Add release note for [GL #2275] 2020-11-26 20:48:46 +00:00
Mark Andrews 15e7a4b047 Add CHANGES note for [GL #2275] 2020-11-26 20:48:46 +00:00
Mark Andrews 304df53991 Add comment about cookie sizes 2020-11-26 20:48:46 +00:00
Mark Andrews bd9155590e Check that missing cookies are handled 2020-11-26 20:48:46 +00:00
Mark Andrews 0e3b1f5a25 Tighten DNS COOKIE response handling
Fallback to TCP when we have already seen a DNS COOKIE response
from the given address and don't have one in this UDP response. This
could be a server that has turned off DNS COOKIE support, a
misconfigured anycast server with partial DNS COOKIE support, or a
spoofed response. Falling back to TCP is the correct behaviour in
all 3 cases.
2020-11-26 20:48:46 +00:00
Michal Nowak 8fed3b3e17 Merge branch '2224-fixup-core-back-traces' into 'main'
Resolve "Fixup core back traces."

Closes #2224

See merge request isc-projects/bind9!4279
2020-11-26 17:03:43 +00:00
Michal Nowak 6428fc26af Write traceback file to the same directory as core file
The traceback files could overwrite each other on systems which do not
use different core dump file names for different processes.  Prevent
that by writing the traceback file to the same directory as the core
dump file.

These changes still do not prevent the operating system from overwriting
a core dump file if the same binary crashes multiple times in the same
directory and core dump files are named identically for different
processes.
2020-11-26 18:01:34 +01:00
Mark AndrewsandMichal Nowak 0f0a006c7e Unify whitespace in bin/tests/system/run.sh.in
Replace tabs with spaces to make whitespace consistent across the entire
bin/tests/system/run.sh.in script.
2020-11-26 18:01:33 +01:00
Diego dos Santos Fronza 9d56be5ab2 Merge branch '2281-cid-313104-error-handling-issues-in-lib-ns-query-c' into 'main'
Resolve "CID 313104: Error handling issues in lib/ns/query.c"

Closes #2281

See merge request isc-projects/bind9!4416
2020-11-26 14:57:02 +00:00
Diego Fronza 95add01643 Silence coverity warnings in query.c
Return value of dns_db_getservestalerefresh() and
dns_db_getservestalettl() functions were previously unhandled.

This commit purposefully ignore those return values since there is
no side effect if those results are != ISC_R_SUCCESS, it also supress
Coverity warnings.
2020-11-26 14:55:14 +00:00
Matthijs Mekking 5434529a77 Merge branch '1620-dnssec-policy-nsec3-saltlen-followup' into 'main'
Add one missing check to nsec3param unit test

See merge request isc-projects/bind9!4432
2020-11-26 14:40:34 +00:00
Matthijs Mekking dff01583db Add one missing check to nsec3param unit test
Caught this missing check with clang-build while backporting #1620
to the v9_16 branch.
2020-11-26 12:40:22 +00:00
Michał Kępień dcb8394c0c Merge branch 'michal/use-proper-cmocka-macros-for-pointer-checks' into 'main'
Use proper cmocka macros for pointer checks

See merge request isc-projects/bind9!4415
2020-11-26 12:12:02 +00:00
Michał Kępień f440600126 Use proper cmocka macros for pointer checks
Make sure pointer checks in unit tests use cmocka assertion macros
dedicated for use with pointers instead of those dedicated for use with
integers or booleans.
2020-11-26 13:10:40 +01:00
Michał Kępień 1c9273a40b Merge branch '2310-update-release-checklist' into 'main'
Update release checklist

See merge request isc-projects/bind9!4425
2020-11-26 12:08:09 +00:00
Michał Kępień a83f838a6f Update release checklist
Add an item to the release checklist to make sure the man pages
generated during release preparation are formatted correctly.
2020-11-26 13:07:19 +01:00
Michał Kępień 07c0db2661 Merge branch 'v9_17_7-release' into 'main'
Merge 9.17.7 release branch

See merge request isc-projects/bind9!4426
2020-11-26 11:19:45 +00:00
Michał Kępień 2011a86881 Set up release notes for BIND 9.17.8 2020-11-26 12:16:49 +01:00
Michał Kępień 2bb071ec06 Bump BIND_BASELINE_VERSION for ABI checks 2020-11-26 12:16:49 +01:00
Michał Kępień 09aa4a564d Update BIND version to 9.17.7 2020-11-26 12:12:17 +01:00
Michał Kępień 7475ba842d Add a CHANGES marker 2020-11-26 12:12:17 +01:00
Michał Kępień 2bb0a5dcdb Update library API versions 2020-11-26 12:12:17 +01:00
Michał Kępień 1328a7cbda Merge branch 'michal/prepare-release-notes-for-bind-9.17.7' into 'v9_17_7-release'
Prepare release notes for BIND 9.17.7

See merge request isc-private/bind9!220
2020-11-26 12:12:17 +01:00
Michał Kępień 3a447d02b4 Prepare release notes for BIND 9.17.7 2020-11-26 12:12:17 +01:00
Michał Kępień 42cf594b37 Add release note for GL #2244 2020-11-26 12:12:17 +01:00
Michał Kępień 563f8a78e9 Add release note for GL #2236 2020-11-26 12:12:17 +01:00
Michał Kępień 572bc05aca Add release note for GL #1736 2020-11-26 12:12:17 +01:00
Michał Kępień a4dea3c70c Reorder release notes 2020-11-26 12:12:17 +01:00
Michał Kępień 59221c4b3b Tweak and reword release notes 2020-11-26 12:12:17 +01:00
Michał Kępień 429cac9d1a Tweak and reword recent CHANGES entries 2020-11-26 12:12:17 +01:00
Michał Kępień 3f7ddefdd1 Remove any mention of "make depend" from README.md 2020-11-26 12:12:17 +01:00
Matthijs Mekking 84bf7ce4a6 Merge branch '1620-dnssec-policy-nsec3-saltlen' into 'main'
Resolve "dnssec-policy NSEC3 support"

Closes #1620

See merge request isc-projects/bind9!4299
2020-11-26 10:12:26 +00:00
Matthijs Mekking 64db30942d Add NSEC3PARAM unit test, refactor zone.c
Add unit test to ensure the right NSEC3PARAM event is scheduled in
'dns_zone_setnsec3param()'.  To avoid scheduling and managing actual
tasks, split up the 'dns_zone_setnsec3param()' function in two parts:

1. 'dns__zone_lookup_nsec3param()' that will check if the requested
   NSEC3 parameters already exist, and if a new salt needs to be
   generated.

2. The actual scheduling of the new NSEC3PARAM event (if needed).
2020-11-26 10:43:59 +01:00
Matthijs Mekking 6b5d7357df Detect NSEC3 salt collisions
When generating a new salt, compare it with the previous NSEC3
paremeters to ensure the new parameters are different from the
previous ones.

This moves the salt generation call from 'bin/named/*.s' to
'lib/dns/zone.c'. When setting new NSEC3 parameters, you can set a new
function parameter 'resalt' to enforce a new salt to be generated. A
new salt will also be generated if 'salt' is set to NULL.

Logging salt with zone context can now be done with 'dnssec_log',
removing the need for 'dns_nsec3_log_salt'.
2020-11-26 10:43:59 +01:00
Matthijs Mekking 3b4c764b43 Add zone context to "generated salt" logs 2020-11-26 10:43:59 +01:00
Matthijs Mekking 7878f300ff Move logging of salt in separate function
There may be a desire to log the salt without losing the context
of log module, level, and category.
2020-11-26 10:43:59 +01:00
Matthijs Mekking 6f97bb6b1f Change nsec3param salt config to saltlen
Upon request from Mark, change the configuration of salt to salt
length.

Introduce a new function 'dns_zone_checknsec3aram' that can be used
upon reconfiguration to check if the existing NSEC3 parameters are
in sync with the configuration. If a salt is used that matches the
configured salt length, don't change the NSEC3 parameters.
2020-11-26 10:43:59 +01:00
Matthijs Mekking 00c5dabea3 Add check for NSEC3 and key algorithms
NSEC3 is not backwards compatible with key algorithms that existed
before the RFC 5155 specification was published.
2020-11-26 10:43:59 +01:00
Matthijs Mekking f10790b02d Disable one nsec3 test due to GL #2216
This known bug makes the test fail. There is no trivial fix so disable
test case for now.
2020-11-26 10:43:59 +01:00
Matthijs Mekking 9adad77ac3 Add changes and notes for kasp NSEC3 support
This feature is news worthy.
2020-11-26 10:43:58 +01:00
Matthijs Mekking a5b45bdd03 Add some NSEC3 optout tests
Make sure that just changing the optout value recreates the chain.
2020-11-26 10:43:27 +01:00
Matthijs Mekking 7039c5f805 Check nsec3param configuration values
Check 'nsec3param' configuration for the number of iterations.  The
maximum number of iterations that are allowed are based on the key
size (see https://tools.ietf.org/html/rfc5155#section-10.3).

Check 'nsec3param' configuration for correct salt. If the string is
not "-" or hex-based, this is a bad salt.
2020-11-26 10:43:27 +01:00
Matthijs Mekking eae9a6d297 Don't use 'rndc signing' with kasp
The 'rndc signing' command allows you to manipulate the private
records that are used to store signing state. Don't use these with
'dnssec-policy' as such manipulations may violate the policy (if you
want to change the NSEC3 parameters, change the policy and reconfig).
2020-11-26 10:43:27 +01:00
Matthijs Mekking ba8128ea00 Fix a reconfig bug wrt inline-signing
When doing 'rndc reconfig', named may complain about a zone not being
reusable because it has a raw version of the zone, and the new
configuration has not set 'inline-signing'. However, 'inline-signing'
may be implicitly true if a 'dnssec-policy' is used for the zone, and
the zone is not dynamic.

Improve the check in 'named_zone_reusable'.  Create a new function for
checking 'inline-signing' configuration that matches existing code in
'bin/named/server.c'.
2020-11-26 10:43:27 +01:00
Matthijs Mekking 114af58ee2 Support for NSEC3 in dnssec-policy
Implement support for NSEC3 in dnssec-policy.  Store the configuration
in kasp objects. When configuring a zone, call 'dns_zone_setnsec3param'
to queue an nsec3param event. This will ensure that any previous
chains will be removed and a chain according to the dnssec-policy is
created.

Add tests for dnssec-policy zones that uses the new 'nsec3param'
option, as well as changing to new values, changing to NSEC, and
changing from NSEC.
2020-11-26 10:43:27 +01:00
Matthijs Mekking f7ca96c805 Add kasp nsec3param configuration
Add configuration and documentation on how to enable NSEC3 when
using dnssec-policy for signing your zones.
2020-11-26 10:43:27 +01:00
Matthijs Mekking 84a4273074 Move generate_salt function to lib/dns/nsec3
We will be using this function also on reconfig, so it should have
a wider availability than just bin/named/server.
2020-11-26 10:43:27 +01:00
Michał Kępień aa3b489216 Merge branch 'michal/fix-cppcheck-2.2-issues' into 'main'
Fix cppcheck 2.2 issues

See merge request isc-projects/bind9!4292
2020-11-25 12:16:53 +00:00
Michał Kępień ea54a932d2 Convert add_quota() to a function
cppcheck 2.2 reports the following false positive:

    lib/isc/tests/quota_test.c:71:21: error: Array 'quotas[101]' accessed at index 110, which is out of bounds. [arrayIndexOutOfBounds]
     isc_quota_t *quotas[110];
                        ^

The above is not even an array access, so this report is obviously
caused by a cppcheck bug.  Yet, it seems to be triggered by the presence
of the add_quota() macro, which should really be a function.  Convert
the add_quota() macro to a function in order to make the code cleaner
and to prevent the above cppcheck 2.2 false positive from being
triggered.
2020-11-25 12:45:47 +01:00
Michał Kępień 0b6216d1c7 Silence cppcheck 2.2 false positive in udp_recv()
cppcheck 2.2 reports the following false positive:

    lib/dns/dispatch.c:1239:14: warning: Either the condition 'resp==NULL' is redundant or there is possible null pointer dereference: resp. [nullPointerRedundantCheck]
     if (disp != resp->disp) {
                 ^
    lib/dns/dispatch.c:1210:11: note: Assuming that condition 'resp==NULL' is not redundant
     if (resp == NULL) {
              ^
    lib/dns/dispatch.c:1239:14: note: Null pointer dereference
     if (disp != resp->disp) {
                 ^

Apparently this version of cppcheck gets confused about conditional
"goto" statements because line 1239 can never be reached if 'resp' is
NULL.

Move a code block to prevent the above false positive from being
reported without affecting the processing logic.
2020-11-25 12:45:47 +01:00
Michał Kępień d9701e22b5 Teach cppcheck that fatal() does not return
cppcheck is not aware that the bin/dnssec/dnssectool.c:fatal() function
does not return.  This triggers certain cppcheck 2.2 false positives,
for example:

    bin/dnssec/dnssec-signzone.c:3471:13: warning: Either the condition 'ndskeys==8' is redundant or the array 'dskeyfile[8]' is accessed at index 8, which is out of bounds. [arrayIndexOutOfBoundsCond]
       dskeyfile[ndskeys++] = isc_commandline_argument;
                ^
    bin/dnssec/dnssec-signzone.c:3468:16: note: Assuming that condition 'ndskeys==8' is not redundant
       if (ndskeys == MAXDSKEYS) {
                   ^
    bin/dnssec/dnssec-signzone.c:3471:13: note: Array index out of bounds
       dskeyfile[ndskeys++] = isc_commandline_argument;
                ^

    bin/dnssec/dnssec-signzone.c:772:20: warning: Either the condition 'l->hashbuf==NULL' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
     memset(l->hashbuf + l->entries * l->length, 0, l->length);
                       ^
    bin/dnssec/dnssec-signzone.c:768:18: note: Assuming that condition 'l->hashbuf==NULL' is not redundant
      if (l->hashbuf == NULL) {
                     ^
    bin/dnssec/dnssec-signzone.c:772:20: note: Null pointer addition
     memset(l->hashbuf + l->entries * l->length, 0, l->length);
                       ^

Instead of suppressing all such warnings individually, conditionally
define a preprocessor macro which prevents them from being triggered.
2020-11-25 12:45:47 +01:00
Michał Kępień f06dfe0397 Remove cppcheck 2.0 false positive workarounds
The cppcheck bug which commit 481fa34e50
works around was fixed in cppcheck 2.2.  Drop the relevant hack from the
definition of the cppcheck GitLab CI job.
2020-11-25 12:45:47 +01:00
Evan Hunt 7d1e2e6692 Merge branch '2141-asynchrony-support-for-bind-9-query-plugins' into 'main'
Resolve "asynchrony support for BIND 9 query plugins"

Closes #2141

See merge request isc-projects/bind9!4407
2020-11-25 00:59:19 +00:00
Evan Hunt 5285443c5f CHANGES 2020-11-24 15:11:57 -08:00
Evan Hunt c3a90b1d2c create system test with asynchronous plugin
the test-async plugin uses ns_query_hookasync() at the
NS_QUERY_DONE_SEND hook point to call an asynchronous function.
the only effect is to change the query response code to "NOTIMP",
so we can confirm that the hook ran and resumed correctly.
2020-11-24 15:11:39 -08:00
JINMEI TatuyaandEvan Hunt 75cdd758ed implementation of hook-based asynchronous functionality
previously query plugins were strictly synchrounous - the query
process would be interrupted at some point, data would be looked
up or a change would be made, and then the query processing would
resume immediately.

this commit enables query plugins to initiate asynchronous processes
and resume on a completion event, as with recursion.
2020-11-24 15:11:39 -08:00
JINMEI TatuyaandEvan Hunt 9c8dae041d ns_query refactoring for hook-based recursion
several small changes to query processing to make it easier to
use hook-based recursion (and other asynchronous functionlity)
later.

- recursion quota check is now a separate function,
  check_recursionquota(), which is called by ns_query_recurse().
- pass isc_result to query_nxdomain() instead of bool.
  the value of 'empty_wild' will be determined in the function
  based on the passed result.  this is similar to query_nodata(),
  and makes the signatures of the two functions more consistent.
- pass the current 'result' value into plugin hooks.
2020-11-24 15:11:39 -08:00
Mark Andrews bdb8729f88 Merge branch '1154-add-dns64-prefix-discover-support' into 'main'
Resolve "Add dns64 prefix discover support"

Closes #1154

See merge request isc-projects/bind9!2178
2020-11-24 21:45:56 +00:00
Mark Andrews fbad04a51a Add release note 2020-11-25 08:25:29 +11:00
Mark Andrews 9cb3294ff6 add CHANGES 2020-11-25 08:25:29 +11:00
Mark Andrews 9a224a3c27 add +dns64prefix to dig to display any DNS64 prefixes at IPV4ONLY.ARPA 2020-11-25 08:25:29 +11:00
Mark Andrews 38d6f68de4 add dns_dns64_findprefix 2020-11-25 08:25:29 +11:00
Michal Nowak 9c8dd9b678 Merge branch '1730-clean-up-no-op-ac_subst-calls' into 'main'
Remove unused Autoconf variables

See merge request isc-projects/bind9!4402
2020-11-24 17:33:51 +00:00
Michał Kępień f8d155a9ef Refactor libidn2 detection code
Make the code block handling the --with-libidn2=/path/to/libidn2 form of
the --with-libidn2 build-time option behave more similarly to the
PKG_CHECK_MODULES() macro.
2020-11-24 14:51:51 +01:00
Michal NowakandMichał Kępień ef18d9251e Remove unused DLZ_DRIVER_MYSQL_* build variables
The DLZ_DRIVER_MYSQL_INCLUDES and DLZ_DRIVER_MYSQL_LIBS build variables
are not used anywhere.  Remove their definitions and the associated
AC_SUBST() calls.
2020-11-24 14:51:51 +01:00
Michal NowakandMichał Kępień 6db5088e17 Remove AC_SUBST() calls from AX_LIB_LMDB()
LMDB build variables are already substituted by AC_SUBST() calls in
configure.ac and therefore the latter should not be duplicated in the
AX_LIB_LMDB() helper macro.
2020-11-24 14:51:51 +01:00
Michał Kępień 856a52a672 Merge branch 'michal/update-release-checklist' into 'main'
Update release checklist

See merge request isc-projects/bind9!4406
2020-11-24 12:57:47 +00:00
Michał Kępień 9b9f7b09f2 Update release checklist
Apply a number of tweaks to the release checklist in order to make it
better reflect the current release process.
2020-11-24 13:50:57 +01:00
Evan Hunt dbb4c3a0e8 Merge branch '2288-dig-interrupt-crash' into 'main'
Resolve ""dig" crashes when interrupted while waiting for a TCP connection"

Closes #2288

See merge request isc-projects/bind9!4397
2020-11-23 20:28:46 +00:00
Evan Hunt 17145e4ef4 dig could crash on interrupt
dig could crash if it was shut down by an interrupt while a connection
was pending.
2020-11-23 20:00:04 +00:00
Michał Kępień a4487688dd Merge branch 'michal/enable-stress-tests-to-be-run-on-demand' into 'main'
Enable "stress" tests to be run on demand

See merge request isc-projects/bind9!4313
2020-11-23 10:51:32 +00:00
Michał Kępień f23094223e Enable "stress" tests to be run on demand
The "stress" test can be run in different ways, depending on:

  - the tested scenario (authoritative, recursive),
  - the operating system used (Linux, FreeBSD),
  - the architecture used (amd64, arm64).

Currently, all supported "stress" test variants are automatically
launched for all scheduled pipelines and for pipelines started for tags;
there is no possibility of running these tests on demand, which could be
useful in certain circumstances.

Employ the "only:variables" key to enable fine-grained control over the
list of "stress" test jobs to be run for a given pipeline.  Three CI
variables are used to specify the list of "stress" test jobs to create:

  - BIND_STRESS_TEST_MODE: specifies the test mode to use; must be
    explicitly set in order for any "stress" test job to be created;
    allowed values are: "authoritative", "recursive",

  - BIND_STRESS_TEST_OS: specifies the operating system to run the test
    on; allowed values are: "linux", "freebsd"; defaults to "linux", may
    be overridden at pipeline creation time,

  - BIND_STRESS_TEST_ARCH: specifies the architecture to run the test
    on; allowed values are: "amd64", "arm64"; defaults to "amd64", may
    be overridden at pipeline creation time.

Since case-insensitive regular expressions are used for determining
which jobs to run, every variable described above may contain multiple
values.  For example, setting the BIND_STRESS_TEST_MODE variable to
"authoritative,recursive" will cause the "stress" test to be run in both
supported scenarios (either on the default OS/architecture combination,
i.e. Linux/amd64, or, if the relevant variables are explicitly
specified, the requested OS/architecture combinations).
2020-11-23 11:46:50 +01:00
Mark Andrews 79a1074cbe Merge branch 'matthijs-fix-echo_i-in-auth-test' into 'main'
Fix syntax in echo_i messages

See merge request isc-projects/bind9!4400
2020-11-19 23:41:22 +00:00
Matthijs Mekking 53188daf5b Fix syntax in echo_i messages
It's either "record returns" or "records return".
2020-11-19 11:40:19 +01:00
Mark Andrews 41b13dab64 Merge branch 'marka-fix-stop.sh' into 'main'
bin/tests/system/stop.sh was not working

See merge request isc-projects/bind9!4399
2020-11-19 05:19:56 +00:00
Mark Andrews da1243fe9d bin/tests/system/stop.sh was not working
It failed to export builddir srcdir resulting in stop.pl failing
when these where looked for in the environment.
2020-11-19 16:15:26 +11:00
Mark Andrews 3065d54142 Merge branch '2280-check-dname-handling-when-qtype-is-cname-any' into 'main'
Resolve "Check DNAME handling when QTYPE is CNAME/ANY"

Closes #2280

See merge request isc-projects/bind9!4393
2020-11-18 23:48:30 +00:00
Mark Andrews e980affba0 Fix DNAME when QTYPE is CNAME or ANY
The synthesised CNAME is not supposed to be followed when the
QTYPE is CNAME or ANY as the lookup is satisfied by the CNAME
record.
2020-11-19 10:18:01 +11:00
396 changed files with 39353 additions and 8964 deletions
+3
View File
@@ -11,6 +11,7 @@ BraceWrapping:
AfterFunction: false # should also be MultiLine, but not yet supported
AfterExternBlock: false
BeforeElse: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
AllowShortIfStatementsOnASingleLine: false
@@ -19,6 +20,7 @@ AlwaysBreakAfterReturnType: All
Cpp11BracedListStyle: false
ColumnLimit: 80
AlignAfterOpenBracket: Align
AlignConsecutiveBitFields: true
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: true
AlignTrailingComments: true
@@ -62,6 +64,7 @@ IncludeCategories:
Priority: 1
- Regex: '.*'
Priority: 0
IndentExternBlock: NoIndent
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
PenaltyBreakAssignment: 30
+3
View File
@@ -11,6 +11,7 @@ BraceWrapping:
AfterFunction: false # should also be MultiLine, but not yet supported
AfterExternBlock: false
BeforeElse: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
AllowShortIfStatementsOnASingleLine: false
@@ -19,6 +20,7 @@ AlwaysBreakAfterReturnType: All
Cpp11BracedListStyle: false
ColumnLimit: 80
AlignAfterOpenBracket: Align
AlignConsecutiveBitFields: true
AlignConsecutiveDeclarations: true
AlignConsecutiveMacros: true
AlignTrailingComments: true
@@ -50,6 +52,7 @@ IncludeCategories:
Priority: 1
- Regex: '".*"'
Priority: 9
IndentExternBlock: NoIndent
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
PenaltyBreakAssignment: 30
+3
View File
@@ -106,6 +106,9 @@
(list
"--enable=all"
"--suppress=missingIncludeSystem"
"--suppress=nullPointerRedundantCheck"
(concat "--suppressions-list=" (expand-file-name
(concat directory-of-current-dir-locals-file "util/suppressions.txt")))
(concat "-include=" (expand-file-name
(concat directory-of-current-dir-locals-file "config.h")))
)
+12
View File
@@ -61,6 +61,8 @@ named.memstats
named.run
timestamp
/compile_commands.json
# Gets generated by Build Ear (bear)
/compile_commands.commands.json
/cppcheck_html/
/cppcheck.results
/tsan
@@ -87,3 +89,13 @@ doc/man/pkcs11-destroy.8in
doc/man/pkcs11-keygen.8in
doc/man/pkcs11-list.8in
doc/man/pkcs11-tokens.8in
# clangd index directory
/\.cache/
# GNU Global index files
/GPATH
/GRTAGS
/GTAGS
# Emacs specific files
\.dir-locals-2.el
/emacs.desktop
/emacs.desktop-lock
+37 -52
View File
@@ -16,16 +16,16 @@ variables:
TEST_PARALLEL_JOBS: 6
CONFIGURE: ./configure
CLANG: clang-10
SCAN_BUILD: scan-build-10
ASAN_SYMBOLIZER_PATH: /usr/lib/llvm-10/bin/llvm-symbolizer
CLANG_FORMAT: clang-format-10
CLANG: clang-11
SCAN_BUILD: scan-build-11
ASAN_SYMBOLIZER_PATH: /usr/lib/llvm-11/bin/llvm-symbolizer
CLANG_FORMAT: clang-format-11
CFLAGS_COMMON: -fno-omit-frame-pointer -fno-optimize-sibling-calls -O1 -g -Wall -Wextra
# Pass run-time flags to AddressSanitizer to get core dumps on error.
ASAN_OPTIONS_COMMON: abort_on_error=1:disable_coredump=0:unmap_shadow_on_exit=1
TSAN_OPTIONS_COMMON: "second_deadlock_stack=1 history_size=7 log_exe_name=true log_path=tsan external_symbolizer_path=/usr/lib/llvm-10/bin/llvm-symbolizer"
TSAN_OPTIONS_COMMON: "second_deadlock_stack=1 history_size=7 log_exe_name=true log_path=tsan external_symbolizer_path=/usr/lib/llvm-11/bin/llvm-symbolizer"
TARBALL_EXTENSION: xz
@@ -42,6 +42,10 @@ variables:
# In multithreaded unit tests, abort on the first failure
CMOCKA_TEST_ABORT: 1
# Default platforms to run "stress" tests on
BIND_STRESS_TEST_OS: linux
BIND_STRESS_TEST_ARCH: amd64
stages:
- autoconf
- precheck
@@ -281,6 +285,7 @@ stages:
"with-openssl=C:/OpenSSL"
"with-libxml2=C:/libxml2"
"with-libuv=C:/libuv"
"with-nghttp2=C:/nghttp2"
"without-python"
"with-system-tests"
x64'
@@ -379,6 +384,7 @@ stages:
<<: *default_triggering_rules
stage: unit
before_script:
- if [ -n "$TCP_CONNECTIONTIMEOUT" ]; then sudo sysctl 'net.inet.tcp.keepinittime=1'; fi
- *setup_softhsm
script:
- make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1
@@ -418,9 +424,6 @@ stages:
<<: *default_triggering_rules
stage: postcheck
script:
# Workaround for cppcheck 2.0 uninitvar false positives triggered by (&var)->field syntax
# (see: https://sourceforge.net/p/cppcheck/discussion/general/thread/122153e3c1/)
- sed -i '/^#define ISC__BUFFER.*\\$/{s|_b|__b|;N;s|do {|\0 isc_buffer_t *_b = (isc_buffer_t *)__b;|}; /^#define ISC__BUFFER.*REGION.*\\$/{s|_r|__r|;N;s|do {|\0 isc_region_t *_r = (isc_region_t *)__r;|; /USEDREGION/{s|isc_buffer_t|const \0|g}}' lib/isc/include/isc/buffer.h
- *configure
- (make -nwk all || true) | compiledb
- export GCC_VERSION=$(gcc --version | sed -n 's/.* \([0-9]\+\)\.[0-9]\+\.[0-9]\+.*/\1/p')
@@ -453,9 +456,11 @@ misc:
- sh util/tabify-changes < CHANGES > CHANGES.tmp
- diff -urNap CHANGES CHANGES.tmp
- perl util/check-changes CHANGES
- sh util/check-line-length.sh CHANGES
- test ! -f CHANGES.SE || sh util/tabify-changes < CHANGES.SE > CHANGES.tmp
- test ! -f CHANGES.SE || diff -urNap CHANGES.SE CHANGES.tmp
- test ! -f CHANGES.SE || perl util/check-changes master=0 CHANGES.SE
- test ! -f CHANGES.SE || sh util/check-line-length.sh CHANGES.SE
- rm CHANGES.tmp
- perl -w util/merge_copyrights
- diff -urNap util/copyrights util/newcopyrights
@@ -1215,6 +1220,8 @@ unit:clang:openbsd:amd64:
<<: *unit_test_job
variables:
USER: gitlab-runner
# There's no socket option on OpenBSD, so we need to set this globally
TCP_CONNECTIONTIMEOUT: 1
needs:
- job: clang:openbsd:amd64
artifacts: true
@@ -1317,10 +1324,10 @@ release:
)
test "$(md5sum cov-analysis-linux64.tgz | awk '{ print $1 }')" = "$(cat cov-analysis-linux64.md5)"
tar --extract --gzip --file=cov-analysis-linux64.tgz
test -d cov-analysis-linux64-2019.03
test -d cov-analysis-linux64-2020.09
.coverity_build: &coverity_build |
cov-analysis-linux64-2019.03/bin/cov-build --dir cov-int sh -c 'make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1'
cov-analysis-linux64-2020.09/bin/cov-build --dir cov-int sh -c 'make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1'
tar --create --gzip --file=cov-int.tar.gz cov-int/
curl -v https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME \
--form token=$COVERITY_SCAN_TOKEN \
@@ -1356,7 +1363,7 @@ coverity:
- $COVERITY_SCAN_PROJECT_NAME
- $COVERITY_SCAN_TOKEN
cache:
key: cov-analysis-linux64-2019.03
key: cov-analysis-linux64-2020.09
paths:
- cov-analysis-linux64.md5
- cov-analysis-linux64.tgz
@@ -1410,9 +1417,6 @@ respdiff:
needs:
- job: autoreconf
artifacts: true
only:
- schedules
- tags
artifacts:
untracked: true
expire_in: "1 day"
@@ -1429,6 +1433,9 @@ stress:authoritative:fedora:33:amd64:
MODE: authoritative
RATE: 10000
RUN_TIME: 1
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /authoritative/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
stress:recursive:fedora:33:amd64:
<<: *fedora_33_amd64_image
@@ -1440,6 +1447,9 @@ stress:recursive:fedora:33:amd64:
MODE: recursive
RATE: 10000
RUN_TIME: 1
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /recursive/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
stress:authoritative:fedora:33:arm64:
<<: *fedora_33_arm64_image
@@ -1451,6 +1461,9 @@ stress:authoritative:fedora:33:arm64:
MODE: authoritative
RATE: 10000
RUN_TIME: 1
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /authoritative/i && $BIND_STRESS_TEST_ARCH =~ /arm64/i)
stress:recursive:fedora:33:arm64:
<<: *fedora_33_arm64_image
@@ -1462,8 +1475,11 @@ stress:recursive:fedora:33:arm64:
MODE: recursive
RATE: 10000
RUN_TIME: 1
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /recursive/i && $BIND_STRESS_TEST_ARCH =~ /arm64/i)
stress:authoritative:freebsd12:
stress:authoritative:freebsd12:amd64:
<<: *freebsd_12_amd64_image
<<: *freebsd_stress_amd64
<<: *stress_job
@@ -1473,10 +1489,11 @@ stress:authoritative:freebsd12:
MODE: authoritative
RATE: 10000
RUN_TIME: 1
# See: https://gitlab.isc.org/isc-projects/bind9/-/issues/1941
allow_failure: true
only:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /freebsd/i && $BIND_STRESS_TEST_MODE =~ /authoritative/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
stress:recursive:freebsd12:
stress:recursive:freebsd12:amd64:
<<: *freebsd_12_amd64_image
<<: *freebsd_stress_amd64
<<: *stress_job
@@ -1486,41 +1503,9 @@ stress:recursive:freebsd12:
MODE: recursive
RATE: 10000
RUN_TIME: 1
# See: https://gitlab.isc.org/isc-projects/bind9/-/issues/1941
allow_failure: true
# ABI check
abi-check:
<<: *base_image
stage: build
needs:
- job: autoreconf
artifacts: true
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
BIND_BASELINE_VERSION: v9_17_6
script:
- *configure
- make -j${BUILD_PARALLEL_JOBS:-1} V=1
- git clone --branch "${BIND_BASELINE_VERSION}" --depth 1 https://gitlab.isc.org/isc-projects/bind9.git refbind
- cd refbind/
- autoreconf -fi
- *configure
- make -j${BUILD_PARALLEL_JOBS:-1} V=1
- cd ..
- util/api-checker.sh . refbind
artifacts:
paths:
- "*-lib*.html"
- "*-lib*.txt"
- "abi-*.dump"
expire_in: "1 week"
only:
- main@isc-projects/bind9
- /^v9_[1-9][0-9]$/@isc-projects/bind9
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /freebsd/i && $BIND_STRESS_TEST_MODE =~ /recursive/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
gcov:
<<: *base_image
+32 -17
View File
@@ -6,6 +6,26 @@
**Public Release:**
## Documentation Review Links
**Closed issues assigned to the milestone without a release note:**
- []()
- []()
- []()
**Merge requests merged into the milestone without a release note:**
- []()
- []()
- []()
**Merge requests merged into the milestone without a `CHANGES` entry:**
- []()
- []()
- []()
## Release Checklist
### Before the Code Freeze
@@ -21,20 +41,17 @@
- [ ] ***(QA)*** Look for outstanding documentation issues (e.g. `CHANGES` mistakes) and address them if any are found.
- [ ] ***(QA)*** Ensure release notes are correct, ask Support and Marketing to check them as well.
- [ ] ***(Support)*** Check release notes, ask QA to correct any mistakes found.
- [ ] ***(Marketing)*** Check release notes, ask QA to correct any mistakes found.
- [ ] ***(SwEng)*** Update API files for libraries with new version information.
- [ ] ***(SwEng)*** Change software version and library versions in `configure.ac` (new major release only).
- [ ] ***(SwEng)*** Rebuild `configure` using Autoconf on `docs.isc.org`.
- [ ] ***(SwEng)*** Update `CHANGES`.
- [ ] ***(SwEng)*** Update `CHANGES.SE` (Subscription Edition only).
- [ ] ***(SwEng)*** Update `README.md`.
- [ ] ***(SwEng)*** Update `version`.
- [ ] ***(SwEng)*** Build documentation on `docs.isc.org`.
- [ ] ***(QA)*** Check that all the above steps were performed correctly.
- [ ] ***(QA)*** Update API files for libraries with new version information.
- [ ] ***(QA)*** Change software version and library versions in `configure.ac` (new major release only).
- [ ] ***(QA)*** Rebuild `configure` using Autoconf on `docs.isc.org`.
- [ ] ***(QA)*** Update `CHANGES`.
- [ ] ***(QA)*** Update `CHANGES.SE` (Subscription Edition only).
- [ ] ***(QA)*** Update `README.md`.
- [ ] ***(QA)*** Update `version`.
- [ ] ***(QA)*** Build documentation on `docs.isc.org`.
- [ ] ***(QA)*** Check that the formatting is correct for text, PDF, and HTML versions of release notes.
- [ ] ***(SwEng)*** Tag the releases[^2]. (Tags may only be pushed to the public repository for releases which are *not* security releases.)
- [ ] ***(SwEng)*** If this is the first tag for a release (e.g. beta), create a release branch named `release_v9_X_Y` to allow development to continue on the maintenance branch whilst release engineering continues.
- [ ] ***(QA)*** Check that the formatting of the generated man pages is correct.
- [ ] ***(QA)*** Tag the releases in the private repository (`git tag -s -m "BIND 9.x.y" v9_x_y`).
### Before the ASN Deadline (for ASN Releases) or the Public Release Date (for Regular Releases)
@@ -64,13 +81,11 @@
- [ ] ***(Marketing)*** Update [Wikipedia entry for BIND](https://en.wikipedia.org/wiki/BIND).
- [ ] ***(Marketing)*** Write blog article (if a major release).
- [ ] ***(QA)*** Ensure all new tags are annotated and signed.
- [ ] ***(SwEng)*** Merge the automatically prepared `prep 9.X.Y` commit which updates `version` and documentation on the release branch into the relevant maintenance branch (`v9_X`).
- [ ] ***(SwEng)*** Push tags for the published releases to the public repository.
- [ ] ***(QA)*** Push tags for the published releases to the public repository.
- [ ] ***(QA)*** Merge the automatically prepared `prep 9.x.y` commit which updates `version` and documentation on the release branch into the relevant maintenance branch (`v9_x`).
- [ ] ***(QA)*** For each maintained branch, update the `BIND_BASELINE_VERSION` variable for the `abi-check` job in `.gitlab-ci.yml` to the latest published BIND version tag for a given branch.
- [ ] ***(QA)*** Prepare empty release notes for the next set of releases.
- [ ] ***(QA)*** Sanitize all confidential issues assigned to the release milestone and make them public.
- [ ] ***(QA)*** Update QA tools used in GitLab CI (e.g. Flake8, PyLint) by modifying the relevant `Dockerfile`.
[^1]: If not, use the time remaining until the tagging deadline to ensure all outstanding issues are either resolved or moved to a different milestone.
[^2]: Preferred command line: `git tag -u <DEVELOPER_KEYID> -a -s -m "BIND 9.X.Y[alphatag]" v9_X_Y[alphatag]`, where `[alphatag]` is an optional string such as `b1`, `rc1`, etc.
+189 -32
View File
@@ -1,48 +1,206 @@
5533. [func] Add "stale-refresh-time" option, a time window that
starts after a failed lookup, during which stale rrset
will be served directly from cache before a new
attempt to refresh it is made. [GL #2066]
5575. [func] Initial support for DNS-over-HTTP(S). BIND now
includes DNS-over-HTTP(S) layer built on top of nghttp2.
Both encrypted (via TLS) and unencrypted HTTP/2 connections
are supported.
5574. [func] Incoming zone transfers can now use TLS.
Addresses in a "primaries" list take an optional
"tls" argument, specifying either a previously
configured "tls" block or "ephemeral"; SOA queries
and zone transfer requests will then be sent via
TLS. [GL #2392]
5573. [func] Also return stale data if an error occurred and we are
not resuming. Only start the stale-refresh-time window
if we timed out. [GL #2434]
5572. [bug] Address potential double free in generatexml.
[GL #2420]
5571. [bug] If a zone had a non-builtin named allow-update acl
named failed to start. [GL #2413]
5570. [bug] Improve the performance of dnssec-verify by reducing
the number of repeated calls to dns_dnssec_keyfromrdata.
[GL #2073]
5569. [bug] Emit useful error message when 'rndc retransfer' is
applied to a zone of inappropriate type. [GL #2342]
5568. [bug] Fixed a crash in "dnssec-keyfromlabel" when using ECDSA
keys. [GL #2178]
5567. [bug] Dig now reports unknown dash options while pre-parsing
the options. This prevents '-multi' instead of
'+multi' reporting memory usage before ending option
parsing on 'Invalid option: -lti'. [GL #2403]
5566. [func] Add "stale-answer-client-timeout" option, which
is the amount of time a recursive resolver waits before
attempting to answer the query using stale data from
cache. [GL #2247]
5565. [func] The SONAMEs for BIND 9 libraries now include the current
BIND 9 version number, in an effort to tightly couple
internal libraries with a specific release. [GL #2387]
5564. [cleanup] Refactored the network manager TLSDNS module to use
libuv and libssl directly, rather than opening a
TLS/TCP socket stack. [GL #2235]
5563. [cleanup] Changed several obsolete configuration options to
ancient, making them into fatal errors. Also cleaned
up the number of clause flags in the configuration
parser. [GL #1086]
5562. [placeholder]
5561. [bug] KASP incorrectly set signature validity to the value
of the DNSKEY signature validity. This is now fixed.
[GL #2383]
5560. [func] The default value of "max-stale-ttl" has been changed
from 12 hours to 1 day and the default value of
"stale-answer-ttl" has been changed from 1 second to
30 seconds, following RFC 8767 recommendations.
[GL #2248]
--- 9.17.9 released ---
5559. [bug] The --with-maxminddb=PATH form of the build-time option
enabling support for libmaxminddb was not working
correctly. This has been fixed. [GL #2366]
5558. [bug] Asynchronous hook modules could trigger an assertion
failure when the fetch handle was detached too late.
Thanks to Jinmei Tatuya at Infoblox. [GL #2379]
5557. [bug] Prevent RBTDB instances from being destroyed by multiple
threads at the same time. [GL #2317]
5556. [bug] Further tweak newline printing in dnssec-signzone and
dnssec-verify. [GL #2359]
5555. [placeholder]
5554. [bug] dnssec-signzone and dnssec-verify were missing newlines
between log messages. [GL #2359]
5553. [bug] When reconfiguring named, removing "auto-dnssec" did not
turn off DNSSEC maintenance. [GL #2341]
5552. [func] When switching to "dnssec-policy none;", named now
permits a safe transition to insecure mode and publishes
the CDS and CDNSKEY DELETE records, as described in RFC
8078. [GL #1750]
5551. [bug] named no longer attempts to assign threads to CPUs
outside the CPU affinity set. Thanks to Ole Bjørn
Hessen. [GL #2245]
5550. [func] dnssec-signzone and named now log a warning when falling
back to the "increment" SOA serial method. [GL #2058]
5549. [protocol] ipv4only.arpa is now served when DNS64 is configured.
[GL #385]
5548. [placeholder]
5547. [placeholder]
--- 9.17.8 released ---
5546. [placeholder]
5545. [func] OS support for load-balanced sockets is no longer
required to receive incoming queries in multiple netmgr
threads. [GL #2137]
5544. [func] Restore the default value of "nocookie-udp-size" to 4096
bytes. [GL #2250]
5543. [bug] Fix UDP performance issues caused by making netmgr
callbacks asynchronous-only. [GL #2320]
5542. [bug] Refactor netmgr. [GL #1920] [GL #2034] [GL #2061]
[GL #2194] [GL #2221] [GL #2266] [GL #2283] [GL #2318]
[GL #2321]
5541. [func] Adjust the "max-recursion-queries" default from 75 to
100. [GL #2305]
5540. [port] Fix building with native PKCS#11 support for AEP Keyper.
[GL #2315]
5539. [bug] Tighten handling of missing DNS COOKIE responses over
UDP by falling back to TCP. [GL #2275]
5538. [func] Add NSEC3 support to KASP. A new option for
"dnssec-policy", "nsec3param", can be used to set the
desired NSEC3 parameters. NSEC3 salt collisions are
automatically prevented during resalting. Salt
generation is now logged with zone context. [GL #1620]
5537. [func] The query plugin mechanism has been extended
to support asynchronous operations. For example, a
plugin can now trigger recursion and resume
processing when it is complete. Thanks to Jinmei
Tatuya at Infoblox. [GL #2141]
5536. [func] Dig can now report the DNS64 prefixes in use
(+dns64prefix). [GL #1154]
5535. [bug] dig/nslookup/host could crash on shutdown after an
interrupt. [GL #2287] [GL #2288]
5534. [bug] The CNAME synthesized from a DNAME was incorrectly
followed when the QTYPE was CNAME or ANY. [GL #2280]
--- 9.17.7 released ---
5533. [func] Add the "stale-refresh-time" option, a time window that
starts after a failed lookup, during which a stale RRset
is served directly from cache before a new attempt to
refresh it is made. [GL #2066]
5532. [cleanup] Unused header files were removed:
bin/rndc/include/rndc/os.h, lib/isc/timer_p.h,
lib/isccfg/include/isccfg/dnsconf.h and code related
to those files. [GL #1913]
5531. [func] Add a netmgr TLS layer, enabling server-side DoT
support (not yet available), and client-side DoT
support in dig with "dig +tls". [GL #1840]
5531. [func] Add support for DNS over TLS (DoT) to dig and named.
dig output now includes the transport protocol used.
[GL #1816] [GL #1840]
5530. [bug] DNSTAP did not capture responses to forwarded
UPDATE requests. [GL #2252]
5530. [bug] dnstap did not capture responses to forwarded UPDATE
requests. [GL #2252]
5529. [func] The network manager API is now used by named
to send zone transfer requests. [GL #2016]
5529. [func] The network manager API is now used by named to send
zone transfer requests. [GL #2016]
5528. [func] Convert "dig", "host" and "nslookup" to use the
network manager. As a side effect of this change,
"dig +unexpected" no longer works, and has been
disabled. [GL #2140]
5528. [func] Convert dig, host, and nslookup to use the network
manager API. As a side effect of this change, "dig
+unexpected" no longer works, and has been disabled.
[GL #2140]
5527. [bug] There was a NULL pointer dereference if the creation
of the fetch to determine if a negative trust anchor
was still valid failed. [GL #2244]
5527. [bug] A NULL pointer dereference occurred when creating an NTA
recheck query failed. [GL #2244]
5526. [bug] Fix a race/NULL dereference in TCPDNS read. [GL #2227]
5525. [placeholder]
5524. [func] Added functionality to the network manager to
support outgoing DNS queries in addition to
incoming ones. [GL #2235]
5524. [func] Added functionality to the network manager to support
outgoing DNS queries in addition to incoming ones.
[GL #2235]
5523. [bug] The initial lookup of a zone transitioning to/from
the signed state could fail if the DNSKEY RRset was
not found. Subsequent lookups would succeed.
[GL #2236]
5523. [bug] The initial lookup in a zone transitioning to/from a
signed state could fail if the DNSKEY RRset was not
found. [GL #2236]
5522. [bug] Fix a race/NULL dereference in TCPDNS send. [GL #2227]
5522. [bug] Fixed a race/NULL dereference in TCPDNS send. [GL #2227]
5521. [func] All use of libltdl was dropped. libuv's shared library
5521. [func] All use of libltdl was dropped. libuv's shared library
handling interface is now used instead. [GL !4278]
5520. [bug] Fixed a number of shutdown races, reference counting
@@ -53,12 +211,11 @@
lib/dns/portlist.c, lib/isc/bufferlist.c, and code
related to those files. [GL #2060]
5518. [bug] Fix stub zone not transferring nameserver addresses
from masters configured with 'minimal-responses yes'.
[GL #1736]
5518. [bug] Stub zones now work correctly with primary servers using
"minimal-responses yes". [GL #1736]
5517. [bug] Handle 'UV_EOF' differently and don't contribute it to
the RECVFAIL statistic count. [GL #2208]
5517. [bug] Do not treat UV_EOF as a TCP4RecvErr or a TCP6RecvErr.
[GL #2208]
--- 9.17.6 released ---
+7 -9
View File
@@ -39,7 +39,7 @@ anyone can see the source, but only ISC employees have commit access.
In the past, the source could only be seen once ISC had published
a release; read access to the source repository was restricted just
as commit access was. That has changed, as ISC now provides a
public git mirror to the BIND source tree (see below).
public git repository of the BIND source tree (see below).
At ISC, we're committed to
building communities that are welcoming and inclusive: environments where people
@@ -55,14 +55,12 @@ the industry.
Public BIND releases are always available from the
[ISC FTP site](ftp://ftp.isc.org/isc/bind9).
A public-access GIT repository is also available at
[https://gitlab.isc.org](https://gitlab.isc.org).
This repository is a mirror, updated several times per day, of the
source repository maintained by ISC. It contains all the public release
branches; upcoming releases can be viewed in their current state at any
time. It does *not* contain development branches or unreviewed work in
progress. Commits which address security vulnerablilities are withheld
until after public disclosure.
A public-access git repository is also available at
[https://gitlab.isc.org](https://gitlab.isc.org). This repository
contains all public release branches. Upcoming releases can be viewed in
their current state at any time. Short-lived development branches
contain unreviewed work in progress. Commits which address security
vulnerablilities are withheld until after public disclosure.
You can browse the source online via
[https://gitlab.isc.org/isc-projects/bind9](https://gitlab.isc.org/isc-projects/bind9)
+23 -1
View File
@@ -1,4 +1,4 @@
Copyright (C) 1996-2020 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 1996-2021 Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -367,3 +367,25 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-----------------------------------------------------------------------------
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
+13 -14
View File
@@ -8,20 +8,19 @@
- See the COPYRIGHT file distributed with this work for additional
- information regarding copyright ownership.
-->
Setting the `STD_CDEFINES` environment variable before running `configure`
can be used to enable certain compile-time options that are not explicitly
defined in `configure`.
Setting the `CPPFLAGS` environment variable before running `configure`
can be used to enable certain compile-time options that are not
explicitly defined in `configure`.
Some of these settings are:
|Setting |Description |
|-----------------------------------|----------------------------------------|
|`-DISC_MEM_DEFAULTFILL=1`|Overwrite memory with tag values when allocating or freeing it; this impairs performance but makes debugging of memory problems easier.|
|`-DISC_MEM_TRACKLINES=0`|Don't track memory allocations by file and line number; this improves performance but makes debugging more difficult.|
|<nobr>`-DISC_FACILITY=LOG_LOCAL0`</nobr>|Change the default syslog facility for `named`|
|`-DNS_CLIENT_DROPPORT=0`|Disable dropping queries from particular well-known ports:|
|`-DCHECK_SIBLING=0`|Don't check sibling glue in `named-checkzone`|
|`-DCHECK_LOCAL=0`|Don't check out-of-zone addresses in `named-checkzone`|
|`-DNS_RUN_PID_DIR=0`|Create default PID files in `${localstatedir}/run` rather than `${localstatedir}/run/named/`|
|`-DISC_BUFFER_USEINLINE=0`|Disable the use of inline functions to implement the `isc_buffer` API: this reduces performance but may be useful when debugging |
|`-DISC_HEAP_CHECK`|Test heap consistency after every heap operation; used when debugging|
| Setting | Description |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `-DCHECK_LOCAL=0` | Don't check out-of-zone addresses in `named-checkzone` |
| `-DCHECK_SIBLING=0` | Don't check sibling glue in `named-checkzone` |
| `-DISC_FACILITY=LOG_LOCAL0` | Change the default syslog facility for `named` |
| `-DISC_HEAP_CHECK` | Test heap consistency after every heap operation; used when debugging |
| `-DISC_MEM_DEFAULTFILL=1` | Overwrite memory with tag values when allocating or freeing it; this impairs performance but makes debugging of memory problems easier |
| `-DISC_MEM_TRACKLINES=0` | Don't track memory allocations by file and line number; this improves performance but makes debugging more difficult |
| `-DNAMED_RUN_PID_DIR=0` | Create default PID files in `${localstatedir}/run` rather than `${localstatedir}/run/named/` |
| `-DNS_CLIENT_DROPPORT=0` | Disable dropping queries from particular well-known ports |
+1 -1
View File
@@ -61,7 +61,7 @@ The following are platforms on which BIND is known to build and run.
ISC makes every effort to fix bugs on these platforms, but may be unable to
do so quickly due to lack of hardware, less familiarity on the part of
engineering staff, and other constraints. With the exception of Windows
Server 2012 R2, none of these are tested regularly by ISC.
Server 2016, none of these are tested regularly by ISC.
* Windows Server 2012 R2, 2016 / x64
* Windows 10 / x64
+1 -13
View File
@@ -15,7 +15,6 @@
1. [Introduction](#intro)
1. [Reporting bugs and getting help](#help)
1. [Contributing to BIND](#contrib)
1. [BIND 9.17 features](#features)
1. [Building BIND](#build)
1. [macOS](#macos)
1. [Dependencies](#dependencies)
@@ -125,16 +124,6 @@ If you prefer, you may also submit code by opening a
including your patch as an attachment, preferably generated by
`git format-patch`.
### <a name="features"/> BIND 9.17 features
BIND 9.17 is the newest development branch of BIND 9. It includes a
number of changes from BIND 9.16 and earlier releases. New features include:
* The new option `max-ixfr-ratio` to limit the size of outgoing IXFR responses
before falling back to full zone transfers.
* `rndc nta -d` and `rndc secroots` now include `validate-except` entries
when listing negative trust anchors.
### <a name="build"/> Building BIND 9
At a minimum, BIND requires a Unix or Linux system with an ANSI C compiler,
@@ -162,8 +151,7 @@ To build on a Unix or Linux system, use:
$ ./configure
$ make
If you're planning on making changes to the BIND 9 source, you should run
`make depend`. If you're using Emacs, you might find `make tags` helpful.
If you're using Emacs, you might find `make tags` helpful.
Several environment variables, which can be set before running `configure`,
affect compilation. Significant ones are:
+7 -5
View File
@@ -610,11 +610,13 @@ key_fromconfig(const cfg_obj_t *key, dns_client_t *client) {
dns_name_t *keyname;
isc_result_t result;
bool match_root = false;
enum { INITIAL_KEY,
STATIC_KEY,
INITIAL_DS,
STATIC_DS,
TRUSTED } anchortype;
enum {
INITIAL_KEY,
STATIC_KEY,
INITIAL_DS,
STATIC_DS,
TRUSTED
} anchortype;
const cfg_obj_t *obj;
keynamestr = cfg_obj_asstring(cfg_tuple_get(key, "name"));
+167 -25
View File
@@ -30,6 +30,7 @@
#include <pk11/site.h>
#include <dns/byaddr.h>
#include <dns/dns64.h>
#include <dns/fixedname.h>
#include <dns/masterdump.h>
#include <dns/message.h>
@@ -206,6 +207,8 @@ help(void) {
" fields in records)\n"
" +[no]defname (Use search list "
"(+[no]search))\n"
" +[no]dns64prefix (Get the DNS64 prefixes "
"from ipv4only.arpa)\n"
" +[no]dnssec (Request DNSSEC records)\n"
" +domain=### (Set default domainname)\n"
" +[no]dscp[=###] (Set the DSCP value to "
@@ -225,6 +228,10 @@ help(void) {
"SERVFAIL)\n"
" +[no]header-only (Send query without a "
"question section)\n"
" +[no]https[=###] (DNS over HTTPS mode) "
"[/]\n"
" +[no]https-get (Use GET instead of "
"default POST method\n"
" +[no]identify (ID responders in short "
"answers)\n"
#ifdef HAVE_LIBIDN2
@@ -345,6 +352,8 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
}
if (query->lookup->tls_mode) {
proto = "TLS";
} else if (query->lookup->https_mode) {
proto = "HTTPS";
} else if (query->lookup->tcp_mode) {
proto = "TCP";
} else {
@@ -473,6 +482,50 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
return (ISC_R_SUCCESS);
}
/*%
* short_form message print handler. Calls above say_message()
*/
static isc_result_t
dns64prefix_answer(dns_message_t *msg, isc_buffer_t *buf) {
dns_rdataset_t *rdataset = NULL;
dns_fixedname_t fixed;
dns_name_t *name;
isc_result_t result;
isc_netprefix_t prefix[10];
size_t i, count = 10;
name = dns_fixedname_initname(&fixed);
result = dns_name_fromstring(name, "ipv4only.arpa", 0, NULL);
check_result(result, "dns_name_fromstring");
result = dns_message_findname(msg, DNS_SECTION_ANSWER, name,
dns_rdatatype_aaaa, dns_rdatatype_none,
NULL, &rdataset);
if (result == DNS_R_NXDOMAIN || result == DNS_R_NXRRSET) {
return (ISC_R_SUCCESS);
} else if (result != ISC_R_SUCCESS) {
return (result);
}
result = dns_dns64_findprefix(rdataset, prefix, &count);
if (result == ISC_R_NOTFOUND)
return (ISC_R_SUCCESS);
if (count > 10)
count = 10;
for (i = 0; i < count; i++) {
result = isc_netaddr_totext(&prefix[i].addr, buf);
if (result != ISC_R_SUCCESS) {
return (result);
}
result = isc_buffer_printf(buf, "/%u\n", prefix[i].prefixlen);
if (result != ISC_R_SUCCESS) {
return (result);
}
}
return (ISC_R_SUCCESS);
}
/*%
* short_form message print handler. Calls above say_message()
*/
@@ -559,6 +612,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
dns_master_style_t *style = NULL;
unsigned int styleflags = 0;
bool isquery = (msg == query->lookup->sendmsg);
bool dns64prefix = query->lookup->dns64prefix;
UNUSED(msgbuf);
@@ -623,14 +677,16 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
check_result(result, "dns_master_stylecreate");
if (query->lookup->cmdline[0] != 0) {
if (!short_form && printcmd) {
if (!short_form && !dns64prefix && printcmd) {
printf("%s", query->lookup->cmdline);
}
query->lookup->cmdline[0] = '\0';
}
debug("printmessage(%s %s %s)", headers ? "headers" : "noheaders",
query->lookup->comments ? "comments" : "nocomments",
short_form ? "short_form" : "long_form");
short_form ? "short_form"
: dns64prefix ? "dns64prefix_form"
: "long_form");
flags = 0;
if (!headers) {
@@ -751,7 +807,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
printf(" %s:\n", isquery ? "query_message_data"
: "response_message_data");
result = dns_message_headertotext(msg, style, flags, buf);
} else if (query->lookup->comments && !short_form) {
} else if (query->lookup->comments && !short_form && !dns64prefix) {
if (query->lookup->cmdline[0] != '\0' && printcmd) {
printf("; %s\n", query->lookup->cmdline);
}
@@ -832,7 +888,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
repopulate_buffer:
if (query->lookup->comments && headers && !short_form) {
if (query->lookup->comments && headers && !short_form && !dns64prefix) {
result = dns_message_pseudosectiontotext(
msg, DNS_PSEUDOSECTION_OPT, style, flags, buf);
if (result == ISC_R_NOSPACE) {
@@ -846,7 +902,7 @@ repopulate_buffer:
}
if (query->lookup->section_question && headers) {
if (!short_form) {
if (!short_form && !dns64prefix) {
result = dns_message_sectiontotext(
msg, DNS_SECTION_QUESTION, style, flags, buf);
if (result == ISC_R_NOSPACE) {
@@ -856,13 +912,18 @@ repopulate_buffer:
}
}
if (query->lookup->section_answer) {
if (!short_form) {
if (!short_form && !dns64prefix) {
result = dns_message_sectiontotext(
msg, DNS_SECTION_ANSWER, style, flags, buf);
if (result == ISC_R_NOSPACE) {
goto buftoosmall;
}
check_result(result, "dns_message_sectiontotext");
} else if (dns64prefix) {
result = dns64prefix_answer(msg, buf);
if (result == ISC_R_NOSPACE)
goto buftoosmall;
check_result(result, "dns64prefix_answer");
} else {
result = short_answer(msg, flags, buf, query);
if (result == ISC_R_NOSPACE) {
@@ -872,7 +933,7 @@ repopulate_buffer:
}
}
if (query->lookup->section_authority) {
if (!short_form) {
if (!short_form && !dns64prefix) {
result = dns_message_sectiontotext(
msg, DNS_SECTION_AUTHORITY, style, flags, buf);
if (result == ISC_R_NOSPACE) {
@@ -882,7 +943,7 @@ repopulate_buffer:
}
}
if (query->lookup->section_additional) {
if (!short_form) {
if (!short_form && !dns64prefix) {
result = dns_message_sectiontotext(
msg, DNS_SECTION_ADDITIONAL, style, flags, buf);
if (result == ISC_R_NOSPACE) {
@@ -976,8 +1037,9 @@ printgreeting(int argc, char **argv, dig_lookup_t *lookup) {
* XXX doc options
*/
static void
plus_option(char *option, bool is_batchfile, dig_lookup_t *lookup) {
static dig_lookup_t *
plus_option(char *option, bool is_batchfile, bool *need_clone,
dig_lookup_t *lookup) {
isc_result_t result;
char *cmd, *value, *last = NULL, *code, *extra;
uint32_t num;
@@ -988,7 +1050,7 @@ plus_option(char *option, bool is_batchfile, dig_lookup_t *lookup) {
if ((cmd = strtok_r(option, "=", &last)) == NULL) {
printf(";; Invalid option %s\n", option);
return;
return (lookup);
}
if (strncasecmp(cmd, "no", 2) == 0) {
cmd += 2;
@@ -1155,13 +1217,57 @@ plus_option(char *option, bool is_batchfile, dig_lookup_t *lookup) {
usesearch = state;
}
break;
case 'n': /* dnssec */
FULLCHECK("dnssec");
dnssec:
if (state && lookup->edns == -1) {
lookup->edns = DEFAULT_EDNS_VERSION;
case 'n':
switch (cmd[2]) {
case 's':
switch (cmd[3]) {
case '6': /* dns64prefix */
FULLCHECK("dns64prefix");
if (state) {
if (*need_clone) {
lookup = clone_lookup(
default_lookup,
true);
}
*need_clone = true;
lookup->dns64prefix = state;
strlcpy(lookup->textname,
"ipv4only.arpa",
sizeof(lookup->textname));
printcmd = false;
lookup->section_additional =
false;
lookup->section_answer = true;
lookup->section_authority =
false;
lookup->section_question =
false;
lookup->comments = false;
lookup->stats = false;
lookup->rrcomments = -1;
lookup->rdtype =
dns_rdatatype_aaaa;
lookup->rdtypeset = true;
ISC_LIST_APPEND(lookup_list,
lookup, link);
}
break;
case 's': /* dnssec */
FULLCHECK("dnssec");
dnssec:
if (state && lookup->edns == -1) {
lookup->edns =
DEFAULT_EDNS_VERSION;
}
lookup->dnssec = state;
break;
default:
goto invalid_option;
}
break;
default:
goto invalid_option;
}
lookup->dnssec = state;
break;
case 'o': /* domain ... but treat "do" as synonym for dnssec */
if (cmd[2] == '\0') {
@@ -1312,8 +1418,39 @@ plus_option(char *option, bool is_batchfile, dig_lookup_t *lookup) {
lookup->servfail_stops = state;
break;
case 'h':
FULLCHECK("header-only");
lookup->header_only = state;
switch (cmd[1]) {
case 'e': /* header-only */
FULLCHECK("header-only");
lookup->header_only = state;
break;
case 't':
FULLCHECK2("https", "https-get");
switch (cmd[5]) {
case '\0':
FULLCHECK("https");
lookup->https_mode = state;
if (!lookup->tcp_mode_set) {
lookup->tcp_mode = state;
}
if (value == NULL) {
lookup->https_path = isc_mem_strdup(
mctx, DEFAULT_HTTPS_PATH);
break;
}
lookup->https_path = isc_mem_strdup(mctx,
value);
break;
case '-':
FULLCHECK("https-get");
lookup->https_get = true;
break;
default:
goto invalid_option;
}
break;
default:
goto invalid_option;
}
break;
case 'i':
switch (cmd[1]) {
@@ -1871,7 +2008,7 @@ plus_option(char *option, bool is_batchfile, dig_lookup_t *lookup) {
fprintf(stderr, "Invalid option: +%s\n", option);
usage();
}
return;
return (lookup);
#if !TARGET_OS_IPHONE
exit_or_usage:
@@ -2241,16 +2378,20 @@ preparse_args(int argc, char **argv) {
continue;
}
/* Look for dash value option. */
if (strpbrk(option, dash_opts) != &option[0] ||
strlen(option) > 1U) {
/* Error or value in option. */
if (strpbrk(option, dash_opts) != &option[0]) {
goto invalid_option;
}
if (strlen(option) > 1U) {
/* value in option. */
continue;
}
/* Dash value is next argument so we need to skip it. */
rc--, rv++;
/* Handle missing argument */
if (rc == 0) {
break;
invalid_option:
fprintf(stderr, "Invalid option: -%s\n", option);
usage();
}
}
}
@@ -2382,7 +2523,8 @@ parse_args(bool is_batchfile, bool config_only, int argc, char **argv) {
}
}
} else if (rv[0][0] == '+') {
plus_option(&rv[0][1], is_batchfile, lookup);
lookup = plus_option(&rv[0][1], is_batchfile,
&need_clone, lookup);
} else if (rv[0][0] == '-') {
if (rc <= 1) {
if (dash_option(&rv[0][1], NULL, &lookup,
+3
View File
@@ -297,6 +297,9 @@ abbreviation is unambiguous; for example, ``+cd`` is equivalent to
``+[no]defname``
This option, which is deprecated, is treated as a synonym for ``+[no]search``.
``+[no]dns64prefix``
Lookup IPV4ONLY.ARPA AAAA and print any DNS64 prefixes found.
``+[no]dnssec``
This option requests that DNSSEC records be sent by setting the DNSSEC OK (DO) bit in
the OPT record in the additional section of the query.
+96 -112
View File
@@ -608,100 +608,38 @@ make_empty_lookup(void) {
INSIST(!free_now);
looknew = isc_mem_allocate(mctx, sizeof(struct dig_lookup));
looknew->pending = true;
looknew->textname[0] = 0;
looknew->cmdline[0] = 0;
looknew->rdtype = dns_rdatatype_a;
looknew->qrdtype = dns_rdatatype_a;
looknew->rdclass = dns_rdataclass_in;
looknew->rdtypeset = false;
looknew->rdclassset = false;
looknew->sendspace = NULL;
looknew->sendmsg = NULL;
looknew->name = NULL;
looknew->oname = NULL;
looknew->xfr_q = NULL;
looknew->current_query = NULL;
looknew->doing_xfr = false;
looknew->ixfr_serial = 0;
looknew->trace = false;
looknew->trace_root = false;
looknew->identify = false;
looknew->identify_previous_line = false;
looknew->ignore = false;
looknew->servfail_stops = true;
looknew->besteffort = true;
looknew->dnssec = false;
looknew->ednsflags = 0;
looknew->opcode = dns_opcode_query;
looknew->expire = false;
looknew->nsid = false;
looknew->tcp_keepalive = false;
looknew->padding = 0;
looknew->header_only = false;
looknew->sendcookie = false;
looknew->seenbadcookie = false;
looknew->badcookie = true;
looknew->multiline = false;
looknew->nottl = false;
looknew->noclass = false;
looknew->onesoa = false;
looknew->use_usec = false;
looknew->nocrypto = false;
looknew->ttlunits = false;
looknew->expandaaaa = false;
looknew->qr = false;
looknew = isc_mem_allocate(mctx, sizeof(*looknew));
*looknew = (dig_lookup_t){
.pending = true,
.rdtype = dns_rdatatype_a,
.qrdtype = dns_rdatatype_a,
.rdclass = dns_rdataclass_in,
.servfail_stops = true,
.besteffort = true,
.opcode = dns_opcode_query,
.badcookie = true,
#ifdef HAVE_LIBIDN2
looknew->idnin = isatty(1) ? (getenv("IDN_DISABLE") == NULL) : false;
looknew->idnout = looknew->idnin;
#else /* ifdef HAVE_LIBIDN2 */
looknew->idnin = false;
looknew->idnout = false;
.idnin = isatty(1) ? (getenv("IDN_DISABLE") == NULL) : false,
.idnout = looknew->idnin,
#endif /* HAVE_LIBIDN2 */
looknew->udpsize = -1;
looknew->edns = -1;
looknew->recurse = true;
looknew->aaonly = false;
looknew->adflag = false;
looknew->cdflag = false;
looknew->raflag = false;
looknew->tcflag = false;
looknew->print_unknown_format = false;
looknew->zflag = false;
looknew->setqid = false;
looknew->qid = 0;
looknew->ns_search_only = false;
looknew->origin = NULL;
looknew->tsigctx = NULL;
looknew->querysig = NULL;
looknew->retries = tries;
looknew->nsfound = 0;
looknew->tcp_mode = false;
looknew->tcp_mode_set = false;
looknew->tls_mode = false;
looknew->comments = true;
looknew->stats = true;
looknew->section_question = true;
looknew->section_answer = true;
looknew->section_authority = true;
looknew->section_additional = true;
looknew->new_search = false;
looknew->done_as_is = false;
looknew->need_search = false;
looknew->ecs_addr = NULL;
looknew->cookie = NULL;
looknew->ednsopts = NULL;
looknew->ednsoptscnt = 0;
looknew->ednsneg = true;
looknew->mapped = true;
looknew->dscp = -1;
looknew->rrcomments = 0;
looknew->eoferr = 0;
.udpsize = -1,
.edns = -1,
.recurse = true,
.retries = tries,
.comments = true,
.stats = true,
.section_question = true,
.section_answer = true,
.section_authority = true,
.section_additional = true,
.ednsneg = true,
.mapped = true,
.dscp = -1,
};
dns_fixedname_init(&looknew->fdomain);
ISC_LINK_INIT(looknew, link);
ISC_LIST_INIT(looknew->q);
ISC_LIST_INIT(looknew->connecting);
ISC_LIST_INIT(looknew->my_server_list);
isc_refcount_init(&looknew->references, 1);
@@ -779,6 +717,7 @@ clone_lookup(dig_lookup_t *lookold, bool servers) {
looknew->ignore = lookold->ignore;
looknew->servfail_stops = lookold->servfail_stops;
looknew->besteffort = lookold->besteffort;
looknew->dns64prefix = lookold->dns64prefix;
looknew->dnssec = lookold->dnssec;
looknew->ednsflags = lookold->ednsflags;
looknew->opcode = lookold->opcode;
@@ -786,6 +725,11 @@ clone_lookup(dig_lookup_t *lookold, bool servers) {
looknew->nsid = lookold->nsid;
looknew->tcp_keepalive = lookold->tcp_keepalive;
looknew->header_only = lookold->header_only;
looknew->https_mode = lookold->https_mode;
if (lookold->https_path != NULL) {
looknew->https_path = isc_mem_strdup(mctx, lookold->https_path);
}
looknew->https_get = lookold->https_get;
looknew->sendcookie = lookold->sendcookie;
looknew->seenbadcookie = lookold->seenbadcookie;
looknew->badcookie = lookold->badcookie;
@@ -1598,7 +1542,6 @@ _destroy_lookup(dig_lookup_t *lookup) {
isc_refcount_destroy(&lookup->references);
REQUIRE(ISC_LIST_EMPTY(lookup->q));
REQUIRE(ISC_LIST_EMPTY(lookup->connecting));
s = ISC_LIST_HEAD(lookup->my_server_list);
while (s != NULL) {
@@ -1638,6 +1581,10 @@ _destroy_lookup(dig_lookup_t *lookup) {
isc_mem_free(mctx, lookup->ednsopts);
}
if (lookup->https_path) {
isc_mem_free(mctx, lookup->https_path);
}
isc_mem_free(mctx, lookup);
}
@@ -1743,9 +1690,6 @@ _query_detach(dig_query_t **queryp, const char *file, unsigned int line) {
if (ISC_LINK_LINKED(query, link)) {
ISC_LIST_UNLINK(lookup->q, query, link);
}
if (ISC_LINK_LINKED(query, clink)) {
ISC_LIST_UNLINK(lookup->connecting, query, clink);
}
debug("%s:%u:query_detach(%p) = %" PRIuFAST32, file, line, query,
isc_refcount_current(&query->references) - 1);
@@ -1808,7 +1752,6 @@ clear_current_lookup() {
dig_lookup_t *lookup = current_lookup;
INSIST(!free_now);
INSIST(lookup != NULL);
debug("clear_current_lookup()");
@@ -2764,7 +2707,17 @@ start_tcp(dig_query_t *query) {
* For TLS connections, we want to override the default
* port number.
*/
port = port_set ? port : (query->lookup->tls_mode ? 853 : 53);
if (!port_set) {
if (query->lookup->tls_mode) {
port = 853;
} else if (query->lookup->https_mode) {
port = 443;
} else {
port = 53;
}
}
fprintf(stderr, "query->servname = %s\n", query->servname);
result = get_address(query->servname, port, &query->sockaddr);
if (result != ISC_R_SUCCESS) {
@@ -2832,11 +2785,34 @@ start_tcp(dig_query_t *query) {
REQUIRE(query != NULL);
if (query->lookup->tls_mode) {
result = isc_tlsctx_createclient(&query->tlsctx);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
result = isc_nm_tlsdnsconnect(
netmgr, (isc_nmiface_t *)&localaddr,
(isc_nmiface_t *)&query->sockaddr,
tcp_connected, query, local_timeout, 0);
check_result(result, "isc_nm_tcpdnsconnect");
tcp_connected, query, local_timeout, 0,
query->tlsctx);
check_result(result, "isc_nm_tlsdnsconnect");
} else if (query->lookup->https_mode) {
char portbuf[12];
char uri[4096] = { 0 };
snprintf(portbuf, sizeof(portbuf), "%u",
(uint16_t)port);
strlcpy(uri, "https://", sizeof(uri));
strlcat(uri, query->servname, sizeof(uri));
strlcat(uri, ":", sizeof(uri));
strlcat(uri, portbuf, sizeof(uri));
strlcat(uri, query->lookup->https_path, sizeof(uri));
result = isc_tlsctx_createclient(&query->tlsctx);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
result = isc_nm_httpconnect(
netmgr, (isc_nmiface_t *)&localaddr,
(isc_nmiface_t *)&query->sockaddr, uri,
!query->lookup->https_get, tcp_connected, query,
query->tlsctx, local_timeout, 0);
check_result(result, "isc_nm_httpconnect");
} else {
result = isc_nm_tcpdnsconnect(
netmgr, (isc_nmiface_t *)&localaddr,
@@ -2860,7 +2836,6 @@ start_tcp(dig_query_t *query) {
} else {
next = NULL;
}
ISC_LIST_ENQUEUE(query->lookup->connecting, query, clink);
if (next != NULL) {
start_tcp(next);
}
@@ -3185,7 +3160,12 @@ launch_next_query(dig_query_t *query) {
isc_nmhandle_settimeout(query->handle, local_timeout);
query_attach(query, &readquery);
isc_nm_read(query->handle, recv_done, readquery);
if (query->lookup->https_mode) {
isc_nm_httprequest(query->handle, &r, recv_done, readquery);
goto cleanup;
} else {
isc_nm_read(query->handle, recv_done, readquery);
}
if (!query->first_soa_rcvd) {
dig_query_t *sendquery = NULL;
@@ -3213,6 +3193,7 @@ launch_next_query(dig_query_t *query) {
}
}
}
cleanup:
lookup_detach(&l);
return;
}
@@ -3229,15 +3210,26 @@ tcp_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
char sockstr[ISC_SOCKADDR_FORMATSIZE];
dig_lookup_t *l = NULL;
debug("tcp_connected()");
if (atomic_load(&cancel_now)) {
return;
}
REQUIRE(DIG_VALID_QUERY(query));
REQUIRE(query->handle == NULL);
INSIST(!free_now);
debug("tcp_connected()");
debug("tcp_connected(%p, %s, %p)", handle, isc_result_totext(eresult),
query);
LOCK_LOOKUP;
lookup_attach(query->lookup, &l);
if (query->tlsctx != NULL) {
isc_tlsctx_free(&query->tlsctx);
}
if (eresult == ISC_R_CANCELED) {
debug("in cancel handler");
isc_sockaddr_format(&query->sockaddr, sockstr, sizeof(sockstr));
@@ -3304,7 +3296,6 @@ tcp_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
launch_next_query(query);
query_detach(&query);
isc_nmhandle_detach(&handle);
lookup_detach(&l);
UNLOCK_LOOKUP;
}
@@ -3584,14 +3575,14 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
LOCK_LOOKUP;
lookup_attach(query->lookup, &l);
isc_refcount_decrement0(&recvcount);
debug("recvcount=%" PRIuFAST32, isc_refcount_current(&recvcount));
if (eresult == ISC_R_CANCELED) {
debug("recv_done: cancel");
goto detach_query;
}
isc_refcount_decrement0(&recvcount);
debug("recvcount=%" PRIuFAST32, isc_refcount_current(&recvcount));
TIME_NOW(&query->time_recv);
if (eresult == ISC_R_TIMEDOUT && !l->tcp_mode && l->retries > 1) {
@@ -3729,7 +3720,7 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
}
debug("before parse starts");
parseflags = DNS_MESSAGEPARSE_PRESERVEORDER;
parseflags = l->dns64prefix ? 0 : DNS_MESSAGEPARSE_PRESERVEORDER;
if (l->besteffort) {
parseflags |= DNS_MESSAGEPARSE_BESTEFFORT;
parseflags |= DNS_MESSAGEPARSE_IGNORETRUNCATION;
@@ -4210,13 +4201,6 @@ cancel_all(void) {
}
query_detach(&q);
}
for (q = ISC_LIST_HEAD(current_lookup->connecting); q != NULL;
q = nq) {
nq = ISC_LIST_NEXT(q, clink);
debug("canceling connecting query %p, belonging to %p",
q, current_lookup);
query_detach(&q);
}
lookup_detach(&current_lookup);
}
l = ISC_LIST_HEAD(lookup_list);
+30 -22
View File
@@ -24,6 +24,7 @@
#include <isc/list.h>
#include <isc/magic.h>
#include <isc/mem.h>
#include <isc/netmgr.h>
#include <isc/print.h>
#include <isc/refcount.h>
#include <isc/sockaddr.h>
@@ -75,6 +76,9 @@
#define DEFAULT_EDNS_VERSION 0
#define DEFAULT_EDNS_BUFSIZE 1232
#define DEFAULT_HTTPS_PATH "/dns-query"
#define DEFAULT_HTTPS_QUERY "?dns="
/*%
* Lookup_limit is just a limiter, keeping too many lookups from being
* created. It's job is mainly to prevent the program from running away
@@ -101,29 +105,27 @@ typedef struct dig_searchlist dig_searchlist_t;
struct dig_lookup {
unsigned int magic;
isc_refcount_t references;
bool pending, /*%< Pending a successful answer */
waiting_connect, doing_xfr, ns_search_only, /*%< dig
* +nssearch,
* host -C */
identify, /*%< Append an "on server <foo>" message */
identify_previous_line, /*% Prepend a "Nameserver <foo>:"
* message, with newline and tab */
ignore, recurse, aaonly, adflag, cdflag, raflag, tcflag, zflag,
bool aaonly, adflag, badcookie, besteffort, cdflag, comments,
dns64prefix, dnssec, doing_xfr, done_as_is, ednsneg, expandaaaa,
expire, header_only, identify, /*%< Append an "on server <foo>"
message */
identify_previous_line, /*% Prepend a "Nameserver <foo>:"
message, with newline and tab */
idnin, idnout, ignore, mapped, multiline, need_search,
new_search, noclass, nocrypto, nottl,
ns_search_only, /*%< dig +nssearch, host -C */
nsid, /*% Name Server ID (RFC 5001) */
onesoa, pending, /*%< Pending a successful answer */
print_unknown_format, qr, raflag, recurse, section_additional,
section_answer, section_authority, section_question,
seenbadcookie, sendcookie, servfail_stops,
setqid, /*% use a speciied query ID */
stats, tcflag, tcp_keepalive, tcp_mode, tcp_mode_set,
tls_mode, /*% connect using TLS */
trace, /*% dig +trace */
trace_root, /*% initial query for either +trace or +nssearch
* */
tcp_mode, tcp_mode_set, comments, stats, section_question,
section_answer, section_authority, section_additional,
servfail_stops, new_search, need_search, done_as_is, besteffort,
dnssec, expire, sendcookie, seenbadcookie, badcookie,
nsid, /*% Name Server ID (RFC 5001) */
tcp_keepalive, header_only, ednsneg, mapped,
print_unknown_format, multiline, nottl, noclass, onesoa,
use_usec, nocrypto, ttlunits, idnin, idnout, expandaaaa, qr,
setqid, /*% use a specified query ID */
tls_mode; /*% connect using TLS */
char textname[MXNAME]; /*% Name we're going to be
* looking up */
trace_root, /*% initial query for either +trace or +nssearch */
ttlunits, use_usec, waiting_connect, zflag;
char textname[MXNAME]; /*% Name we're going to be looking up */
char cmdline[MXNAME];
dns_rdatatype_t rdtype;
dns_rdatatype_t qrdtype;
@@ -169,6 +171,11 @@ struct dig_lookup {
int rrcomments;
unsigned int eoferr;
uint16_t qid;
struct {
bool https_mode;
bool https_get;
char *https_path;
};
};
/*% The dig_query structure */
@@ -201,6 +208,7 @@ struct dig_query {
uint64_t byte_count;
isc_timer_t *timer;
uint8_t tries;
isc_tlsctx_t *tlsctx;
};
struct dig_server {
-4
View File
@@ -362,7 +362,6 @@ main(int argc, char **argv) {
setup_logging(mctx, &log);
if (predecessor == NULL) {
/* cppcheck-suppress nullPointerRedundantCheck */
if (label == NULL) {
fatal("the key label was not specified");
}
@@ -384,7 +383,6 @@ main(int argc, char **argv) {
isc_result_totext(ret));
}
/* cppcheck-suppress nullPointerRedundantCheck */
if (strchr(label, ':') == NULL) {
char *l;
int len;
@@ -396,13 +394,11 @@ main(int argc, char **argv) {
label = l;
}
/* cppcheck-suppress nullPointerRedundantCheck */
if (algname == NULL) {
fatal("no algorithm specified");
}
r.base = algname;
/* cppcheck-suppress nullPointerRedundantCheck */
r.length = strlen(algname);
ret = dns_secalg_fromtext(&alg, &r);
if (ret != ISC_R_SUCCESS) {
+3 -3
View File
@@ -76,9 +76,9 @@ Options
``-E engine``
This option specifies the cryptographic hardware to use.
When BIND 9 is built with OpenSSL PKCS#11 support, this defaults to the
string ``pkcs11``, which identifies an OpenSSL engine that can drive a
cryptographic accelerator or hardware service module. When BIND is
When BIND 9 is built with OpenSSL, this needs to be set to the OpenSSL
engine identifier that drives the cryptographic accelerator or
hardware service module (usually ``pkcs11``). When BIND is
built with native PKCS#11 cryptography (``--enable-native-pkcs11``), it
defaults to the path of the PKCS#11 provider library specified via
``--with-pkcs11``.
+4 -6
View File
@@ -269,8 +269,8 @@ kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, const char *name,
continue;
}
result = cfg_kasp_fromconfig(kconfig, mctx, lctx, &kasplist,
&kasp);
result = cfg_kasp_fromconfig(kconfig, NULL, mctx, lctx,
&kasplist, &kasp);
if (result != ISC_R_SUCCESS) {
fatal("failed to configure dnssec-policy '%s': %s",
cfg_obj_asstring(cfg_tuple_get(kconfig, "name")),
@@ -284,7 +284,7 @@ kasp_from_conf(cfg_obj_t *config, isc_mem_t *mctx, const char *name,
*kaspp = kasp;
/*
* Same cleanup for kasp list.
* Cleanup kasp list.
*/
for (kasp = ISC_LIST_HEAD(kasplist); kasp != NULL; kasp = kasp_next) {
kasp_next = ISC_LIST_NEXT(kasp, link);
@@ -782,7 +782,7 @@ keygen(keygen_ctx_t *ctx, isc_mem_t *mctx, int argc, char **argv) {
}
/* Set dnssec-policy related metadata */
if (ctx->policy) {
if (ctx->policy != NULL) {
dst_key_setnum(key, DST_NUM_LIFETIME, ctx->lifetime);
dst_key_setbool(key, DST_BOOL_KSK, ctx->ksk);
dst_key_setbool(key, DST_BOOL_ZSK, ctx->zsk);
@@ -1180,12 +1180,10 @@ main(int argc, char **argv) {
}
if (ctx.predecessor == NULL && ctx.policy == NULL) {
/* cppcheck-suppress nullPointerRedundantCheck */
if (algname == NULL) {
fatal("no algorithm specified");
}
r.base = algname;
/* cppcheck-suppress nullPointerRedundantCheck */
r.length = strlen(algname);
ret = dns_secalg_fromtext(&ctx.alg, &r);
if (ret != ISC_R_SUCCESS) {
+3 -3
View File
@@ -103,9 +103,9 @@ Options
``-E engine``
This option specifies the cryptographic hardware to use, when applicable.
When BIND is built with OpenSSL PKCS#11 support, this defaults to the
string ``pkcs11``, which identifies an OpenSSL engine that can drive a
cryptographic accelerator or hardware service module. When BIND is
When BIND 9 is built with OpenSSL, this needs to be set to the OpenSSL
engine identifier that drives the cryptographic accelerator or
hardware service module (usually ``pkcs11``). When BIND is
built with native PKCS#11 cryptography (``--enable-native-pkcs11``), it
defaults to the path of the PKCS#11 provider library specified via
``--with-pkcs11``.
+3 -3
View File
@@ -59,9 +59,9 @@ Options
``-E engine``
This option specifies the cryptographic hardware to use, when applicable.
When BIND 9 is built with OpenSSL PKCS#11 support, this defaults to the
string ``pkcs11``, which identifies an OpenSSL engine that can drive a
cryptographic accelerator or hardware service module. When BIND is
When BIND 9 is built with OpenSSL, this needs to be set to the OpenSSL
engine identifier that drives the cryptographic accelerator or
hardware service module (usually ``pkcs11``). When BIND is
built with native PKCS#11 cryptography (``--enable-native-pkcs11``), it
defaults to the path of the PKCS#11 provider library specified via
``--with-pkcs11``.
+3 -3
View File
@@ -102,9 +102,9 @@ Options
``-E engine``
This option specifies the cryptographic hardware to use, when applicable.
When BIND is built with OpenSSL PKCS#11 support, this defaults to the
string ``pkcs11``, which identifies an OpenSSL engine that can drive a
cryptographic accelerator or hardware service module. When BIND is
When BIND 9 is built with OpenSSL, this needs to be set to the OpenSSL
engine identifier that drives the cryptographic accelerator or
hardware service module (usually ``pkcs11``). When BIND is
built with native PKCS#11 cryptography (``--enable-native-pkcs11``), it
defaults to the path of the PKCS#11 provider library specified via
``--with-pkcs11``.
+24 -16
View File
@@ -591,10 +591,10 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
vbprintf(2, "\trrsig by %s dropped - %s\n",
sigstr,
expired ? "expired"
: rrsig.originalttl != set->ttl
? "ttl change"
: "failed to "
"verify");
: rrsig.originalttl != set->ttl
? "ttl change"
: "failed to "
"verify");
resign = true;
}
} else if (!ispublishedkey(key) && remove_orphansigs) {
@@ -612,10 +612,10 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
vbprintf(2, "\trrsig by %s dropped - %s\n",
sigstr,
expired ? "expired"
: rrsig.originalttl != set->ttl
? "ttl change"
: "failed to "
"verify");
: rrsig.originalttl != set->ttl
? "ttl change"
: "failed to "
"verify");
}
} else if (!expired) {
vbprintf(2, "\trrsig by %s retained\n", sigstr);
@@ -1352,7 +1352,8 @@ setsoaserial(uint32_t serial, dns_updatemethod_t method) {
dns_dbnode_t *node = NULL;
dns_rdataset_t rdataset;
dns_rdata_t rdata = DNS_RDATA_INIT;
uint32_t old_serial, new_serial;
uint32_t old_serial, new_serial = 0;
dns_updatemethod_t used = dns_updatemethod_none;
result = dns_db_getoriginnode(gdb, &node);
if (result != ISC_R_SUCCESS) {
@@ -1376,16 +1377,20 @@ setsoaserial(uint32_t serial, dns_updatemethod_t method) {
if (method == dns_updatemethod_date ||
method == dns_updatemethod_unixtime) {
new_serial = dns_update_soaserial(old_serial, method);
new_serial = dns_update_soaserial(old_serial, method, &used);
} else if (serial != 0 || method == dns_updatemethod_none) {
/* Set SOA serial to the value provided. */
new_serial = serial;
used = method;
} else {
/* Increment SOA serial using RFC 1982 arithmetic */
new_serial = (old_serial + 1) & 0xFFFFFFFF;
if (new_serial == 0) {
new_serial = 1;
}
new_serial = dns_update_soaserial(old_serial, method, &used);
}
if (method != used) {
fprintf(stderr,
"%s: warning: Serial number would not advance, "
"using increment method instead\n",
program);
}
/* If the new serial is not likely to cause a zone transfer
@@ -2723,10 +2728,13 @@ static void
report(const char *format, ...) {
if (!quiet) {
FILE *out = output_stdout ? stderr : stdout;
char buf[4096];
va_list args;
va_start(args, format);
vfprintf(out, format, args);
vsnprintf(buf, sizeof(buf), format, args);
va_end(args);
fprintf(out, "%s\n", buf);
}
}
+11 -5
View File
@@ -69,9 +69,9 @@ Options
This option specifies the hardware to use for cryptographic
operations, such as a secure key store used for signing, when applicable.
When BIND is built with OpenSSL PKCS#11 support, this defaults to the
string ``pkcs11``, which identifies an OpenSSL engine that can drive a
cryptographic accelerator or hardware service module. When BIND is
When BIND 9 is built with OpenSSL, this needs to be set to the OpenSSL
engine identifier that drives the cryptographic accelerator or
hardware service module (usually ``pkcs11``). When BIND is
built with native PKCS#11 cryptography (``--enable-native-pkcs11``), it
defaults to the path of the PKCS#11 provider library specified via
``--with-pkcs11``.
@@ -202,10 +202,16 @@ Options
This format increments the SOA serial number using :rfc:`1982` arithmetic.
**unixtime**
This format sets the SOA serial number to the number of seconds since the beginning of the Unix epoch.
This format sets the SOA serial number to the number of seconds
since the beginning of the Unix epoch, unless the serial
number is already greater than or equal to that value, in
which case it is simply incremented by one.
**date**
This format sets the SOA serial number to today's date, in YYYYMMDDNN format.
This format sets the SOA serial number to today's date, in
YYYYMMDDNN format, unless the serial number is already greater
than or equal to that value, in which case it is simply
incremented by one.
``-o origin``
This option sets the zone origin. If not specified, the name of the zone file is
+4 -1
View File
@@ -82,10 +82,13 @@ static bool keyset_kskonly = false;
static void
report(const char *format, ...) {
if (!quiet) {
char buf[4096];
va_list args;
va_start(args, format);
vfprintf(stdout, format, args);
vsnprintf(buf, sizeof(buf), format, args);
va_end(args);
fprintf(stdout, "%s\n", buf);
}
}
+3 -3
View File
@@ -47,9 +47,9 @@ Options
``-E engine``
This option specifies the cryptographic hardware to use, when applicable.
When BIND is built with OpenSSL PKCS#11 support, this defaults to the
string ``pkcs11``, which identifies an OpenSSL engine that can drive a
cryptographic accelerator or hardware service module. When BIND is
When BIND 9 is built with OpenSSL, this needs to be set to the OpenSSL
engine identifier that drives the cryptographic accelerator or
hardware service module (usually ``pkcs11``). When BIND is
built with native PKCS#11 cryptography (``--enable-native-pkcs11``), it
defaults to the path of the PKCS#11 provider library specified via
``--with-pkcs11``.
+4
View File
@@ -43,8 +43,12 @@ extern uint8_t dtype[8];
typedef void(fatalcallback_t)(void);
#ifndef CPPCHECK
ISC_NORETURN void
fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
#else /* CPPCHECK */
#define fatal(...) exit(1)
#endif
void
setfatalcallback(fatalcallback_t *callback);
+2
View File
@@ -59,6 +59,7 @@ named_SOURCES = \
server.c \
statschannel.c \
tkeyconf.c \
transportconf.c \
tsigconf.c \
zoneconf.c \
unix/dlz_dlopen_driver.c \
@@ -77,6 +78,7 @@ named_SOURCES = \
include/named/smf_globals.h \
include/named/statschannel.h \
include/named/tkeyconf.h \
include/named/transportconf.h \
include/named/tsigconf.h \
include/named/types.h \
include/named/zoneconf.h \
+89 -26
View File
@@ -32,18 +32,22 @@
typedef struct builtin builtin_t;
static isc_result_t
do_version_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_hostname_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_authors_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_id_lookup(dns_sdblookup_t *lookup);
do_dns64_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_empty_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_dns64_lookup(dns_sdblookup_t *lookup);
do_hostname_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_id_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_ipv4only_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_ipv4reverse_lookup(dns_sdblookup_t *lookup);
static isc_result_t
do_version_lookup(dns_sdblookup_t *lookup);
/*
* We can't use function pointers as the db_data directly
@@ -57,12 +61,14 @@ struct builtin {
char *contact;
};
static builtin_t version_builtin = { do_version_lookup, NULL, NULL };
static builtin_t hostname_builtin = { do_hostname_lookup, NULL, NULL };
static builtin_t authors_builtin = { do_authors_lookup, NULL, NULL };
static builtin_t id_builtin = { do_id_lookup, NULL, NULL };
static builtin_t empty_builtin = { do_empty_lookup, NULL, NULL };
static builtin_t dns64_builtin = { do_dns64_lookup, NULL, NULL };
static builtin_t empty_builtin = { do_empty_lookup, NULL, NULL };
static builtin_t hostname_builtin = { do_hostname_lookup, NULL, NULL };
static builtin_t id_builtin = { do_id_lookup, NULL, NULL };
static builtin_t ipv4only_builtin = { do_ipv4only_lookup, NULL, NULL };
static builtin_t ipv4reverse_builtin = { do_ipv4reverse_lookup, NULL, NULL };
static builtin_t version_builtin = { do_version_lookup, NULL, NULL };
static dns_sdbimplementation_t *builtin_impl;
static dns_sdbimplementation_t *dns64_impl;
@@ -89,7 +95,8 @@ static const unsigned char hex16[256] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 /*F0*/
};
const unsigned char decimal[] = "0123456789";
static const unsigned char decimal[] = "0123456789";
static const unsigned char ipv4only[] = "\010ipv4only\004arpa";
static size_t
dns64_rdata(unsigned char *v, size_t start, unsigned char *rdata) {
@@ -289,6 +296,16 @@ dns64_cname(const dns_name_t *zone, const dns_name_t *name,
*/
return (ISC_R_NOTFOUND);
}
/*
* Reverse of 192.0.0.170 or 192.0.0.171 maps to ipv4only.arpa.
*/
if ((v[0] == 170 || v[0] == 171) && v[1] == 0 && v[2] == 0 &&
v[3] == 192) {
return (dns_sdb_putrdata(lookup, dns_rdatatype_ptr, 3600,
ipv4only, sizeof(ipv4only)));
}
return (dns_sdb_putrdata(lookup, dns_rdatatype_cname, 600, rdata,
(unsigned int)len));
}
@@ -429,6 +446,30 @@ do_empty_lookup(dns_sdblookup_t *lookup) {
return (ISC_R_SUCCESS);
}
static isc_result_t
do_ipv4only_lookup(dns_sdblookup_t *lookup) {
isc_result_t result;
unsigned char data[2][4] = { { 192, 0, 0, 170 }, { 192, 0, 0, 171 } };
for (int i = 0; i < 2; i++) {
result = dns_sdb_putrdata(lookup, dns_rdatatype_a, 3600,
data[i], 4);
if (result != ISC_R_SUCCESS) {
return (result);
}
}
return (ISC_R_SUCCESS);
}
static isc_result_t
do_ipv4reverse_lookup(dns_sdblookup_t *lookup) {
isc_result_t result;
result = dns_sdb_putrdata(lookup, dns_rdatatype_ptr, 3600, ipv4only,
sizeof(ipv4only));
return (result);
}
static isc_result_t
builtin_authority(const char *zone, void *dbdata, dns_sdblookup_t *lookup) {
isc_result_t result;
@@ -472,7 +513,10 @@ builtin_create(const char *zone, int argc, char **argv, void *driverdata,
UNUSED(zone);
UNUSED(driverdata);
if (strcmp(argv[0], "empty") == 0 || strcmp(argv[0], "dns64") == 0) {
if (strcmp(argv[0], "dns64") == 0 || strcmp(argv[0], "empty") == 0 ||
strcmp(argv[0], "ipv4only") == 0 ||
strcmp(argv[0], "ipv4reverse") == 0)
{
if (argc != 3) {
return (DNS_R_SYNTAX);
}
@@ -480,19 +524,27 @@ builtin_create(const char *zone, int argc, char **argv, void *driverdata,
return (DNS_R_SYNTAX);
}
if (strcmp(argv[0], "version") == 0) {
*dbdata = &version_builtin;
if (strcmp(argv[0], "authors") == 0) {
*dbdata = &authors_builtin;
} else if (strcmp(argv[0], "hostname") == 0) {
*dbdata = &hostname_builtin;
} else if (strcmp(argv[0], "authors") == 0) {
*dbdata = &authors_builtin;
} else if (strcmp(argv[0], "id") == 0) {
*dbdata = &id_builtin;
} else if (strcmp(argv[0], "empty") == 0 ||
strcmp(argv[0], "dns64") == 0) {
} else if (strcmp(argv[0], "version") == 0) {
*dbdata = &version_builtin;
} else if (strcmp(argv[0], "dns64") == 0 ||
strcmp(argv[0], "empty") == 0 ||
strcmp(argv[0], "ipv4only") == 0 ||
strcmp(argv[0], "ipv4reverse") == 0)
{
builtin_t *empty;
char *server;
char *contact;
if (argc != 3) {
return (DNS_R_SYNTAX);
}
/*
* We don't want built-in zones to fail. Fallback to
* the static configuration if memory allocation fails.
@@ -501,10 +553,14 @@ builtin_create(const char *zone, int argc, char **argv, void *driverdata,
server = isc_mem_strdup(named_g_mctx, argv[1]);
contact = isc_mem_strdup(named_g_mctx, argv[2]);
if (empty == NULL || server == NULL || contact == NULL) {
if (strcmp(argv[0], "empty") == 0) {
*dbdata = &empty_builtin;
} else {
if (strcmp(argv[0], "dns64") == 0) {
*dbdata = &dns64_builtin;
} else if (strcmp(argv[0], "empty") == 0) {
*dbdata = &empty_builtin;
} else if (strcmp(argv[0], "ipv4only") == 0) {
*dbdata = &ipv4only_builtin;
} else {
*dbdata = &ipv4reverse_builtin;
}
if (server != NULL) {
isc_mem_free(named_g_mctx, server);
@@ -517,11 +573,17 @@ builtin_create(const char *zone, int argc, char **argv, void *driverdata,
sizeof(*empty));
}
} else {
if (strcmp(argv[0], "empty") == 0) {
if (strcmp(argv[0], "dns64") == 0) {
memmove(empty, &dns64_builtin,
sizeof(empty_builtin));
} else if (strcmp(argv[0], "empty") == 0) {
memmove(empty, &empty_builtin,
sizeof(empty_builtin));
} else if (strcmp(argv[0], "ipv4only") == 0) {
memmove(empty, &ipv4only_builtin,
sizeof(empty_builtin));
} else {
memmove(empty, &dns64_builtin,
memmove(empty, &ipv4reverse_builtin,
sizeof(empty_builtin));
}
empty->server = server;
@@ -544,9 +606,10 @@ builtin_destroy(const char *zone, void *driverdata, void **dbdata) {
/*
* Don't free the static versions.
*/
if (*dbdata == &version_builtin || *dbdata == &hostname_builtin ||
*dbdata == &authors_builtin || *dbdata == &id_builtin ||
*dbdata == &empty_builtin || *dbdata == &dns64_builtin)
if (*dbdata == &authors_builtin || *dbdata == &dns64_builtin ||
*dbdata == &empty_builtin || *dbdata == &hostname_builtin ||
*dbdata == &id_builtin || *dbdata == &ipv4only_builtin ||
*dbdata == &ipv4reverse_builtin || *dbdata == &version_builtin)
{
return;
}
+153 -148
View File
@@ -87,13 +87,15 @@ options {\n\
memstatistics-file \"named.memstats\";\n\
# multiple-cnames <obsolete>;\n\
# named-xfer <obsolete>;\n\
nocookie-udp-size 1232;\n\
nocookie-udp-size 4096;\n\
notify-rate 20;\n\
nta-lifetime 3600;\n\
nta-recheck 300;\n\
# pid-file \"" NAMED_LOCALSTATEDIR "/run/named/named.pid\"; \n\
port 53;\n\
tls-port 853;\n\
http-port 80;\n\
https-port 443;\n\
prefetch 2 9;\n\
recursing-file \"named.recursing\";\n\
recursive-clients 1000;\n\
@@ -131,7 +133,6 @@ options {\n\
# treat-cr-as-space <obsolete>;\n\
trust-anchor-telemetry yes;\n\
# use-id-pool <obsolete>;\n\
# use-ixfr <obsolete>;\n\
\n\
/* view */\n\
allow-new-zones no;\n\
@@ -141,7 +142,6 @@ options {\n\
allow-recursion { localnets; localhost; };\n\
allow-recursion-on { any; };\n\
allow-update-forwarding {none;};\n\
# allow-v6-synthesis <obsolete>;\n\
auth-nxdomain false;\n\
check-dup-records warn;\n\
check-mx warn;\n\
@@ -170,8 +170,8 @@ options {\n\
max-clients-per-query 100;\n\
max-ncache-ttl 10800; /* 3 hours */\n\
max-recursion-depth 7;\n\
max-recursion-queries 75;\n\
max-stale-ttl 43200; /* 12 hours */\n\
max-recursion-queries 100;\n\
max-stale-ttl 86400; /* 1 day */\n\
message-compression yes;\n\
min-ncache-ttl 0; /* 0 hours */\n\
min-cache-ttl 0; /* 0 seconds */\n\
@@ -196,9 +196,10 @@ options {\n\
servfail-ttl 1;\n\
# sortlist <none>\n\
stale-answer-enable false;\n\
stale-refresh-time 30; /* 30 seconds */\n\
stale-answer-ttl 1; /* 1 second */\n\
stale-answer-client-timeout 1800; /* in milliseconds */\n\
stale-answer-ttl 30; /* 30 seconds */\n\
stale-cache-enable false;\n\
stale-refresh-time 30; /* 30 seconds */\n\
synth-from-dnssec no;\n\
# topology <none>\n\
transfer-format many-answers;\n\
@@ -609,10 +610,76 @@ named_config_getprimariesdef(const cfg_obj_t *cctx, const char *name,
return (result);
}
static isc_result_t
named_config_getname(isc_mem_t *mctx, const cfg_obj_t *obj,
dns_name_t **namep) {
REQUIRE(namep != NULL && *namep == NULL);
const char *objstr;
isc_result_t result;
isc_buffer_t b;
dns_fixedname_t fname;
if (!cfg_obj_isstring(obj)) {
*namep = NULL;
return (ISC_R_SUCCESS);
}
*namep = isc_mem_get(mctx, sizeof(**namep));
dns_name_init(*namep, NULL);
objstr = cfg_obj_asstring(obj);
isc_buffer_constinit(&b, objstr, strlen(objstr));
isc_buffer_add(&b, strlen(objstr));
dns_fixedname_init(&fname);
result = dns_name_fromtext(dns_fixedname_name(&fname), &b, dns_rootname,
0, NULL);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, *namep, sizeof(*namep));
*namep = NULL;
return (result);
}
dns_name_dup(dns_fixedname_name(&fname), mctx, *namep);
return (ISC_R_SUCCESS);
}
#define grow_array(mctx, array, newlen, oldlen) \
if (newlen >= oldlen) { \
size_t newsize = (newlen + 16) * sizeof(array[0]); \
size_t oldsize = oldlen * sizeof(array[0]); \
void *tmp = isc_mem_get(mctx, newsize); \
memset(tmp, 0, newsize); \
if (oldlen != 0) { \
memmove(tmp, array, oldsize); \
isc_mem_put(mctx, array, oldsize); \
} \
array = tmp; \
oldlen = newlen + 16; \
}
#define shrink_array(mctx, array, newlen, oldlen) \
if (newlen < oldlen) { \
void *tmp = NULL; \
size_t newsize = newlen * sizeof(array[0]); \
size_t oldsize = oldlen * sizeof(array[0]); \
if (newlen != 0) { \
tmp = isc_mem_get(mctx, newsize); \
memset(tmp, 0, newsize); \
memmove(tmp, array, newsize); \
} else { \
tmp = NULL; \
} \
isc_mem_put(mctx, array, oldsize); \
array = tmp; \
oldlen = newlen; \
}
isc_result_t
named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
isc_mem_t *mctx, dns_ipkeylist_t *ipkl) {
uint32_t addrcount = 0, dscpcount = 0, keycount = 0, i = 0;
uint32_t addrcount = 0, dscpcount = 0, keycount = 0, tlscount = 0,
i = 0;
uint32_t listcount = 0, l = 0, j;
uint32_t stackcount = 0, pushed = 0;
isc_result_t result;
@@ -620,12 +687,14 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
const cfg_obj_t *addrlist;
const cfg_obj_t *portobj;
const cfg_obj_t *dscpobj;
in_port_t port;
in_port_t port = (in_port_t)0;
in_port_t def_port;
in_port_t def_tlsport;
isc_dscp_t dscp = -1;
dns_fixedname_t fname;
isc_sockaddr_t *addrs = NULL;
isc_dscp_t *dscps = NULL;
dns_name_t **keys = NULL;
dns_name_t **tlss = NULL;
struct {
const char *name;
} *lists = NULL;
@@ -639,6 +708,7 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
REQUIRE(ipkl->count == 0);
REQUIRE(ipkl->addrs == NULL);
REQUIRE(ipkl->keys == NULL);
REQUIRE(ipkl->tlss == NULL);
REQUIRE(ipkl->dscps == NULL);
REQUIRE(ipkl->labels == NULL);
REQUIRE(ipkl->allocated == 0);
@@ -646,7 +716,12 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
/*
* Get system defaults.
*/
result = named_config_getport(config, "port", &port);
result = named_config_getport(config, "port", &def_port);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
result = named_config_getport(config, "tls-port", &def_tlsport);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
@@ -690,33 +765,20 @@ resume:
for (; element != NULL; element = cfg_list_next(element)) {
const cfg_obj_t *addr;
const cfg_obj_t *key;
const char *keystr;
isc_buffer_t b;
const cfg_obj_t *tls;
addr = cfg_tuple_get(cfg_listelt_value(element),
"primarieselement");
key = cfg_tuple_get(cfg_listelt_value(element), "key");
tls = cfg_tuple_get(cfg_listelt_value(element), "tls");
if (!cfg_obj_issockaddr(addr)) {
const char *listname = cfg_obj_asstring(addr);
isc_result_t tresult;
/* Grow lists? */
if (listcount == l) {
void *tmp;
uint32_t newlen = listcount + 16;
size_t newsize, oldsize;
grow_array(mctx, lists, l, listcount);
newsize = newlen * sizeof(*lists);
oldsize = listcount * sizeof(*lists);
tmp = isc_mem_get(mctx, newsize);
if (listcount != 0) {
memmove(tmp, lists, oldsize);
isc_mem_put(mctx, lists, oldsize);
}
lists = tmp;
listcount = newlen;
}
/* Seen? */
for (j = 0; j < l; j++) {
if (strcasecmp(lists[j].name, listname) == 0) {
@@ -742,21 +804,7 @@ resume:
}
lists[l++].name = listname;
/* Grow stack? */
if (stackcount == pushed) {
void *tmp;
uint32_t newlen = stackcount + 16;
size_t newsize, oldsize;
newsize = newlen * sizeof(*stack);
oldsize = stackcount * sizeof(*stack);
tmp = isc_mem_get(mctx, newsize);
if (stackcount != 0) {
memmove(tmp, stack, oldsize);
isc_mem_put(mctx, stack, oldsize);
}
stack = tmp;
stackcount = newlen;
}
grow_array(mctx, stack, pushed, stackcount);
/*
* We want to resume processing this list on the
* next element.
@@ -768,68 +816,44 @@ resume:
goto newlist;
}
if (i == addrcount) {
void *tmp;
uint32_t newlen = addrcount + 16;
size_t newsize, oldsize;
newsize = newlen * sizeof(isc_sockaddr_t);
oldsize = addrcount * sizeof(isc_sockaddr_t);
tmp = isc_mem_get(mctx, newsize);
if (addrcount != 0) {
memmove(tmp, addrs, oldsize);
isc_mem_put(mctx, addrs, oldsize);
}
addrs = tmp;
addrcount = newlen;
newsize = newlen * sizeof(isc_dscp_t);
oldsize = dscpcount * sizeof(isc_dscp_t);
tmp = isc_mem_get(mctx, newsize);
if (dscpcount != 0) {
memmove(tmp, dscps, oldsize);
isc_mem_put(mctx, dscps, oldsize);
}
dscps = tmp;
dscpcount = newlen;
newsize = newlen * sizeof(dns_name_t *);
oldsize = keycount * sizeof(dns_name_t *);
tmp = isc_mem_get(mctx, newsize);
if (keycount != 0) {
memmove(tmp, keys, oldsize);
isc_mem_put(mctx, keys, oldsize);
}
keys = tmp;
keycount = newlen;
}
grow_array(mctx, addrs, i, addrcount);
grow_array(mctx, dscps, i, dscpcount);
grow_array(mctx, keys, i, keycount);
grow_array(mctx, tlss, i, tlscount);
addrs[i] = *cfg_obj_assockaddr(addr);
if (isc_sockaddr_getport(&addrs[i]) == 0) {
isc_sockaddr_setport(&addrs[i], port);
}
dscps[i] = cfg_obj_getdscp(addr);
if (dscps[i] == -1) {
dscps[i] = dscp;
}
keys[i] = NULL;
i++; /* Increment here so that cleanup on error works. */
if (!cfg_obj_isstring(key)) {
continue;
}
keys[i - 1] = isc_mem_get(mctx, sizeof(dns_name_t));
dns_name_init(keys[i - 1], NULL);
keystr = cfg_obj_asstring(key);
isc_buffer_constinit(&b, keystr, strlen(keystr));
isc_buffer_add(&b, strlen(keystr));
dns_fixedname_init(&fname);
result = dns_name_fromtext(dns_fixedname_name(&fname), &b,
dns_rootname, 0, NULL);
result = named_config_getname(mctx, key, &keys[i]);
if (result != ISC_R_SUCCESS) {
i++; /* Increment here so that cleanup on error works.
*/
goto cleanup;
}
dns_name_dup(dns_fixedname_name(&fname), mctx, keys[i - 1]);
result = named_config_getname(mctx, tls, &tlss[i]);
if (result != ISC_R_SUCCESS) {
i++; /* Increment here so that cleanup on error works.
*/
goto cleanup;
}
/* Set the default port or tls-port */
if (port == 0) {
if (tlss[i] != NULL) {
port = def_tlsport;
} else {
port = def_port;
}
}
if (isc_sockaddr_getport(&addrs[i]) == 0) {
isc_sockaddr_setport(&addrs[i], port);
}
i++;
}
if (pushed != 0) {
pushed--;
@@ -838,61 +862,28 @@ resume:
dscp = stack[pushed].dscp;
goto resume;
}
if (i < addrcount) {
void *tmp;
size_t newsize, oldsize;
newsize = i * sizeof(isc_sockaddr_t);
oldsize = addrcount * sizeof(isc_sockaddr_t);
if (i != 0) {
tmp = isc_mem_get(mctx, newsize);
memmove(tmp, addrs, newsize);
} else {
tmp = NULL;
}
isc_mem_put(mctx, addrs, oldsize);
addrs = tmp;
addrcount = i;
newsize = i * sizeof(isc_dscp_t);
oldsize = dscpcount * sizeof(isc_dscp_t);
if (i != 0) {
tmp = isc_mem_get(mctx, newsize);
memmove(tmp, dscps, newsize);
} else {
tmp = NULL;
}
isc_mem_put(mctx, dscps, oldsize);
dscps = tmp;
dscpcount = i;
newsize = i * sizeof(dns_name_t *);
oldsize = keycount * sizeof(dns_name_t *);
if (i != 0) {
tmp = isc_mem_get(mctx, newsize);
memmove(tmp, keys, newsize);
} else {
tmp = NULL;
}
isc_mem_put(mctx, keys, oldsize);
keys = tmp;
keycount = i;
}
shrink_array(mctx, addrs, i, addrcount);
shrink_array(mctx, dscps, i, dscpcount);
shrink_array(mctx, keys, i, keycount);
shrink_array(mctx, tlss, i, tlscount);
if (lists != NULL) {
isc_mem_put(mctx, lists, listcount * sizeof(*lists));
isc_mem_put(mctx, lists, listcount * sizeof(lists[0]));
}
if (stack != NULL) {
isc_mem_put(mctx, stack, stackcount * sizeof(*stack));
isc_mem_put(mctx, stack, stackcount * sizeof(stack[0]));
}
INSIST(dscpcount == addrcount);
INSIST(keycount == addrcount);
INSIST(tlscount == addrcount);
INSIST(keycount == dscpcount);
ipkl->addrs = addrs;
ipkl->dscps = dscps;
ipkl->keys = keys;
ipkl->tlss = tlss;
ipkl->count = addrcount;
ipkl->allocated = addrcount;
@@ -900,10 +891,10 @@ resume:
cleanup:
if (addrs != NULL) {
isc_mem_put(mctx, addrs, addrcount * sizeof(isc_sockaddr_t));
isc_mem_put(mctx, addrs, addrcount * sizeof(addrs[0]));
}
if (dscps != NULL) {
isc_mem_put(mctx, dscps, dscpcount * sizeof(isc_dscp_t));
isc_mem_put(mctx, dscps, dscpcount * sizeof(dscps[0]));
}
if (keys != NULL) {
for (j = 0; j < i; j++) {
@@ -913,15 +904,27 @@ cleanup:
if (dns_name_dynamic(keys[j])) {
dns_name_free(keys[j], mctx);
}
isc_mem_put(mctx, keys[j], sizeof(dns_name_t));
isc_mem_put(mctx, keys[j], sizeof(*keys[j]));
}
isc_mem_put(mctx, keys, keycount * sizeof(dns_name_t *));
isc_mem_put(mctx, keys, keycount * sizeof(keys[0]));
}
if (tlss != NULL) {
for (j = 0; j < i; j++) {
if (tlss[j] == NULL) {
continue;
}
if (dns_name_dynamic(tlss[j])) {
dns_name_free(tlss[j], mctx);
}
isc_mem_put(mctx, tlss[j], sizeof(*tlss[j]));
}
isc_mem_put(mctx, tlss, tlscount * sizeof(tlss[0]));
}
if (lists != NULL) {
isc_mem_put(mctx, lists, listcount * sizeof(*lists));
isc_mem_put(mctx, lists, listcount * sizeof(lists[0]));
}
if (stack != NULL) {
isc_mem_put(mctx, stack, stackcount * sizeof(*stack));
isc_mem_put(mctx, stack, stackcount * sizeof(stack[0]));
}
return (result);
}
@@ -983,13 +986,15 @@ named_config_getdscp(const cfg_obj_t *config, isc_dscp_t *dscpp) {
struct keyalgorithms {
const char *str;
enum { hmacnone,
hmacmd5,
hmacsha1,
hmacsha224,
hmacsha256,
hmacsha384,
hmacsha512 } hmac;
enum {
hmacnone,
hmacmd5,
hmacsha1,
hmacsha224,
hmacsha256,
hmacsha384,
hmacsha512
} hmac;
unsigned int type;
uint16_t size;
} algorithms[] = { { "hmac-md5", hmacmd5, DST_ALG_HMACMD5, 128 },
+12 -10
View File
@@ -64,16 +64,18 @@ EXTERN isc_timermgr_t *named_g_timermgr INIT(NULL);
EXTERN isc_socketmgr_t *named_g_socketmgr INIT(NULL);
EXTERN isc_nm_t *named_g_nm INIT(NULL);
EXTERN cfg_parser_t *named_g_parser INIT(NULL);
EXTERN cfg_parser_t *named_g_addparser INIT(NULL);
EXTERN const char *named_g_version INIT(PACKAGE_VERSION);
EXTERN const char *named_g_product INIT(PACKAGE_NAME);
EXTERN const char *named_g_description INIT(PACKAGE_DESCRIPTION);
EXTERN const char *named_g_srcid INIT(PACKAGE_SRCID);
EXTERN const char *named_g_configargs INIT(PACKAGE_CONFIGARGS);
EXTERN const char *named_g_builder INIT(PACKAGE_BUILDER);
EXTERN in_port_t named_g_port INIT(0);
EXTERN in_port_t named_g_tlsport INIT(0);
EXTERN isc_dscp_t named_g_dscp INIT(-1);
EXTERN cfg_parser_t *named_g_addparser INIT(NULL);
EXTERN const char *named_g_version INIT(PACKAGE_VERSION);
EXTERN const char *named_g_product INIT(PACKAGE_NAME);
EXTERN const char *named_g_description INIT(PACKAGE_DESCRIPTION);
EXTERN const char *named_g_srcid INIT(PACKAGE_SRCID);
EXTERN const char *named_g_configargs INIT(PACKAGE_CONFIGARGS);
EXTERN const char *named_g_builder INIT(PACKAGE_BUILDER);
EXTERN in_port_t named_g_port INIT(0);
EXTERN in_port_t named_g_tlsport INIT(0);
EXTERN in_port_t named_g_http_secure_port INIT(0);
EXTERN in_port_t named_g_http_port INIT(0);
EXTERN isc_dscp_t named_g_dscp INIT(-1);
EXTERN named_server_t *named_g_server INIT(NULL);
+41
View File
@@ -0,0 +1,41 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
#pragma once
/*! \file */
#include <isc/lang.h>
#include <isc/types.h>
#include <dns/transport.h>
#include <isccfg/cfg.h>
ISC_LANG_BEGINDECLS
isc_result_t
named_transports_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
isc_mem_t *mctx, dns_transport_list_t **listp);
/*%<
* Create a list of transport objects (DoT or DoH) and configure them
* according to 'key-file', 'cert-file', 'ca-file' or 'hostname'
* statements.
*
* Requires:
* \li 'config' is not NULL.
* \li 'vconfig' is not NULL.
* \li 'mctx' is not NULL
* \li 'listp' is not NULL, and '*listp' is NULL
*
*/
ISC_LANG_ENDDECLS
+12 -1
View File
@@ -43,7 +43,9 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
*/
bool
named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig);
named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, const cfg_obj_t *config,
cfg_aclconfctx_t *actx);
/*%<
* If 'zone' can be safely reconfigured according to the configuration
* data in 'zconfig', return true. If the configuration data is so
@@ -51,6 +53,15 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig);
* and recreated, return false.
*/
bool
named_zone_inlinesigning(dns_zone_t *zone, const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, const cfg_obj_t *config,
cfg_aclconfctx_t *actx);
/*%<
* Determine if zone uses inline-signing. This is true if inline-signing
* is set to yes, or if there is a dnssec-policy on a non-dynamic zone.
*/
isc_result_t
named_zone_configure_writeable_dlz(dns_dlzdb_t *dlzdatabase, dns_zone_t *zone,
dns_rdataclass_t rdclass, dns_name_t *name);
+13 -1
View File
@@ -705,7 +705,7 @@ parse_T_opt(char *option) {
static void
parse_port(char *arg) {
enum { DNSPORT, TLSPORT } ptype = DNSPORT;
enum { DNSPORT, TLSPORT, HTTP_SECURE_PORT, HTTP_PORT } ptype = DNSPORT;
char *value = arg;
int port;
@@ -714,6 +714,12 @@ parse_port(char *arg) {
} else if (strncmp(arg, "tls=", 4) == 0) {
value = arg + 4;
ptype = TLSPORT;
} else if (strncmp(arg, "https=", 6) == 0) {
value = arg + 6;
ptype = HTTP_SECURE_PORT;
} else if (strncmp(arg, "http=", 5) == 0) {
value = arg + 6;
ptype = HTTP_PORT;
}
port = parse_int(value, "port");
@@ -728,6 +734,12 @@ parse_port(char *arg) {
case TLSPORT:
named_g_tlsport = port;
break;
case HTTP_SECURE_PORT:
named_g_http_secure_port = port;
break;
case HTTP_PORT:
named_g_http_port = port;
break;
default:
INSIST(0);
ISC_UNREACHABLE();
+53 -21
View File
@@ -66,6 +66,8 @@ DNSSEC-POLICY
keys { ( csk | ksk | zsk ) [ ( key-directory ) ] lifetime
duration_or_unlimited algorithm string [ integer ]; ... };
max-zone-ttl duration;
nsec3param [ iterations integer ] [ optout boolean ] [
salt-length integer ];
parent-ds-ttl duration;
parent-propagation-delay duration;
publish-safety duration;
@@ -84,6 +86,15 @@ DYNDB
dyndb string quoted_string {
unspecified-text };
HTTP
^^^^
::
http string {
endpoints { quoted_string; ... }; // experimental
};
KEY
^^^
@@ -135,7 +146,8 @@ MASTERS
masters string [ port integer ] [ dscp
integer ] { ( primaries | ipv4_address
[ port integer ] | ipv6_address [ port
integer ] ) [ key string ]; ... };
integer ] ) [ key string ] [ tls
string ]; ... };
OPTIONS
^^^^^^^
@@ -156,14 +168,14 @@ OPTIONS
allow-update-forwarding { address_match_element; ... };
also-notify [ port integer ] [ dscp integer ] { ( primaries |
ipv4_address [ port integer ] | ipv6_address [ port
integer ] ) [ key string ]; ... };
integer ] ) [ key string ] [ tls string ]; ... };
alt-transfer-source ( ipv4_address | * ) [ port ( integer | * )
] [ dscp integer ];
alt-transfer-source-v6 ( ipv6_address | * ) [ port ( integer |
* ) ] [ dscp integer ];
answer-cookie boolean;
attach-cache string;
auth-nxdomain boolean; // default changed
auth-nxdomain boolean;
auto-dnssec ( allow | maintain | off );
automatic-interface-scan boolean;
avoid-v4-udp-ports { portrange; ... };
@@ -174,8 +186,9 @@ OPTIONS
catalog-zones { zone string [ default-masters [ port integer ]
[ dscp integer ] { ( primaries | ipv4_address [ port
integer ] | ipv6_address [ port integer ] ) [ key
string ]; ... } ] [ zone-directory quoted_string ] [
in-memory boolean ] [ min-update-interval duration ]; ... };
string ] [ tls string ]; ... } ] [ zone-directory
quoted_string ] [ in-memory boolean ] [ min-update-interval
duration ]; ... };
check-dup-records ( fail | warn | ignore );
check-integrity boolean;
check-mx ( fail | warn | ignore );
@@ -260,18 +273,25 @@ OPTIONS
glue-cache boolean;// deprecated
heartbeat-interval integer;
hostname ( quoted_string | none );
http-port integer;
https-port integer;
inline-signing boolean;
interface-interval duration;
ipv4only-contact string;
ipv4only-enable boolean;
ipv4only-server string;
ixfr-from-differences ( primary | master | secondary | slave |
boolean );
keep-response-order { address_match_element; ... };
key-directory quoted_string;
lame-ttl duration;
listen-on [ port integer ] [ dscp
integer ] [ tls string ] {
integer ] [ tls string ] [ http
string ] {
address_match_element; ... };
listen-on-v6 [ port integer ] [ dscp
integer ] [ tls string ] {
integer ] [ tls string ] [ http
string ] {
address_match_element; ... };
lmdb-mapsize sizeval;
lock-file ( quoted_string | none );
@@ -398,6 +418,7 @@ OPTIONS
sig-validity-interval integer [ integer ];
sortlist { address_match_element; ... };
stacksize ( default | unlimited | sizeval );
stale-answer-client-timeout ( disabled | off | integer );
stale-answer-enable boolean;
stale-answer-ttl duration;
stale-cache-enable boolean;
@@ -455,7 +476,8 @@ PRIMARIES
primaries string [ port integer ] [ dscp
integer ] { ( primaries | ipv4_address
[ port integer ] | ipv6_address [ port
integer ] ) [ key string ]; ... };
integer ] ) [ key string ] [ tls
string ]; ... };
SERVER
^^^^^^
@@ -513,8 +535,13 @@ TLS
::
tls string {
ca-file quoted_string;
cert-file quoted_string;
ciphers string; // experimental
dh-param quoted_string; // experimental
hostname quoted_string;
key-file quoted_string;
protocols sslprotos; // experimental
};
TRUST-ANCHORS
@@ -557,20 +584,21 @@ VIEW
allow-update-forwarding { address_match_element; ... };
also-notify [ port integer ] [ dscp integer ] { ( primaries |
ipv4_address [ port integer ] | ipv6_address [ port
integer ] ) [ key string ]; ... };
integer ] ) [ key string ] [ tls string ]; ... };
alt-transfer-source ( ipv4_address | * ) [ port ( integer | * )
] [ dscp integer ];
alt-transfer-source-v6 ( ipv6_address | * ) [ port ( integer |
* ) ] [ dscp integer ];
attach-cache string;
auth-nxdomain boolean; // default changed
auth-nxdomain boolean;
auto-dnssec ( allow | maintain | off );
cache-file quoted_string;
catalog-zones { zone string [ default-masters [ port integer ]
[ dscp integer ] { ( primaries | ipv4_address [ port
integer ] | ipv6_address [ port integer ] ) [ key
string ]; ... } ] [ zone-directory quoted_string ] [
in-memory boolean ] [ min-update-interval duration ]; ... };
string ] [ tls string ]; ... } ] [ zone-directory
quoted_string ] [ in-memory boolean ] [ min-update-interval
duration ]; ... };
check-dup-records ( fail | warn | ignore );
check-integrity boolean;
check-mx ( fail | warn | ignore );
@@ -638,6 +666,9 @@ VIEW
| ipv6_address ) [ port integer ] [ dscp integer ]; ... };
glue-cache boolean;// deprecated
inline-signing boolean;
ipv4only-contact string;
ipv4only-enable boolean;
ipv4only-server string;
ixfr-from-differences ( primary | master | secondary | slave |
boolean );
key string {
@@ -795,6 +826,7 @@ VIEW
sig-signing-type integer;
sig-validity-interval integer [ integer ];
sortlist { address_match_element; ... };
stale-answer-client-timeout ( disabled | off | integer );
stale-answer-enable boolean;
stale-answer-ttl duration;
stale-cache-enable boolean;
@@ -830,8 +862,8 @@ VIEW
allow-update-forwarding { address_match_element; ... };
also-notify [ port integer ] [ dscp integer ] { (
primaries | ipv4_address [ port integer ] |
ipv6_address [ port integer ] ) [ key string ];
... };
ipv6_address [ port integer ] ) [ key string ] [
tls string ]; ... };
alt-transfer-source ( ipv4_address | * ) [ port (
integer | * ) ] [ dscp integer ];
alt-transfer-source-v6 ( ipv6_address | * ) [ port (
@@ -871,8 +903,8 @@ VIEW
masterfile-style ( full | relative );
masters [ port integer ] [ dscp integer ] { (
primaries | ipv4_address [ port integer ] |
ipv6_address [ port integer ] ) [ key string ];
... };
ipv6_address [ port integer ] ) [ key string ] [
tls string ]; ... };
max-ixfr-ratio ( unlimited | percentage );
max-journal-size ( default | unlimited | sizeval );
max-records integer;
@@ -895,8 +927,8 @@ VIEW
notify-to-soa boolean;
primaries [ port integer ] [ dscp integer ] { (
primaries | ipv4_address [ port integer ] |
ipv6_address [ port integer ] ) [ key string ];
... };
ipv6_address [ port integer ] ) [ key string ] [
tls string ]; ... };
request-expire boolean;
request-ixfr boolean;
serial-update-method ( date | increment | unixtime );
@@ -941,7 +973,7 @@ ZONE
allow-update-forwarding { address_match_element; ... };
also-notify [ port integer ] [ dscp integer ] { ( primaries |
ipv4_address [ port integer ] | ipv6_address [ port
integer ] ) [ key string ]; ... };
integer ] ) [ key string ] [ tls string ]; ... };
alt-transfer-source ( ipv4_address | * ) [ port ( integer | * )
] [ dscp integer ];
alt-transfer-source-v6 ( ipv6_address | * ) [ port ( integer |
@@ -979,7 +1011,7 @@ ZONE
masterfile-style ( full | relative );
masters [ port integer ] [ dscp integer ] { ( primaries |
ipv4_address [ port integer ] | ipv6_address [ port
integer ] ) [ key string ]; ... };
integer ] ) [ key string ] [ tls string ]; ... };
max-ixfr-ratio ( unlimited | percentage );
max-journal-size ( default | unlimited | sizeval );
max-records integer;
@@ -1002,7 +1034,7 @@ ZONE
notify-to-soa boolean;
primaries [ port integer ] [ dscp integer ] { ( primaries |
ipv4_address [ port integer ] | ipv6_address [ port
integer ] ) [ key string ]; ... };
integer ] ) [ key string ] [ tls string ]; ... };
request-expire boolean;
request-ixfr boolean;
serial-update-method ( date | increment | unixtime );
+9 -5
View File
@@ -72,9 +72,9 @@ Options
When applicable, this option specifies the hardware to use for cryptographic
operations, such as a secure key store used for signing.
When BIND is built with OpenSSL PKCS#11 support, this defaults to the
string ``pkcs11``, which identifies an OpenSSL engine that can drive a
cryptographic accelerator or hardware service module. When BIND is
When BIND 9 is built with OpenSSL, this needs to be set to the OpenSSL
engine identifier that drives the cryptographic accelerator or
hardware service module (usually ``pkcs11``). When BIND is
built with native PKCS#11 cryptography (``--enable-native-pkcs11``), it
defaults to the path of the PKCS#11 provider library specified via
``--with-pkcs11``.
@@ -115,7 +115,11 @@ Options
``portnum``; if not not specified, the default is port 53. If
``value`` is of the form ``tls=<portnum>``, the server will
listen for TLS queries on ``portnum``; the default is 853.
If ``value`` is of the form ``https=<portnum>``, the server will
listen for HTTPS queries on ``portnum``; the default is 443.
If ``value`` is of the form ``http=<portnum>``, the server will
listen for HTTP queries on ``portnum``; the default is 80.
``-s``
This option writes memory usage statistics to ``stdout`` on exit.
@@ -235,4 +239,4 @@ Files
See Also
~~~~~~~~
:rfc:`1033`, :rfc:`1034`, :rfc:`1035`, :manpage:`named-checkconf(8)`, :manpage:`named-checkzone(8)`, :manpage:`rndc(8), :manpage:`named.conf(5)`, BIND 9 Administrator Reference Manual.
:rfc:`1033`, :rfc:`1034`, :rfc:`1035`, :manpage:`named-checkconf(8)`, :manpage:`named-checkzone(8)`, :manpage:`rndc(8)`, :manpage:`named.conf(5)`, BIND 9 Administrator Reference Manual.
+460 -227
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -2336,12 +2336,12 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
TRY0(xmlTextWriterEndElement(writer)); /* /statistics */
TRY0(xmlTextWriterEndDocument(writer));
xmlFreeTextWriter(writer);
xmlDocDumpFormatMemoryEnc(doc, buf, buflen, "UTF-8", 0);
if (*buf == NULL) {
goto cleanup;
}
xmlFreeTextWriter(writer);
xmlFreeDoc(doc);
return (ISC_R_SUCCESS);
+201
View File
@@ -0,0 +1,201 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file */
#include <inttypes.h>
#include <isc/buffer.h>
#include <isc/string.h>
#include <isc/util.h>
#include <dns/name.h>
#include <dns/transport.h>
#include <isccfg/cfg.h>
#include <named/log.h>
#include <named/transportconf.h>
#define create_name(id, name) \
isc_buffer_t namesrc, namebuf; \
char namedata[DNS_NAME_FORMATSIZE + 1]; \
dns_name_init(name, NULL); \
isc_buffer_constinit(&namesrc, id, strlen(id)); \
isc_buffer_add(&namesrc, strlen(id)); \
isc_buffer_init(&namebuf, namedata, sizeof(namedata)); \
result = (dns_name_fromtext(name, &namesrc, dns_rootname, \
DNS_NAME_DOWNCASE, &namebuf)); \
if (result != ISC_R_SUCCESS) { \
goto failure; \
}
#define parse_transport_option(map, transport, name, setter) \
{ \
const cfg_obj_t *obj = NULL; \
cfg_map_get(map, name, &obj); \
if (obj != NULL) { \
setter(transport, cfg_obj_asstring(obj)); \
} \
}
static isc_result_t
add_doh_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
const cfg_obj_t *doh = NULL;
const char *dohid = NULL;
isc_result_t result;
for (const cfg_listelt_t *element = cfg_list_first(transportlist);
element != NULL; element = cfg_list_next(element))
{
dns_name_t dohname;
dns_transport_t *transport;
doh = cfg_listelt_value(element);
dohid = cfg_obj_asstring(cfg_map_getname(doh));
create_name(dohid, &dohname);
transport = dns_transport_new(&dohname, DNS_TRANSPORT_DOH,
list);
parse_transport_option(doh, transport, "key-file",
dns_transport_set_keyfile);
parse_transport_option(doh, transport, "cert-file",
dns_transport_set_certfile);
parse_transport_option(doh, transport, "ca-file",
dns_transport_set_cafile);
parse_transport_option(doh, transport, "hostname",
dns_transport_set_hostname);
}
return (ISC_R_SUCCESS);
failure:
cfg_obj_log(doh, named_g_lctx, ISC_LOG_ERROR,
"configuring DoH '%s': %s", dohid,
isc_result_totext(result));
return (result);
}
static isc_result_t
add_tls_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
const cfg_obj_t *tls = NULL;
const char *tlsid = NULL;
isc_result_t result;
for (const cfg_listelt_t *element = cfg_list_first(transportlist);
element != NULL; element = cfg_list_next(element))
{
dns_name_t tlsname;
dns_transport_t *transport;
tls = cfg_listelt_value(element);
tlsid = cfg_obj_asstring(cfg_map_getname(tls));
if (!strcmp(tlsid, "ephemeral")) {
result = ISC_R_UNEXPECTEDTOKEN;
goto failure;
}
create_name(tlsid, &tlsname);
transport = dns_transport_new(&tlsname, DNS_TRANSPORT_TLS,
list);
parse_transport_option(tls, transport, "key-file",
dns_transport_set_keyfile);
parse_transport_option(tls, transport, "cert-file",
dns_transport_set_certfile);
parse_transport_option(tls, transport, "ca-file",
dns_transport_set_cafile);
parse_transport_option(tls, transport, "hostname",
dns_transport_set_hostname);
}
return (ISC_R_SUCCESS);
failure:
cfg_obj_log(tls, named_g_lctx, ISC_LOG_ERROR,
"configuring tls '%s': %s", tlsid,
isc_result_totext(result));
return (result);
}
#define CHECK(f) \
if ((result = f) != ISC_R_SUCCESS) { \
goto failure; \
}
static isc_result_t
transport_list_fromconfig(const cfg_obj_t *config, dns_transport_list_t *list) {
const cfg_obj_t *obj = NULL;
isc_result_t result = ISC_R_SUCCESS;
if (result == ISC_R_SUCCESS &&
cfg_map_get(config, "tls", &obj) == ISC_R_SUCCESS)
{
result = add_tls_transports(obj, list);
obj = NULL;
}
if (result == ISC_R_SUCCESS &&
cfg_map_get(config, "doh", &obj) == ISC_R_SUCCESS)
{
result = add_doh_transports(obj, list);
obj = NULL;
}
return (result);
}
static void
transport_list_add_ephemeral(dns_transport_list_t *list) {
isc_result_t result;
dns_name_t tlsname;
create_name("ephemeral", &tlsname);
(void)dns_transport_new(&tlsname, DNS_TRANSPORT_TLS, list);
return;
failure:
RUNTIME_CHECK(result == ISC_R_SUCCESS);
}
isc_result_t
named_transports_fromconfig(const cfg_obj_t *config, const cfg_obj_t *vconfig,
isc_mem_t *mctx, dns_transport_list_t **listp) {
isc_result_t result;
dns_transport_list_t *list = dns_transport_list_new(mctx);
REQUIRE(listp != NULL && *listp == NULL);
transport_list_add_ephemeral(list);
if (config != NULL) {
result = transport_list_fromconfig(config, list);
if (result != ISC_R_SUCCESS) {
goto failure;
}
}
if (vconfig != NULL) {
config = cfg_tuple_get(vconfig, "options");
transport_list_fromconfig(config, list);
}
*listp = list;
return (ISC_R_SUCCESS);
failure:
dns_transport_list_detach(&list);
return (result);
}
+6
View File
@@ -59,6 +59,9 @@
<ClCompile Include="..\tkeyconf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\transportconf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\tsigconf.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -111,6 +114,9 @@
<ClInclude Include="..\include\named\tkeyconf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\named\transportconf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\named\tsigconf.h">
<Filter>Header Files</Filter>
</ClInclude>
+2
View File
@@ -138,6 +138,7 @@ perl -e "print \";\";" &gt;&gt; xsl.c
<ClCompile Include="..\server.c" />
<ClCompile Include="..\statschannel.c" />
<ClCompile Include="..\tkeyconf.c" />
<ClCompile Include="..\transportconf.c" />
<ClCompile Include="..\tsigconf.c" />
<ClCompile Include="..\xsl.c" />
<ClCompile Include="..\zoneconf.c" />
@@ -159,6 +160,7 @@ perl -e "print \";\";" &gt;&gt; xsl.c
<ClInclude Include="..\include\named\server.h" />
<ClInclude Include="..\include\named\statschannel.h" />
<ClInclude Include="..\include\named\tkeyconf.h" />
<ClInclude Include="..\include\named\transportconf.h" />
<ClInclude Include="..\include\named\tsigconf.h" />
<ClInclude Include="..\include\named\types.h" />
<ClInclude Include="..\xsl_p.h" />
+138 -29
View File
@@ -29,6 +29,7 @@
#include <dns/log.h>
#include <dns/masterdump.h>
#include <dns/name.h>
#include <dns/nsec3.h>
#include <dns/rdata.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
@@ -175,7 +176,7 @@ configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
parse_acl:
result = cfg_acl_fromconfig(aclobj, config, named_g_lctx, actx,
dns_zone_getmctx(zone), 0, &acl);
named_g_mctx, 0, &acl);
if (result != ISC_R_SUCCESS) {
return (result);
}
@@ -912,6 +913,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
bool check = false, fail = false;
bool warn = false, ignore = false;
bool ixfrdiff;
bool use_kasp = false;
dns_masterformat_t masterformat;
const dns_master_style_t *masterstyle = &dns_master_style_default;
isc_stats_t *zoneqrystats;
@@ -1247,19 +1249,15 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
result = named_config_get(maps, "dnssec-policy", &obj);
if (result == ISC_R_SUCCESS) {
kaspname = cfg_obj_asstring(obj);
if (strcmp(kaspname, "none") != 0) {
result = dns_kasplist_find(kasplist, kaspname,
&kasp);
if (result != ISC_R_SUCCESS) {
cfg_obj_log(obj, named_g_lctx,
ISC_LOG_ERROR,
"'dnssec-policy '%s' not "
"found ",
kaspname);
RETERR(result);
}
dns_zone_setkasp(zone, kasp);
result = dns_kasplist_find(kasplist, kaspname, &kasp);
if (result != ISC_R_SUCCESS) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_ERROR,
"'dnssec-policy '%s' not found ",
kaspname);
RETERR(result);
}
dns_zone_setkasp(zone, kasp);
use_kasp = dns_zone_use_kasp(zone);
}
obj = NULL;
@@ -1304,13 +1302,14 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
RETERR(named_config_getipandkeylist(config, obj, mctx,
&ipkl));
result = dns_zone_setalsonotifydscpkeys(
zone, ipkl.addrs, ipkl.dscps, ipkl.keys,
ipkl.count);
result = dns_zone_setalsonotify(zone, ipkl.addrs,
ipkl.dscps, ipkl.keys,
ipkl.tlss, ipkl.count);
dns_ipkeylist_clear(mctx, &ipkl);
RETERR(result);
} else {
RETERR(dns_zone_setalsonotify(zone, NULL, 0));
RETERR(dns_zone_setalsonotify(zone, NULL, NULL, NULL,
NULL, 0));
}
obj = NULL;
@@ -1560,7 +1559,21 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
bool allow = false, maint = false;
bool sigvalinsecs;
if (kasp) {
if (use_kasp) {
if (dns_kasp_nsec3(kasp)) {
result = dns_zone_setnsec3param(
zone, 1, dns_kasp_nsec3flags(kasp),
dns_kasp_nsec3iter(kasp),
dns_kasp_nsec3saltlen(kasp), NULL, true,
false);
} else {
result = dns_zone_setnsec3param(
zone, 0, 0, 0, 0, NULL, true, false);
}
INSIST(result == ISC_R_SUCCESS);
}
if (use_kasp) {
seconds = (uint32_t)dns_kasp_sigvalidity_dnskey(kasp);
} else {
obj = NULL;
@@ -1571,7 +1584,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
dns_zone_setkeyvalidityinterval(zone, seconds);
if (kasp) {
if (use_kasp) {
seconds = (uint32_t)dns_kasp_sigvalidity(kasp);
dns_zone_setsigvalidityinterval(zone, seconds);
seconds = (uint32_t)dns_kasp_sigrefresh(kasp);
@@ -1658,7 +1671,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
obj = NULL;
result = cfg_map_get(zoptions, "auto-dnssec", &obj);
if (dns_zone_getkasp(zone) != NULL) {
if (kasp != NULL && strcmp(dns_kasp_getname(kasp), "none") != 0)
{
dns_zone_setkeyopt(zone, DNS_ZONEKEY_ALLOW, true);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_CREATE, true);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_MAINTAIN, true);
@@ -1677,6 +1691,11 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setkeyopt(zone, DNS_ZONEKEY_ALLOW, allow);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_CREATE, false);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_MAINTAIN, maint);
} else {
bool s2i = dns_zone_secure_to_insecure(zone, false);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_ALLOW, s2i);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_CREATE, false);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_MAINTAIN, s2i);
}
}
@@ -1892,13 +1911,15 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
RETERR(named_config_getipandkeylist(config, obj, mctx,
&ipkl));
result = dns_zone_setprimarieswithkeys(
mayberaw, ipkl.addrs, ipkl.keys, ipkl.count);
result = dns_zone_setprimaries(mayberaw, ipkl.addrs,
ipkl.keys, ipkl.tlss,
ipkl.count);
count = ipkl.count;
dns_ipkeylist_clear(mctx, &ipkl);
RETERR(result);
} else {
result = dns_zone_setprimaries(mayberaw, NULL, 0);
result = dns_zone_setprimaries(mayberaw, NULL, NULL,
NULL, 0);
}
RETERR(result);
@@ -2049,13 +2070,15 @@ named_zone_configure_writeable_dlz(dns_dlzdb_t *dlzdatabase, dns_zone_t *zone,
}
bool
named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, const cfg_obj_t *config,
cfg_aclconfctx_t *actx) {
const cfg_obj_t *zoptions = NULL;
const cfg_obj_t *obj = NULL;
const char *cfilename;
const char *zfilename;
dns_zone_t *raw = NULL;
bool has_raw;
bool has_raw, inline_signing;
dns_zonetype_t ztype;
zoptions = cfg_tuple_get(zconfig, "options");
@@ -2083,13 +2106,13 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
has_raw = false;
}
obj = NULL;
(void)cfg_map_get(zoptions, "inline-signing", &obj);
if ((obj == NULL || !cfg_obj_asboolean(obj)) && has_raw) {
inline_signing = named_zone_inlinesigning(zone, zconfig, vconfig,
config, actx);
if (!inline_signing && has_raw) {
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"not reusable: old zone was inline-signing");
return (false);
} else if ((obj != NULL && cfg_obj_asboolean(obj)) && !has_raw) {
} else if (inline_signing && !has_raw) {
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"not reusable: old zone was not inline-signing");
return (false);
@@ -2119,3 +2142,89 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
return (true);
}
bool
named_zone_inlinesigning(dns_zone_t *zone, const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, const cfg_obj_t *config,
cfg_aclconfctx_t *actx) {
isc_result_t res;
const cfg_obj_t *zoptions = NULL;
const cfg_obj_t *voptions = NULL;
const cfg_obj_t *options = NULL;
const cfg_obj_t *signing = NULL;
const cfg_obj_t *allowupdate = NULL;
const cfg_obj_t *updatepolicy = NULL;
bool zone_is_dynamic = false;
bool inline_signing = false;
(void)cfg_map_get(config, "options", &options);
zoptions = cfg_tuple_get(zconfig, "options");
if (vconfig != NULL) {
voptions = cfg_tuple_get(vconfig, "options");
}
inline_signing = (cfg_map_get(zoptions, "inline-signing", &signing) ==
ISC_R_SUCCESS &&
cfg_obj_asboolean(signing));
if (inline_signing) {
return (true);
}
if (cfg_map_get(zoptions, "update-policy", &updatepolicy) ==
ISC_R_SUCCESS) {
zone_is_dynamic = true;
} else {
res = cfg_map_get(zoptions, "allow-update", &allowupdate);
if (res != ISC_R_SUCCESS && voptions != NULL) {
res = cfg_map_get(voptions, "allow-update",
&allowupdate);
}
if (res != ISC_R_SUCCESS && options != NULL) {
res = cfg_map_get(options, "allow-update",
&allowupdate);
}
if (res == ISC_R_SUCCESS) {
dns_acl_t *acl = NULL;
res = cfg_acl_fromconfig(
allowupdate, config, named_g_lctx, actx,
dns_zone_getmctx(zone), 0, &acl);
if (res == ISC_R_SUCCESS && acl != NULL &&
!dns_acl_isnone(acl)) {
zone_is_dynamic = true;
}
if (acl != NULL) {
dns_acl_detach(&acl);
}
}
}
/*
* If inline-signing is not set, perhaps implictly through a
* dnssec-policy. Since automated DNSSEC maintenance requires
* a dynamic zone, or inline-siging to be enabled, check if
* the zone with dnssec-policy allows updates. If not, enable
* inline-signing.
*/
signing = NULL;
if (!inline_signing && !zone_is_dynamic &&
cfg_map_get(zoptions, "dnssec-policy", &signing) == ISC_R_SUCCESS &&
signing != NULL)
{
if (strcmp(cfg_obj_asstring(signing), "none") != 0) {
inline_signing = true;
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"inline-signing: "
"implicitly through dnssec-policy");
} else {
inline_signing = dns_zone_secure_to_insecure(zone,
true);
dns_zone_log(
zone, ISC_LOG_DEBUG(1), "inline-signing: %s",
inline_signing ? "transitioning to insecure"
: "no");
}
}
return (inline_signing);
}
+3 -1
View File
@@ -1,5 +1,4 @@
.libs
headerdep_test.sh
nxtify
sdig
*_test
@@ -9,3 +8,6 @@ dlopen
keycreate
keydelete
gssapi_krb
/wire_test
/test_client
/test_server
+23 -3
View File
@@ -2,13 +2,33 @@ include $(top_srcdir)/Makefile.top
SUBDIRS = system
noinst_PROGRAMS = wire_test
noinst_PROGRAMS = \
test_client \
test_server \
wire_test
AM_CPPFLAGS += \
test_client_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(LIBISC_CFLAGS)
test_client_LDADD = \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS)
test_server_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(LIBISC_CFLAGS)
test_server_LDADD = \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS)
wire_test_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS)
LDADD = \
wire_test_LDADD = \
$(LIBISC_LIBS) \
$(LIBDNS_LIBS)
-49
View File
@@ -1,49 +0,0 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
#
# Check the installed bind9 headers to make sure that no header
# depends on another header having been included first.
#
prefix=@prefix@
tmp=/tmp/thdr$$.tmp
status=0
echo "Checking for header interdependencies..."
# Make a list of header files.
(cd $prefix/include; find . -name '*.h' -print | sed 's!^./!!') > $tmp
# Check each header.
while read h
do
echo " - <$h>"
# Build a test program.
cat <<EOF >test.c
#include <$h>
EOF
# Compile the test program.
if
gcc @STD_CWARNINGS@ @STD_CINCLUDES@ -I$prefix/include -c test.c 2>&1
then
:
else
status=1
fi
done <$tmp
rm -f test.c test.o $tmp
exit $status
-8
View File
@@ -26,9 +26,6 @@
// watch out for ";" -- it's important!
options {
additional-from-auth true;
additional-from-cache false;
version "my version string";
random-device "/dev/random";
directory "/tmp";
@@ -265,8 +262,6 @@ view "test-view" in {
sig-validity-interval 45;
max-cache-size 100000;
allow-query { 10.0.0.30;};
additional-from-cache false;
additional-from-auth no;
match-clients { 10.0.0.1 ; };
check-names master warn;
check-names slave ignore;
@@ -418,9 +413,6 @@ server 1.2.3.4 {
keys { "sample_key" }; // for TSIG; supported by the parser
// but not yet implemented in the
// rest of the server
# Now called 'request-ixfr'
# support-ixfr yes; // for IXFR supported by server
// if yes, the listed server talks IXFR
};
logging {
+6 -3
View File
@@ -9,7 +9,7 @@ dist-hook:
sed -n "s|^Would remove \(.*\)|$(distdir)/\1|p" | \
xargs -I{} rm -rf "{}"
SUBDIRS = dyndb/driver dlzexternal/driver
SUBDIRS = dyndb/driver dlzexternal/driver hooks/driver
AM_CPPFLAGS += \
$(LIBISC_CFLAGS)
@@ -90,7 +90,7 @@ TESTS += \
checkconf \
checknames \
checkzone \
cookie \
cpu \
database \
dlz \
dlzexternal \
@@ -109,6 +109,7 @@ TESTS += \
include-multiplecfg \
inline \
integrity \
hooks \
keepalive \
legacy \
limits \
@@ -120,6 +121,7 @@ TESTS += \
mkeys \
names \
notify \
nsec3 \
nslookup \
padding \
pending \
@@ -149,6 +151,7 @@ TESTS += \
views \
wildcard \
xferquota \
xot \
zonechecks
# eddsa test is broken
@@ -200,7 +203,7 @@ if HAVE_PYTHON
TESTS += kasp tcp pipelined
if HAVE_PYMOD_DNS
TESTS += qmin
TESTS += qmin cookie
if HAVE_PERLMOD_NET_DNS
TESTS += dnssec
+1
View File
@@ -20,3 +20,4 @@ ns A 10.53.0.1
www CNAME server.example.net.
inzone CNAME a.example.com.
a A 10.53.0.1
dname DNAME @
+52 -4
View File
@@ -70,7 +70,7 @@ grep "server.example.net.*A.*10.53.0.100" dig.out.test$n > /dev/null && ret=1
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that cross-zone CNAME records returns target data (rd=1/ra=1) ($n)"
echo_i "check that cross-zone CNAME records return target data (rd=1/ra=1) ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.2 www.example.com > dig.out.test$n || ret=1
grep "ANSWER: 2," dig.out.test$n > /dev/null || ret=1
@@ -84,7 +84,7 @@ status=`expr $status + $ret`
# In-zone CNAME records should always be followed regardless of RD and RA.
#
n=`expr $n + 1`
echo_i "check that in-zone CNAME records returns target data (rd=0/ra=0) ($n)"
echo_i "check that in-zone CNAME records return target data (rd=0/ra=0) ($n)"
ret=0
$DIG $DIGOPTS +norec @10.53.0.1 inzone.example.com > dig.out.test$n || ret=1
grep "ANSWER: 2," dig.out.test$n > /dev/null || ret=1
@@ -106,7 +106,7 @@ grep "a.example.com.*A.*10.53.0.1" dig.out.test$n > /dev/null || ret=1
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that in-zone CNAME records returns target data (rd=0/ra=1) ($n)"
echo_i "check that in-zone CNAME records return target data (rd=0/ra=1) ($n)"
ret=0
$DIG $DIGOPTS +norec @10.53.0.2 inzone.example.com > dig.out.test$n || ret=1
grep "ANSWER: 2," dig.out.test$n > /dev/null || ret=1
@@ -117,7 +117,7 @@ grep "a.example.com.*A.*10.53.0.1" dig.out.test$n > /dev/null || ret=1
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that in-zone CNAME records returns target data (rd=1/ra=1) ($n)"
echo_i "check that in-zone CNAME records return target data (rd=1/ra=1) ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.2 inzone.example.com > dig.out.test$n || ret=1
grep "ANSWER: 2," dig.out.test$n > /dev/null || ret=1
@@ -127,6 +127,54 @@ grep "a.example.com.*A.*10.53.0.1" dig.out.test$n > /dev/null || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that in-zone CNAME records does not return target data when QTYPE is CNAME (rd=1/ra=1) ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.2 -t cname inzone.example.com > dig.out.test$n || ret=1
grep 'ANSWER: 1,' dig.out.test$n > /dev/null || ret=1
grep 'flags: qr aa rd ra;' dig.out.test$n > /dev/null || ret=1
grep 'inzone\.example\.com\..*CNAME.a\.example\.com\.' dig.out.test$n > /dev/null || ret=1
grep 'a\.example\.com\..*A.10\.53\.0\.1' dig.out.test$n > /dev/null && ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that in-zone CNAME records does not return target data when QTYPE is ANY (rd=1/ra=1) ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.2 -t any inzone.example.com > dig.out.test$n || ret=1
grep 'ANSWER: 1,' dig.out.test$n > /dev/null || ret=1
grep 'flags: qr aa rd ra;' dig.out.test$n > /dev/null || ret=1
grep 'inzone\.example\.com\..*CNAME.a\.example\.com\.' dig.out.test$n > /dev/null || ret=1
grep 'a\.example\.com\..*A.10\.53\.0\.1' dig.out.test$n > /dev/null && ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that in-zone DNAME records does not return target data when QTYPE is CNAME (rd=1/ra=1) ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.2 -t cname inzone.dname.example.com > dig.out.test$n || ret=1
grep 'ANSWER: 2,' dig.out.test$n > /dev/null || ret=1
grep 'flags: qr aa rd ra;' dig.out.test$n > /dev/null || ret=1
grep 'dname\.example\.com\..*DNAME.example\.com\.' dig.out.test$n > /dev/null || ret=1
grep 'inzone\.dname\.example\.com\..*CNAME.inzone\.example\.com\.' dig.out.test$n > /dev/null || ret=1
grep 'inzone\.example\.com\..*CNAME.a\.example\.com\.' dig.out.test$n > /dev/null && ret=1
grep 'a\.example\.com\..*A.10\.53\.0\.1' dig.out.test$n > /dev/null && ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that in-zone DNAME records does not return target data when QTYPE is ANY (rd=1/ra=1) ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.2 -t any inzone.dname.example.com > dig.out.test$n || ret=1
grep 'ANSWER: 2,' dig.out.test$n > /dev/null || ret=1
grep 'flags: qr aa rd ra;' dig.out.test$n > /dev/null || ret=1
grep 'dname\.example\.com\..*DNAME.example\.com\.' dig.out.test$n > /dev/null || ret=1
grep 'inzone\.dname\.example\.com\..*CNAME.inzone\.example\.com\.' dig.out.test$n > /dev/null || ret=1
grep 'inzone\.example\.com.*CNAME.a\.example\.com\.' dig.out.test$n > /dev/null && ret=1
grep 'a\.example\.com.*A.10\.53\.0\.1' dig.out.test$n > /dev/null && ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that CHAOS addresses are compared correctly ($n)"
ret=0
+13 -2
View File
@@ -9,6 +9,17 @@
* information regarding copyright ownership.
*/
options {
dnssec-enable no;
view view1 {
match-clients { any; };
dnssec-validation yes;
};
view view2 {
match-clients { none; };
dnssec-validation auto;
};
view view3 {
match-clients { none; };
auto-dnssec maintain;
};
+10 -3
View File
@@ -11,15 +11,22 @@
view view1 {
match-clients { any; };
dnssec-validation yes;
};
view view2 {
match-clients { none; };
dnssec-validation auto;
};
view view3 {
match-clients { none; };
auto-dnssec maintain;
dnssec-validation auto;
};
view view4 {
match-clients { none; };
};
view view5 {
match-clients { none; };
auto-dnssec off;
};
-32
View File
@@ -1,32 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
view view1 {
match-clients { any; };
};
view view2 {
match-clients { none; };
};
view view3 {
match-clients { none; };
dnssec-validation auto;
};
view view4 {
match-clients { none; };
};
view view5 {
match-clients { none; };
auto-dnssec off;
};
@@ -0,0 +1,27 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
tls local-tls {
key-file "key.pem";
cert-file "cert.pem";
};
http local-http-server {
endpoints { "/dns-query"; };
};
options {
listen-on { 10.53.0.1; };
http-port 80;
https-port 443;
listen-on port 443 tls local-tls http local-http-server { 10.53.0.1; };
listen-on port 8080 http local-http-server { 10.53.0.1; };
};
@@ -9,6 +9,11 @@
* information regarding copyright ownership.
*/
tls local-tls {
key-file "key.pem";
cert-file "cert.pem";
};
options {
dnssec-lookaside . trust-anchor dlv.example.com;
listen-on port 853 tls local-tls { 10.53.0.1; };
};
@@ -22,6 +22,7 @@ dnssec-policy "test" {
csk key-directory lifetime unlimited algorithm rsasha256 2048;
};
max-zone-ttl 86400;
nsec3param iterations 5 optout no salt-length 8;
parent-ds-ttl 7200;
parent-propagation-delay PT1H;
publish-safety PT3600S;
+1
View File
@@ -22,6 +22,7 @@ dnssec-policy "test" {
csk key-directory lifetime P30D algorithm 8 2048;
};
max-zone-ttl 86400;
nsec3param ;
parent-ds-ttl 7200;
parent-propagation-delay PT1H;
publish-safety PT3600S;
@@ -9,6 +9,14 @@
* information regarding copyright ownership.
*/
options {
dnssec-lookaside auto;
dnssec-policy "bad-keylen" {
keys {
csk lifetime P10Y algorithm rsasha1 511;
};
};
zone "example.net" {
type master;
file "example.db";
dnssec-policy "badkeylen";
};
@@ -0,0 +1,24 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
dnssec-policy "bad-salt" {
keys {
csk lifetime unlimited algorithm rsasha1;
};
nsec3param ;
};
zone "example.net" {
type master;
file "example.db";
dnssec-policy "bad-salt";
};
@@ -0,0 +1,58 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
dnssec-policy "rsasha1" {
keys {
csk lifetime P10Y algorithm nsec3rsasha1 1024;
};
nsec3param iterations 150;
};
dnssec-policy "rsasha1-bad" {
keys {
csk lifetime P10Y algorithm nsec3rsasha1 1024;
};
nsec3param iterations 151;
};
dnssec-policy "rsasha256" {
keys {
csk lifetime P10Y algorithm rsasha256 2048;
};
nsec3param iterations 500;
};
dnssec-policy "rsasha256-bad" {
keys {
csk lifetime P10Y algorithm rsasha256 2048;
};
nsec3param iterations 501;
};
dnssec-policy "rsasha512" {
keys {
csk lifetime P10Y algorithm rsasha512 4096;
};
nsec3param iterations 2500;
};
dnssec-policy "rsasha512-bad" {
keys {
csk lifetime P10Y algorithm rsasha512 4096;
};
nsec3param iterations 2501;
};
zone "example.net" {
type master;
file "example.db";
dnssec-policy "default";
};
@@ -9,6 +9,13 @@
* information regarding copyright ownership.
*/
options {
dnssec-lookaside . trust-anchor dlv.isc.org;
dnssec-policy "bad-salt" {
nsec3param salt "pepper";
};
zone "example.net" {
type master;
file "example.db";
dnssec-policy "bad-salt";
};
+51 -41
View File
@@ -78,6 +78,24 @@ do
status=`expr $status + $ret`
done
for lmdb in lmdb-*.conf
do
n=`expr $n + 1`
ret=0
$FEATURETEST --with-lmdb
if [ $? -eq 0 ]; then
echo_i "checking that named-checkconf detects no error in $lmdb ($n)"
$CHECKCONF $lmdb > checkconf.out$n 2>&1
if [ $? != 0 ]; then echo_i "failed"; ret=1; fi
else
echo_i "checking that named-checkconf detects error in $lmdb ($n)"
$CHECKCONF $lmdb > checkconf.out$n 2>&1
if [ $? == 0 ]; then echo_i "failed"; ret=1; fi
fi
status=`expr $status + $ret`
done
n=`expr $n + 1`
echo_i "checking that ancient options report a fatal error ($n)"
ret=0
@@ -113,14 +131,11 @@ status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking named-checkconf dnssec warnings ($n)"
ret=0
# dnssec.1: dnssec-enable is obsolete
$CHECKCONF dnssec.1 > checkconf.out$n.1 2>&1
grep "'dnssec-enable' is obsolete and should be removed" < checkconf.out$n.1 > /dev/null || ret=1
# dnssec.2: auto-dnssec warning
$CHECKCONF dnssec.2 > checkconf.out$n.2 2>&1
# dnssec.1: auto-dnssec warning
$CHECKCONF dnssec.1 > checkconf.out$n.2 2>&1
grep 'auto-dnssec may only be ' < checkconf.out$n.2 > /dev/null || ret=1
# dnssec.3: should have no warnings
$CHECKCONF dnssec.3 > checkconf.out$n.3 2>&1
# dnssec.2: should have no warnings
$CHECKCONF dnssec.2 > checkconf.out$n.3 2>&1
grep '.*' < checkconf.out$n.3 > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -403,30 +418,6 @@ diff good.zonelist checkconf.out$n > diff.out$n || ret=1
if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that 'dnssec-lookaside auto;' generates a warning ($n)"
ret=0
$CHECKCONF warn-dlv-auto.conf > checkconf.out$n 2>/dev/null || ret=1
grep "option 'dnssec-lookaside' is obsolete and should be removed" < checkconf.out$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that 'dnssec-lookaside . trust-anchor dlv.isc.org;' generates a warning ($n)"
ret=0
$CHECKCONF warn-dlv-dlv.isc.org.conf > checkconf.out$n 2>/dev/null || ret=1
grep "option 'dnssec-lookaside' is obsolete and should be removed" < checkconf.out$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that 'dnssec-lookaside . trust-anchor dlv.example.com;' generates a warning ($n)"
ret=0
$CHECKCONF warn-dlv-dlv.example.com.conf > checkconf.out$n 2>/dev/null || ret=1
grep "option 'dnssec-lookaside' is obsolete and should be removed" < checkconf.out$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that the 2010 ICANN ROOT KSK without the 2017 ICANN ROOT KSK generates a warning ($n)"
ret=0
@@ -484,15 +475,6 @@ grep "use of managed-keys is not allowed" checkconf.out$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that 'geoip-use-ecs no' generates a warning ($n)"
ret=0
$CHECKCONF warn-geoip-use-ecs.conf > checkconf.out$n 2>/dev/null || ret=1
[ -s checkconf.out$n ] || ret=1
grep "'geoip-use-ecs' is obsolete" < checkconf.out$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking named-checkconf kasp errors ($n)"
ret=0
@@ -509,7 +491,35 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking named-checkconf kasp predefined key lengths ($n)"
echo_i "checking named-checkconf kasp nsec3 iterations errors ($n)"
ret=0
$CHECKCONF kasp-bad-nsec3-iter.conf > checkconf.out$n 2>&1 && ret=1
grep "dnssec-policy: nsec3 iterations value 151 out of range" < checkconf.out$n > /dev/null || ret=1
grep "dnssec-policy: nsec3 iterations value 501 out of range" < checkconf.out$n > /dev/null || ret=1
grep "dnssec-policy: nsec3 iterations value 2501 out of range" < checkconf.out$n > /dev/null || ret=1
lines=$(wc -l < "checkconf.out$n")
if [ $lines != 3 ]; then ret=1; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking named-checkconf kasp nsec3 algorithm errors ($n)"
ret=0
$CHECKCONF kasp-bad-nsec3-alg.conf > checkconf.out$n 2>&1 && ret=1
grep "dnssec-policy: cannot use nsec3 with algorithm 'RSASHA1'" < checkconf.out$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking named-checkconf kasp key errors ($n)"
ret=0
$CHECKCONF kasp-bad-keylen.conf > checkconf.out$n 2>&1 && ret=1
grep "dnssec-policy: key with algorithm rsasha1 has invalid key length 511" < checkconf.out$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "checking named-checkconf kasp predefined key length ($n)"
ret=0
$CHECKCONF kasp-ignore-keylen.conf > checkconf.out$n 2>&1 || ret=1
grep "dnssec-policy: key algorithm ecdsa256 has predefined length; ignoring length value 2048" < checkconf.out$n > /dev/null || ret=1
@@ -1,14 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
options {
geoip-use-ecs no;
};
+3 -2
View File
@@ -66,7 +66,6 @@ cds
checkconf
checknames
checkzone
cookie
database
digdelv
dlz
@@ -88,7 +87,6 @@ inline
integrity
ixfr
keepalive
legacy
limits
masterfile
masterformat
@@ -97,6 +95,7 @@ mirror
mkeys
names
notify
nsec3
nslookup
nsupdate
padding
@@ -669,6 +668,8 @@ copy_setports() {
atsign="@"
sed -e "s/${atsign}PORT${atsign}/${PORT}/g" \
-e "s/${atsign}TLSPORT${atsign}/${TLSPORT}/g" \
-e "s/${atsign}HTTPPORT${atsign}/${HTTPSPORT}/g" \
-e "s/${atsign}HTTPSPORT${atsign}/${HTTPSPORT}/g" \
-e "s/${atsign}EXTRAPORT1${atsign}/${EXTRAPORT1}/g" \
-e "s/${atsign}EXTRAPORT2${atsign}/${EXTRAPORT2}/g" \
-e "s/${atsign}EXTRAPORT3${atsign}/${EXTRAPORT3}/g" \
+3 -1
View File
@@ -81,11 +81,13 @@ SEQUENTIALDIRS="$SEQUENTIAL_COMMON $SEQUENTIAL_UNIX"
PARALLEL_UNIX="@DNSTAP@
chain
cookie
dlzexternal
dnssec
dyndb
filter-aaaa
kasp
legacy
logfileconfig
nzd2nzf
pipelined
@@ -122,7 +124,7 @@ PERL=$(command -v "@PERL@")
# Windows process management leave empty
PSSUSPEND=
PYTHON=$(command -v "@PYTHON@")
PYTHON=$(command -v "@PYTHON@" || true)
PYTEST=@PYTEST@
#
+277
View File
@@ -0,0 +1,277 @@
############################################################################
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
############################################################################
from __future__ import print_function
import os
import sys
import signal
import socket
import select
from datetime import datetime, timedelta
import time
import functools
import dns
import dns.edns
import dns.flags
import dns.message
import dns.query
import dns.tsig
import dns.tsigkeyring
import dns.version
from dns.edns import *
from dns.name import *
from dns.rcode import *
from dns.rdataclass import *
from dns.rdatatype import *
from dns.tsig import *
# Log query to file
def logquery(type, qname):
with open("qlog", "a") as f:
f.write("%s %s\n", type, qname)
# DNS 2.0 keyring specifies the algorithm
try:
keyring = dns.tsigkeyring.from_text({ "foo" : {
"hmac-sha256",
"aaaaaaaaaaaa"
} ,
"fake" : {
"hmac-sha256",
"aaaaaaaaaaaa"
}
})
except:
keyring = dns.tsigkeyring.from_text({ "foo" : "aaaaaaaaaaaa",
"fake" : "aaaaaaaaaaaa" })
dopass2 = False
############################################################################
#
# This server will serve valid and spoofed answers. A spoofed answer will
# have the address 10.53.0.10 included.
#
# When receiving a query over UDP:
#
# A query to "nocookie"/A will result in a spoofed answer with no cookie set.
# A query to "tcponly"/A will result in a spoofed answer with no cookie set.
# A query to "withtsig"/A will result in two responses, the first is a spoofed
# answer that is TSIG signed, the second is a valid answer with a cookie set.
# A query to anything else will result in a valid answer with a cookie set.
#
# When receiving a query over TCP:
#
# A query to "nocookie"/A will result in a valid answer with no cookie set.
# A query to anything else will result in a valid answer with a cookie set.
#
############################################################################
def create_response(msg, tcp, first, ns10):
global dopass2
m = dns.message.from_wire(msg, keyring=keyring)
qname = m.question[0].name.to_text()
lqname = qname.lower()
labels = lqname.split('.')
rrtype = m.question[0].rdtype
typename = dns.rdatatype.to_text(rrtype)
with open("query.log", "a") as f:
f.write("%s %s\n" % (typename, qname))
print("%s %s" % (typename, qname), end=" ")
r = dns.message.make_response(m)
r.set_rcode(NOERROR)
if rrtype == A:
# exempt potential nameserver A records.
if labels[0] == "ns" and ns10:
r.answer.append(dns.rrset.from_text(qname, 1, IN, A, "10.53.0.10"))
else:
r.answer.append(dns.rrset.from_text(qname, 1, IN, A, "10.53.0.9"))
if not tcp and labels[0] == "nocookie":
r.answer.append(dns.rrset.from_text(qname, 1, IN, A, "10.53.0.10"))
if not tcp and labels[0] == "tcponly":
r.answer.append(dns.rrset.from_text(qname, 1, IN, A, "10.53.0.10"))
if first and not tcp and labels[0] == "withtsig":
r.answer.append(dns.rrset.from_text(qname, 1, IN, A, "10.53.0.10"))
dopass2 = True
elif rrtype == NS:
r.answer.append(dns.rrset.from_text(qname, 1, IN, NS, "."))
elif rrtype == SOA:
r.answer.append(dns.rrset.from_text(qname, 1, IN, SOA, ". . 0 0 0 0 0"))
else:
r.authority.append(dns.rrset.from_text(qname, 1, IN, SOA, ". . 0 0 0 0 0"))
# Add a server cookie to the response
if labels[0] != "nocookie":
for o in m.options:
if o.otype == 10: # Use 10 instead of COOKIE
if first and labels[0] == "withtsig" and not tcp:
r.use_tsig(keyring = keyring,
keyname = dns.name.from_text("fake"),
algorithm = HMAC_SHA256)
elif labels[0] != "tcponly" or tcp:
cookie = o
if len(o.data) == 8:
cookie.data = o.data + o.data
else:
cookie.data = o.data
r.use_edns(options=[cookie])
r.flags |= dns.flags.AA
return r
def sigterm(signum, frame):
print ("Shutting down now...")
os.remove('ans.pid')
running = False
sys.exit(0)
############################################################################
# Main
#
# Set up responder and control channel, open the pid file, and start
# the main loop, listening for queries on the query channel or commands
# on the control channel and acting on them.
############################################################################
ip4_addr1 = "10.53.0.9"
ip4_addr2 = "10.53.0.10"
ip6_addr1 = "fd92:7065:b8e:ffff::9"
ip6_addr2 = "fd92:7065:b8e:ffff::10"
try: port=int(os.environ['PORT'])
except: port=5300
query4_udp1 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
query4_udp1.bind((ip4_addr1, port))
query4_tcp1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
query4_tcp1.bind((ip4_addr1, port))
query4_tcp1.listen(1)
query4_tcp1.settimeout(1)
query4_udp2 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
query4_udp2.bind((ip4_addr2, port))
query4_tcp2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
query4_tcp2.bind((ip4_addr2, port))
query4_tcp2.listen(1)
query4_tcp2.settimeout(1)
havev6 = True
query6_udp1 = None
query6_udp2 = None
query6_tcp1 = None
query6_tcp2 = None
try:
query6_udp1 = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
query6_udp1.bind((ip6_addr1, port))
query6_tcp1 = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
query6_tcp1.bind((ip6_addr1, port))
query6_tcp1.listen(1)
query6_tcp1.settimeout(1)
query6_udp2 = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
query6_udp2.bind((ip6_addr2, port))
query6_tcp2 = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
query6_tcp2.bind((ip6_addr2, port))
query6_tcp2.listen(1)
query6_tcp2.settimeout(1)
except:
if query6_udp1 != None:
query6_udp1.close()
if query6_tcp1 != None:
query6_tcp1.close()
if query6_udp2 != None:
query6_udp2.close()
if query6_tcp2 != None:
query6_tcp2.close()
havev6 = False
signal.signal(signal.SIGTERM, sigterm)
f = open('ans.pid', 'w')
pid = os.getpid()
print (pid, file=f)
f.close()
running = True
print ("Using DNS version %s" % dns.version.version)
print ("Listening on %s port %d" % (ip4_addr1, port))
print ("Listening on %s port %d" % (ip4_addr2, port))
if havev6:
print ("Listening on %s port %d" % (ip6_addr1, port))
print ("Listening on %s port %d" % (ip6_addr2, port))
print ("Ctrl-c to quit")
if havev6:
input = [query4_udp1, query6_udp1, query4_tcp1, query6_tcp1,
query4_udp2, query6_udp2, query4_tcp2, query6_tcp2]
else:
input = [query4_udp1, query4_tcp1, query4_udp2, query4_tcp2]
while running:
try:
inputready, outputready, exceptready = select.select(input, [], [])
except select.error as e:
break
except socket.error as e:
break
except KeyboardInterrupt:
break
for s in inputready:
ns10 = False
if s == query4_udp1 or s == query6_udp1 or \
s == query4_udp2 or s == query6_udp2:
if s == query4_udp1 or s == query6_udp1:
print ("UDP Query received on %s" %
(ip4_addr1 if s == query4_udp1 else ip6_addr1), end=" ")
if s == query4_udp2 or s == query6_udp2:
print ("UDP Query received on %s" %
(ip4_addr2 if s == query4_udp2 else ip6_addr2), end=" ")
ns10 = True
# Handle incoming queries
msg = s.recvfrom(65535)
dopass2 = False
rsp = create_response(msg[0], False, True, ns10)
print(dns.rcode.to_text(rsp.rcode()))
s.sendto(rsp.to_wire(), msg[1])
if dopass2:
print ("Sending second UDP response without TSIG", end=" ")
rsp = create_response(msg[0], False, False, ns10)
s.sendto(rsp.to_wire(), msg[1])
print(dns.rcode.to_text(rsp.rcode()))
if s == query4_tcp1 or s == query6_tcp1 or \
s == query4_tcp2 or s == query6_tcp2:
try:
(cs, _) = s.accept()
if s == query4_tcp1 or s == query6_tcp1:
print ("TCP Query received on %s" %
(ip4_addr1 if s == query4_tcp1 else ip6_addr1), end=" ")
if s == query4_tcp2 or s == query6_tcp2:
print ("TCP Query received on %s" %
(ip4_addr2 if s == query4_tcp2 else ip6_addr2), end=" ")
ns10 = True
# get TCP message length
buf = cs.recv(2)
length = struct.unpack('>H', buf[:2])[0]
# grep DNS message
msg = cs.recv(length)
rsp = create_response(msg, True, True, ns10)
print(dns.rcode.to_text(rsp.rcode()))
wire = rsp.to_wire()
cs.send(struct.pack('>H', len(wire)))
cs.send(wire)
cs.close()
except s.timeout:
pass
if not running:
break
+3
View File
@@ -9,9 +9,12 @@
rm -f ns*/named.conf
rm -f dig.out.*
rm -f named.run.*
rm -f rndc.out.*
rm -f ns1/named_dump.db*
rm -f ns*/named.memstats
rm -f ns*/named.run
rm -f ns*/named.lock
rm -f ns*/managed-keys.bind*
rm -f ns*/named.run.prev
rm -f ans*/ans.run ans*/ans.log
@@ -14,6 +14,15 @@ key rndc_key {
algorithm hmac-sha256;
};
key foo {
secret "aaaaaaaaaaaa";
algorithm hmac-sha256;
};
server 10.53.0.10 {
keys foo;
};
controls {
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
+4
View File
@@ -20,3 +20,7 @@ large.xxx TXT ( large large large large large large large large
large large large large large large large large
large large large large large large large large
large large large large large large large large )
tld. NS ns.tld.
ns.tld A 10.53.0.9
tsig. NS ns.tsig.
ns.tsig A 10.53.0.10
+206
View File
@@ -302,5 +302,211 @@ grep "status: NOERROR," dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that test server is correctly configured ($n)"
ret=0
pat="; COOKIE: ................................ (good)"
#UDP
$DIG $DIGOPTS @10.53.0.9 +notcp tld > dig.out.test$n.1
grep "status: NOERROR" dig.out.test$n.1 > /dev/null || ret=1
grep "$pat" dig.out.test$n.1 > /dev/null || ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.1 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.1 > /dev/null && ret=1
grep ";; TSIG PSEUDOSECTION:" dig.out.test$n.1 > /dev/null && ret=1
$DIG $DIGOPTS @10.53.0.9 +notcp tcponly.tld > dig.out.test$n.2
grep "status: NOERROR" dig.out.test$n.2 > /dev/null || ret=1
grep "; COOKIE:" dig.out.test$n.2 > /dev/null && ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.2 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.2 > /dev/null || ret=1
grep ";; TSIG PSEUDOSECTION:" dig.out.test$n.1 > /dev/null && ret=1
$DIG $DIGOPTS @10.53.0.9 +notcp nocookie.tld > dig.out.test$n.3
grep "status: NOERROR" dig.out.test$n.3 > /dev/null || ret=1
grep "; COOKIE:" dig.out.test$n.3 > /dev/null && ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.3 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.3 > /dev/null || ret=1
grep ";; TSIG PSEUDOSECTION:" dig.out.test$n.1 > /dev/null && ret=1
$DIG $DIGOPTS @10.53.0.9 +notcp withtsig.tld > dig.out.test$n.4
grep "status: NOERROR" dig.out.test$n.4 > /dev/null || ret=1
grep "; COOKIE:" dig.out.test$n.4 > /dev/null && ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.4 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.4 > /dev/null || ret=1
grep ";; TSIG PSEUDOSECTION:" dig.out.test$n.4 > /dev/null || ret=1
#TCP
$DIG $DIGOPTS @10.53.0.9 +tcp tld > dig.out.test$n.5
grep "status: NOERROR" dig.out.test$n.5 > /dev/null || ret=1
grep "$pat" dig.out.test$n.5 > /dev/null || ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.5 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.5 > /dev/null && ret=1
grep ";; TSIG PSEUDOSECTION:" dig.out.test$n.1 > /dev/null && ret=1
$DIG $DIGOPTS @10.53.0.9 +tcp tcponly.tld > dig.out.test$n.6
grep "status: NOERROR" dig.out.test$n.6 > /dev/null || ret=1
grep "$pat" dig.out.test$n.6 > /dev/null || ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.6 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.6 > /dev/null && ret=1
grep ";; TSIG PSEUDOSECTION:" dig.out.test$n.1 > /dev/null && ret=1
$DIG $DIGOPTS @10.53.0.9 +tcp nocookie.tld > dig.out.test$n.7
grep "status: NOERROR" dig.out.test$n.7 > /dev/null || ret=1
grep "; COOKIE:" dig.out.test$n.7 > /dev/null && ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.7 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.7 > /dev/null && ret=1
grep ";; TSIG PSEUDOSECTION:" dig.out.test$n.1 > /dev/null && ret=1
$DIG $DIGOPTS @10.53.0.9 +tcp withtsig.tld > dig.out.test$n.8
grep "status: NOERROR" dig.out.test$n.8 > /dev/null || ret=1
grep "$pat" dig.out.test$n.8 > /dev/null || ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.8 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.8 > /dev/null && ret=1
grep ";; TSIG PSEUDOSECTION:" dig.out.test$n.8 > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that spoofed response is dropped when we have a server cookie ($n)"
ret=0
msg="missing expected cookie from"
pat='10\.53\.0\.9 .*\[cookie=................................\] \[ttl'
# prime EDNS COOKIE state
$DIG $DIGOPTS @10.53.0.1 tld > dig.out.test$n.1
grep "status: NOERROR" dig.out.test$n.1 > /dev/null || ret=1
rndc_dumpdb ns1
grep "$pat" ns1/named_dump.db.test$n > /dev/null || ret=1
# spoofed response contains 10.53.0.10
nextpart ns1/named.run >/dev/null
$DIG $DIGOPTS @10.53.0.1 tcponly.tld > dig.out.test$n.2
wait_for_log 5 "$msg" ns1/named.run || ret=1
grep "status: NOERROR" dig.out.test$n.2 > /dev/null || ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.2 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.2 > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that gracefully handle server disabling DNS COOKIE we have a server cookie ($n)"
ret=0
msg="missing expected cookie from"
pat='10\.53\.0\.9 .*\[cookie=................................\] \[ttl'
# prime EDNS COOKIE state
$DIG $DIGOPTS @10.53.0.1 tld > dig.out.test$n.1
grep "status: NOERROR" dig.out.test$n.1 > /dev/null || ret=1
rndc_dumpdb ns1
grep "$pat" ns1/named_dump.db.test$n > /dev/null || ret=1
# check the disabled server response
nextpart ns1/named.run >/dev/null
$DIG $DIGOPTS @10.53.0.1 nocookie.tld > dig.out.test$n.2
wait_for_log 5 "$msg" ns1/named.run || ret=1
grep "status: NOERROR" dig.out.test$n.2 > /dev/null || ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.2 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.2 > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that spoofed response with a TSIG is dropped when we have a server cookie ($n)"
ret=0
pat='10\.53\.0\.9 .*\[cookie=................................\] \[ttl'
# prime EDNS COOKIE state
$DIG $DIGOPTS @10.53.0.1 tld > dig.out.test$n.1
grep "status: NOERROR" dig.out.test$n.1 > /dev/null || ret=1
rndc_dumpdb ns1
grep "$pat" ns1/named_dump.db.test$n > /dev/null || ret=1
# spoofed response contains 10.53.0.10
nextpart ns1/named.run >/dev/null
$DIG $DIGOPTS @10.53.0.1 withtsig.tld > dig.out.test$n.2
grep "status: NOERROR" dig.out.test$n.2 > /dev/null || ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.2 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.2 > /dev/null && ret=1
nextpart ns1/named.run > named.run.test$n
count=$(grep -c ') [0-9][0-9]* NOERROR 0' named.run.test$n)
test $count -eq 1 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
if $PYTHON -c '
import dns.version, sys;
if dns.version.MAJOR > 1: sys.exit(0);
if dns.version.MAJOR == 1 and dns.version.MINOR >= 16: sys.exit(0);
sys.exit(1)'
then
n=`expr $n + 1`
echo_i "check that TSIG test server is correctly configured ($n)"
ret=0
pat="; COOKIE: ................................ (good)"
key=hmac-sha256:foo:aaaaaaaaaaaa
#UDP
$DIG $DIGOPTS @10.53.0.10 -y $key +notcp tsig. > dig.out.test$n.1
grep "status: NOERROR" dig.out.test$n.1 > /dev/null || ret=1
grep "$pat" dig.out.test$n.1 > /dev/null || ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.1 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.1 > /dev/null && ret=1
grep 'TSIG.*NOERROR' dig.out.test$n.1 > /dev/null || ret=1
$DIG $DIGOPTS @10.53.0.10 -y $key +notcp tcponly.tsig > dig.out.test$n.2
grep "status: NOERROR" dig.out.test$n.2 > /dev/null || ret=1
grep "; COOKIE:" dig.out.test$n.2 > /dev/null && ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.2 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.2 > /dev/null || ret=1
grep 'TSIG.*NOERROR' dig.out.test$n.1 > /dev/null || ret=1
$DIG $DIGOPTS @10.53.0.10 -y $key +notcp nocookie.tsig > dig.out.test$n.3
grep "status: NOERROR" dig.out.test$n.3 > /dev/null || ret=1
grep "; COOKIE:" dig.out.test$n.3 > /dev/null && ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.3 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.3 > /dev/null || ret=1
grep 'TSIG.*NOERROR' dig.out.test$n.1 > /dev/null || ret=1
#TCP
$DIG $DIGOPTS @10.53.0.10 -y $key +tcp tsig. > dig.out.test$n.5
grep "status: NOERROR" dig.out.test$n.5 > /dev/null || ret=1
grep "$pat" dig.out.test$n.5 > /dev/null || ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.5 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.5 > /dev/null && ret=1
grep 'TSIG.*NOERROR' dig.out.test$n.1 > /dev/null || ret=1
$DIG $DIGOPTS @10.53.0.10 -y $key +tcp tcponly.tsig > dig.out.test$n.6
grep "status: NOERROR" dig.out.test$n.6 > /dev/null || ret=1
grep "$pat" dig.out.test$n.6 > /dev/null || ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.6 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.6 > /dev/null && ret=1
grep 'TSIG.*NOERROR' dig.out.test$n.1 > /dev/null || ret=1
$DIG $DIGOPTS @10.53.0.10 -y $key +tcp nocookie.tsig > dig.out.test$n.7
grep "status: NOERROR" dig.out.test$n.7 > /dev/null || ret=1
grep "; COOKIE:" dig.out.test$n.7 > /dev/null && ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.7 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.7 > /dev/null && ret=1
grep 'TSIG.*NOERROR' dig.out.test$n.1 > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that missing COOKIE with a valid TSIG signed response does not trigger TCP fallback ($n)"
ret=0
pat='10\.53\.0\.10 .*\[cookie=................................\] \[ttl'
# prime EDNS COOKIE state
$DIG $DIGOPTS @10.53.0.1 tsig. > dig.out.test$n.1
grep "status: NOERROR" dig.out.test$n.1 > /dev/null || ret=1
rndc_dumpdb ns1
grep "$pat" ns1/named_dump.db.test$n > /dev/null || ret=1
# check the disabled server response
nextpart ns1/named.run >/dev/null
$DIG $DIGOPTS @10.53.0.1 nocookie.tsig > dig.out.test$n.2
grep "status: NOERROR" dig.out.test$n.2 > /dev/null || ret=1
grep 'A.10\.53\.0\.9' dig.out.test$n.2 > /dev/null || ret=1
grep 'A.10\.53\.0\.10' dig.out.test$n.2 > /dev/null || ret=1
nextpart ns1/named.run > named.run.test$n
count=$(grep -c ') [0-9][0-9]* NOERROR 0' named.run.test$n)
test $count -eq 2 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
fi
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
set -e
rm -f ps.out
rm -f ns1/named.conf ns1/managed-keys.* ns1/named.run ns1/named.memstats
@@ -10,5 +10,9 @@
*/
options {
geoip-use-ecs yes;
query-source address 10.53.0.1;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
};
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh -e
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
set -e
# shellcheck source=conf.sh
. ../conf.sh
case $(uname) in
Linux*)
;;
*)
echo_i "cpu test only runs on Linux"
exit 255
;;
esac
# TASKSET will be an empty string if no taskset program was found.
TASKSET=$(command -v "taskset" || true)
if ! test -x "$TASKSET" ; then
exit 255
fi
if ! $TASKSET fff0 true > /dev/null 2>&1; then
echo_i "taskset failed"
exit 255
fi
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh -e
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# shellcheck source=conf.sh
. ../conf.sh
set -e
$SHELL clean.sh
copy_setports ns1/named.conf.in ns1/named.conf
+46
View File
@@ -0,0 +1,46 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# shellcheck source=conf.sh
. ../conf.sh
status=0
n=0
n=$((n+1))
echo_i "stop server ($n)"
ret=0
$PERL ../stop.pl cpu ns1 || ret=1
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
n=$((n+1))
echo_i "start server with taskset ($n)"
ret=0
start_server --noclean --taskset fff0 --restart --port "${PORT}" cpu ns1 || ret=1
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
n=$((n+1))
echo_i "check ps output ($n)"
ret=0
ps -T -o pid,psr,time,comm -e > ps.out
pid=$(cat ns1/named.pid)
echo_i "pid=$pid"
psr=$(awk -v pid="$pid" '$1 == pid && $4 == "isc-net-0000" {print $2}' < ps.out)
echo_i "psr=$psr"
# The next available cpu relative to the existing affinity mask is 4.
test "$psr" -eq 4 || ret=1
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
@@ -0,0 +1,4 @@
ipv4only.arpa. 3600 IN SOA . . 2018112766 7200 3600 604800 3600
ipv4only.arpa. 3600 IN NS .
ipv4only.arpa. 3600 IN A 192.0.0.170
ipv4only.arpa. 3600 IN A 192.0.0.171
@@ -11,6 +11,12 @@
// NS1
include "../../common/rndc.key";
controls {
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
acl rfc1918 { 10/8; 192.168/16; 172.16/12; };
options {
@@ -49,4 +55,7 @@ zone "signed" {
file "signed.db.signed";
};
// include "trusted.conf";
zone "ipv4only.arpa" {
type master;
file "ipv4only.arpa.db";
};
+64
View File
@@ -0,0 +1,64 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
// NS1
include "../../common/rndc.key";
controls {
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
acl rfc1918 { 10/8; 192.168/16; 172.16/12; };
options {
query-source address 10.53.0.1;
notify-source 10.53.0.1;
transfer-source 10.53.0.1;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
allow-recursion { 10.53.0.1; };
notify yes;
dnssec-validation yes;
dns64 2001:bbbb::/96 {
clients { any; };
mapped { !rfc1918; any; };
exclude { 2001:eeee::/32; 64:FF9B::/96; ::ffff:0000:0000/96; };
suffix ::;
recursive-only yes;
};
dns64 2001:aaaa::/64 {
mapped { !rfc1918; any; };
};
};
zone "." {
type primary;
file "root.db";
};
zone "example" {
type primary;
file "example.db";
};
zone "signed" {
type primary;
file "signed.db.signed";
};
zone "ipv4only.arpa" {
type master;
file "ipv4only.arpa.db";
};
+53
View File
@@ -0,0 +1,53 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
// NS1
include "../../common/rndc.key";
controls {
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
acl rfc1918 { 10/8; 192.168/16; 172.16/12; };
options {
query-source address 10.53.0.1;
notify-source 10.53.0.1;
transfer-source 10.53.0.1;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
allow-recursion { 10.53.0.1; };
notify yes;
dnssec-validation yes;
};
zone "." {
type primary;
file "root.db";
};
zone "example" {
type primary;
file "example.db";
};
zone "signed" {
type primary;
file "signed.db.signed";
};
zone "ipv4only.arpa" {
type master;
file "ipv4only.arpa.db";
};
+1 -1
View File
@@ -11,7 +11,7 @@
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns1/named.conf1.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
cd ns1 && $SHELL sign.sh
+49
View File
@@ -1399,5 +1399,54 @@ n=`expr $n + 1`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking 'dig +dns64prefix' ($n)"
$DIG $DIGOPTS +dns64prefix @10.53.0.1 > dig.out.ns1.test$n || ret=1
grep '^2001:bbbb::/96$' dig.out.ns1.test$n > /dev/null || ret=1
test $(wc -l < dig.out.ns1.test$n) -eq 1 || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
copy_setports ns1/named.conf2.in ns1/named.conf
rndc_reload ns1 10.53.0.1
echo_i "checking 'dig +dns64prefix' with multiple prefixes ($n)"
$DIG $DIGOPTS +dns64prefix @10.53.0.1 > dig.out.ns1.test$n || ret=1
grep '^2001:bbbb::/96$' dig.out.ns1.test$n > /dev/null || ret=1
grep '2001:aaaa::/64' dig.out.ns1.test$n > /dev/null || ret=1
test $(wc -l < dig.out.ns1.test$n) -eq 2 || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
copy_setports ns1/named.conf3.in ns1/named.conf
rndc_reload ns1 10.53.0.1
echo_i "checking 'dig +dns64prefix' with no prefixes ($n)"
$DIG $DIGOPTS +dns64prefix @10.53.0.1 > dig.out.ns1.test$n || ret=1
test $(wc -l < dig.out.ns1.test$n) -eq 0 || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking synthesis of AAAA from builtin ipv4only.arpa ($n)"
ret=0
$DIG $DIGOPTS aaaa ipv4only.arpa -b 10.53.0.7 @10.53.0.2 > dig.out.ns2.test$n || ret=1
grep -i 'ipv4only.arpa.*IN.AAAA.2001:96::c000:aa' dig.out.ns2.test$n >/dev/null || ret=1
grep -i 'ipv4only.arpa.*IN.AAAA.2001:96::c000:ab' dig.out.ns2.test$n >/dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking reverse of dns64 mapped ipv4only.arpa addresses returns ipv4only.arpa ($n)"
ret=0
$DIG $DIGOPTS ptr -x 2001:96::192.0.0.170 -b 10.53.0.7 @10.53.0.2 > dig.out.170.ns2.test$n || ret=1
$DIG $DIGOPTS ptr -x 2001:96::192.0.0.171 -b 10.53.0.7 @10.53.0.2 > dig.out.171.ns2.test$n || ret=1
grep "ip6\.arpa\..*PTR.*ipv4only\.arpa\." dig.out.170.ns2.test$n >/dev/null || ret=1
grep "ip6\.arpa\..*PTR.*ipv4only\.arpa\." dig.out.171.ns2.test$n >/dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
+2
View File
@@ -82,6 +82,8 @@ done
echo "export PORT=$(get_port "$baseport")"
echo "export TLSPORT=$(get_port)"
echo "export HTTPPORT=$(get_port)"
echo "export HTTPSPORT=$(get_port)"
echo "export EXTRAPORT1=$(get_port)"
echo "export EXTRAPORT2=$(get_port)"
echo "export EXTRAPORT3=$(get_port)"
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f */named.run
rm -f */named.conf
rm -f */named.memstats
+13
View File
@@ -0,0 +1,13 @@
include $(top_srcdir)/Makefile.top
AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
$(LIBNS_CFLAGS) \
$(LIBISCCFG_CFLAGS)
hooks_LTLIBRARIES = test-async.la
hooksdir = $(abs_builddir)
test_async_la_SOURCES = test-async.c
test_async_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
+364
View File
@@ -0,0 +1,364 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*! \file */
/* aliases for the exported symbols */
#include <inttypes.h>
#include <stdbool.h>
#include <string.h>
#include <isc/buffer.h>
#include <isc/hash.h>
#include <isc/ht.h>
#include <isc/lib.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/netaddr.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/util.h>
#include <dns/result.h>
#include <ns/client.h>
#include <ns/events.h>
#include <ns/hooks.h>
#include <ns/log.h>
#include <ns/query.h>
#include <ns/types.h>
#define CHECK(op) \
do { \
result = (op); \
if (result != ISC_R_SUCCESS) { \
goto cleanup; \
} \
} while (0)
/*
* Persistent data for use by this module. This will be associated
* with client object address in the hash table, and will remain
* accessible until the client object is detached.
*/
typedef struct async_instance {
ns_plugin_t *module;
isc_mem_t *mctx;
isc_mempool_t *datapool;
isc_ht_t *ht;
isc_mutex_t hlock;
isc_log_t *lctx;
} async_instance_t;
typedef struct state {
bool async;
ns_hook_resevent_t *rev;
ns_hookpoint_t hookpoint;
isc_result_t origresult;
} state_t;
/*
* Forward declarations of functions referenced in install_hooks().
*/
static ns_hookresult_t
async_qctx_initialize(void *arg, void *cbdata, isc_result_t *resp);
static ns_hookresult_t
async_query_done_begin(void *arg, void *cbdata, isc_result_t *resp);
static ns_hookresult_t
async_qctx_destroy(void *arg, void *cbdata, isc_result_t *resp);
/*%
* Register the functions to be called at each hook point in 'hooktable', using
* memory context 'mctx' for allocating copies of stack-allocated structures
* passed to ns_hook_add(). Make sure 'inst' will be passed as the 'cbdata'
* argument to every callback.
*/
static void
install_hooks(ns_hooktable_t *hooktable, isc_mem_t *mctx,
async_instance_t *inst) {
const ns_hook_t async_init = {
.action = async_qctx_initialize,
.action_data = inst,
};
const ns_hook_t async_donebegin = {
.action = async_query_done_begin,
.action_data = inst,
};
const ns_hook_t async_destroy = {
.action = async_qctx_destroy,
.action_data = inst,
};
ns_hook_add(hooktable, mctx, NS_QUERY_QCTX_INITIALIZED, &async_init);
ns_hook_add(hooktable, mctx, NS_QUERY_DONE_BEGIN, &async_donebegin);
ns_hook_add(hooktable, mctx, NS_QUERY_QCTX_DESTROYED, &async_destroy);
}
static void
logmsg(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
isc_log_write(ns_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS,
ISC_LOG_INFO, fmt, ap);
va_end(ap);
}
/**
** Mandatory plugin API functions:
**
** - plugin_destroy
** - plugin_register
** - plugin_version
** - plugin_check
**/
/*
* Called by ns_plugin_register() to initialize the plugin and
* register hook functions into the view hook table.
*/
isc_result_t
plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, isc_log_t *lctx,
void *actx, ns_hooktable_t *hooktable, void **instp) {
async_instance_t *inst = NULL;
isc_result_t result;
UNUSED(parameters);
UNUSED(cfg);
UNUSED(actx);
isc_log_write(lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS,
ISC_LOG_INFO,
"registering 'test-async' module from %s:%lu", cfg_file,
cfg_line);
inst = isc_mem_get(mctx, sizeof(*inst));
*inst = (async_instance_t){ .mctx = NULL };
isc_mem_attach(mctx, &inst->mctx);
isc_mempool_create(mctx, sizeof(state_t), &inst->datapool);
CHECK(isc_ht_init(&inst->ht, mctx, 16));
isc_mutex_init(&inst->hlock);
/*
* Set hook points in the view's hooktable.
*/
install_hooks(hooktable, mctx, inst);
*instp = inst;
return (ISC_R_SUCCESS);
cleanup:
if (result != ISC_R_SUCCESS && inst != NULL) {
plugin_destroy((void **)&inst);
}
return (result);
}
isc_result_t
plugin_check(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, isc_log_t *lctx,
void *actx) {
UNUSED(parameters);
UNUSED(cfg);
UNUSED(cfg_file);
UNUSED(cfg_line);
UNUSED(mctx);
UNUSED(lctx);
UNUSED(actx);
return (ISC_R_SUCCESS);
}
/*
* Called by ns_plugins_free(); frees memory allocated by
* the module when it was registered.
*/
void
plugin_destroy(void **instp) {
async_instance_t *inst = (async_instance_t *)*instp;
if (inst->ht != NULL) {
isc_ht_destroy(&inst->ht);
isc_mutex_destroy(&inst->hlock);
}
if (inst->datapool != NULL) {
isc_mempool_destroy(&inst->datapool);
}
isc_mem_putanddetach(&inst->mctx, inst, sizeof(*inst));
*instp = NULL;
return;
}
/*
* Returns plugin API version for compatibility checks.
*/
int
plugin_version(void) {
return (NS_PLUGIN_VERSION);
}
static state_t *
client_state_get(const query_ctx_t *qctx, async_instance_t *inst) {
state_t *state = NULL;
isc_result_t result;
LOCK(&inst->hlock);
result = isc_ht_find(inst->ht, (const unsigned char *)&qctx->client,
sizeof(qctx->client), (void **)&state);
UNLOCK(&inst->hlock);
return (result == ISC_R_SUCCESS ? state : NULL);
}
static void
client_state_create(const query_ctx_t *qctx, async_instance_t *inst) {
state_t *state = NULL;
isc_result_t result;
state = isc_mempool_get(inst->datapool);
if (state == NULL) {
return;
}
LOCK(&inst->hlock);
result = isc_ht_add(inst->ht, (const unsigned char *)&qctx->client,
sizeof(qctx->client), state);
UNLOCK(&inst->hlock);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
}
static void
client_state_destroy(const query_ctx_t *qctx, async_instance_t *inst) {
state_t *state = client_state_get(qctx, inst);
isc_result_t result;
if (state == NULL) {
return;
}
LOCK(&inst->hlock);
result = isc_ht_delete(inst->ht, (const unsigned char *)&qctx->client,
sizeof(qctx->client));
UNLOCK(&inst->hlock);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
isc_mempool_put(inst->datapool, state);
}
static ns_hookresult_t
async_qctx_initialize(void *arg, void *cbdata, isc_result_t *resp) {
query_ctx_t *qctx = (query_ctx_t *)arg;
async_instance_t *inst = (async_instance_t *)cbdata;
state_t *state = NULL;
logmsg("qctx init hook");
*resp = ISC_R_UNSET;
state = client_state_get(qctx, inst);
if (state == NULL) {
client_state_create(qctx, inst);
}
return (NS_HOOK_CONTINUE);
}
static void
cancelasync(ns_hookasync_t *hctx) {
UNUSED(hctx);
logmsg("cancelasync");
}
static void
destroyasync(ns_hookasync_t **ctxp) {
ns_hookasync_t *ctx = *ctxp;
logmsg("destroyasync");
*ctxp = NULL;
isc_mem_putanddetach(&ctx->mctx, ctx, sizeof(*ctx));
}
static isc_result_t
doasync(query_ctx_t *qctx, isc_mem_t *mctx, void *arg, isc_task_t *task,
isc_taskaction_t action, void *evarg, ns_hookasync_t **ctxp) {
ns_hook_resevent_t *rev = (ns_hook_resevent_t *)isc_event_allocate(
mctx, task, NS_EVENT_HOOKASYNCDONE, action, evarg,
sizeof(*rev));
ns_hookasync_t *ctx = isc_mem_get(mctx, sizeof(*ctx));
state_t *state = (state_t *)arg;
logmsg("doasync");
*ctx = (ns_hookasync_t){ .mctx = NULL };
isc_mem_attach(mctx, &ctx->mctx);
ctx->cancel = cancelasync;
ctx->destroy = destroyasync;
rev->hookpoint = state->hookpoint;
rev->origresult = state->origresult;
qctx->result = DNS_R_NOTIMP;
rev->saved_qctx = qctx;
rev->ctx = ctx;
state->rev = rev;
isc_task_send(task, (isc_event_t **)&rev);
*ctxp = ctx;
return (ISC_R_SUCCESS);
}
static ns_hookresult_t
async_query_done_begin(void *arg, void *cbdata, isc_result_t *resp) {
query_ctx_t *qctx = (query_ctx_t *)arg;
async_instance_t *inst = (async_instance_t *)cbdata;
state_t *state = client_state_get(qctx, inst);
UNUSED(qctx);
UNUSED(cbdata);
UNUSED(state);
logmsg("done begin hook");
if (state->async) {
/* resuming */
state->async = false;
return (NS_HOOK_CONTINUE);
}
/* initial call */
state->async = true;
state->hookpoint = NS_QUERY_DONE_BEGIN;
state->origresult = *resp;
ns_query_hookasync(qctx, doasync, state);
return (NS_HOOK_RETURN);
}
static ns_hookresult_t
async_qctx_destroy(void *arg, void *cbdata, isc_result_t *resp) {
query_ctx_t *qctx = (query_ctx_t *)arg;
async_instance_t *inst = (async_instance_t *)cbdata;
logmsg("qctx destroy hook");
*resp = ISC_R_UNSET;
if (!qctx->detach_client) {
return (NS_HOOK_CONTINUE);
}
client_state_destroy(qctx, inst);
return (NS_HOOK_CONTINUE);
}
+19
View File
@@ -0,0 +1,19 @@
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
;
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;
; See the COPYRIGHT file distributed with this work for additional
; information regarding copyright ownership.
$TTL 120
@ SOA ns.unsigned. hostmaster.ns.unsigned. ( 1 3600 1200 604800 60 )
@ NS ns
@ MX 10 mx
ns A 10.53.0.1
AAAA fd92:7065:b8e:ffff::1
a A 1.1.1.1
mx A 2.2.2.2
+39
View File
@@ -0,0 +1,39 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
options {
query-source address 10.53.0.1;
notify-source 10.53.0.1;
transfer-source 10.53.0.1;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.1; };
recursion no;
dnssec-validation yes;
notify yes;
minimal-responses no;
};
plugin query "../driver/.libs/test-async.so";
key rndc_key {
secret "1234abcd8765";
algorithm hmac-sha256;
};
controls {
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
zone "example.com" {
type primary;
file "example.db";
};
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
+34
View File
@@ -0,0 +1,34 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
. ../conf.sh
status=0
n=0
rm -f dig.out.*
DIGOPTS="+tcp +noadd +nosea +nostat +nocmd -p ${PORT}"
RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s"
n=$((n+1))
echo_i "checking asynchronous hook action resumes correctly ($n)"
ret=0
$DIG $DIGOPTS example.com @10.53.0.1 > dig.out.ns1.test$n || ret=1
# the test-async plugin changes the status of any postiive answer to NOTIMP
grep -q "status: NOTIMP" dig.out.ns1.test$n || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
+14
View File
@@ -64,6 +64,20 @@ zone "migrate-nomatch-alglen.kasp" {
update-check-ksk yes;
};
/* These zones are going insecure. */
zone "step1.going-insecure.kasp" {
type master;
file "step1.going-insecure.kasp.db";
dnssec-policy "migrate";
};
zone "step1.going-insecure-dynamic.kasp" {
type master;
file "step1.going-insecure-dynamic.kasp.db";
dnssec-policy "migrate";
allow-update { any; };
};
/* These are alorithm rollover test zones. */
zone "step1.algorithm-roll.kasp" {
type primary;
+27
View File
@@ -57,6 +57,33 @@ zone "migrate-nomatch-alglen.kasp" {
dnssec-policy "migrate-nomatch-alglen";
};
/* Zones for testing going insecure. */
zone "step1.going-insecure.kasp" {
type master;
file "step1.going-insecure.kasp.db";
dnssec-policy "none";
};
zone "step2.going-insecure.kasp" {
type master;
file "step2.going-insecure.kasp.db";
dnssec-policy "none";
};
zone "step1.going-insecure-dynamic.kasp" {
type master;
file "step1.going-insecure-dynamic.kasp.db";
dnssec-policy "none";
allow-update { any; };
};
zone "step2.going-insecure-dynamic.kasp" {
type master;
file "step2.going-insecure-dynamic.kasp.db";
dnssec-policy "none";
allow-update { any; };
};
/*
* Zones for testing KSK/ZSK algorithm roll.
*/
+40
View File
@@ -86,6 +86,46 @@ private_type_record $zone 5 "$KSK" >> "$infile"
private_type_record $zone 5 "$ZSK" >> "$infile"
$SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
# The child zones (step1, step2) beneath these zones represent the various
# steps of unsigning a zone.
for zn in going-insecure.kasp going-insecure-dynamic.kasp
do
# Step 1:
# Set up a zone with dnssec-policy that is going insecure.
setup step1.$zn
echo "$zone" >> zones
T="now-10d"
ksktimes="-P $T -A $T -P sync $T"
zsktimes="-P $T -A $T"
KSK=$($KEYGEN -a $DEFAULT_ALGORITHM -L 7200 -f KSK $ksktimes $zone 2> keygen.out.$zone.1)
ZSK=$($KEYGEN -a $DEFAULT_ALGORITHM -L 7200 $zsktimes $zone 2> keygen.out.$zone.2)
cat template.db.in "${KSK}.key" "${ZSK}.key" > "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$KSK" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$ZSK" >> "$infile"
$SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
# Step 2:
# Set up a zone with dnssec-policy that is going insecure. Don't add
# this zone to the zones file, because this zone is no longer expected
# to be fully signed.
setup step2.$zn
# The DS was withdrawn from the parent zone 26 hours ago.
Trem="now-26h"
ksktimes="-P $T -A $T -P sync $T"
zsktimes="-P $T -A $T"
KSK=$($KEYGEN -a $DEFAULT_ALGORITHM -L 7200 -f KSK $ksktimes $zone 2> keygen.out.$zone.1)
ZSK=$($KEYGEN -a $DEFAULT_ALGORITHM -L 7200 $zsktimes $zone 2> keygen.out.$zone.2)
$SETTIME -s -g $H -k $O $T -r $O $T -d $U $Trem -D ds $Trem "$KSK" > settime.out.$zone.1 2>&1
$SETTIME -s -g $H -k $O $T -z $O $T "$ZSK" > settime.out.$zone.2 2>&1
# Fake lifetime of old algorithm keys.
echo "Lifetime: 0" >> "${KSK}.state"
echo "Lifetime: 5184000" >> "${ZSK}.state"
cat template.db.in "${KSK}.key" "${ZSK}.key" > "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$KSK" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$ZSK" >> "$infile"
$SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
done
#
# The zones at algorithm-roll.kasp represent the various steps of a ZSK/KSK
# algorithm rollover.
+282 -23
View File
@@ -172,12 +172,26 @@ set_server() {
# Set zone name for testing keys.
set_zone() {
ZONE=$1
DYNAMIC="no"
}
# By default zones are considered static.
# When testing dynamic zones, call 'set_dynamic' after 'set_zone'.
set_dynamic() {
DYNAMIC="yes"
}
# Set policy settings (name $1, number of keys $2, dnskey ttl $3) for testing keys.
set_policy() {
POLICY=$1
NUM_KEYS=$2
DNSKEY_TTL=$3
CDS_DELETE="no"
}
# By default policies are considered to be secure.
# If a zone sets its policy to "none", call 'set_cdsdelete' to tell the system
# test to expect a CDS and CDNSKEY Delete record.
set_cdsdelete() {
CDS_DELETE="yes"
}
# Set key properties for testing keys.
@@ -946,22 +960,18 @@ check_dnssecstatus() {
rndccmd $_server dnssec -status $_zone in $_view > rndc.dnssec.status.out.$_zone.$n || log_error "rndc dnssec -status zone ${_zone} failed"
if [ "$_policy" = "none" ]; then
grep "Zone does not have dnssec-policy" rndc.dnssec.status.out.$_zone.$n > /dev/null || log_error "bad dnssec status for unsigned zone ${_zone}"
else
grep "dnssec-policy: ${_policy}" rndc.dnssec.status.out.$_zone.$n > /dev/null || log_error "bad dnssec status for signed zone ${_zone}"
if [ "$(key_get KEY1 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY1 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || log_error "missing key $(key_get KEY1 ID) from dnssec status"
fi
if [ "$(key_get KEY2 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY2 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || log_error "missing key $(key_get KEY2 ID) from dnssec status"
fi
if [ "$(key_get KEY3 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY3 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || log_error "missing key $(key_get KEY3 ID) from dnssec status"
fi
if [ "$(key_get KEY4 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY4 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || log_error "missing key $(key_get KEY4 ID) from dnssec status"
fi
grep "dnssec-policy: ${_policy}" rndc.dnssec.status.out.$_zone.$n > /dev/null || log_error "bad dnssec status for signed zone ${_zone}"
if [ "$(key_get KEY1 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY1 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || log_error "missing key $(key_get KEY1 ID) from dnssec status"
fi
if [ "$(key_get KEY2 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY2 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || log_error "missing key $(key_get KEY2 ID) from dnssec status"
fi
if [ "$(key_get KEY3 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY3 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || log_error "missing key $(key_get KEY3 ID) from dnssec status"
fi
if [ "$(key_get KEY4 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY4 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || log_error "missing key $(key_get KEY4 ID) from dnssec status"
fi
test "$ret" -eq 0 || echo_i "failed"
@@ -1044,6 +1054,14 @@ check_cds() {
dig_with_opts "$ZONE" "@${SERVER}" "CDNSKEY" > "dig.out.$DIR.test$n.cdnskey" || log_error "dig ${ZONE} CDNSKEY failed"
grep "status: NOERROR" "dig.out.$DIR.test$n.cdnskey" > /dev/null || log_error "mismatch status in DNS response"
if [ "$CDS_DELETE" = "no" ]; then
grep "CDS.*0 0 0 00" "dig.out.$DIR.test$n.cds" > /dev/null && log_error "unexpected CDS DELETE record in DNS response"
grep "CDNSKEY.*0 3 0 AA==" "dig.out.$DIR.test$n.cdnskey" > /dev/null && log_error "unexpected CDNSKEY DELETE record in DNS response"
else
grep "CDS.*0 0 0 00" "dig.out.$DIR.test$n.cds" > /dev/null || log_error "missing CDS DELETE record in DNS response"
grep "CDNSKEY.*0 3 0 AA==" "dig.out.$DIR.test$n.cdnskey" > /dev/null || log_error "missing CDNSKEY DELETE record in DNS response"
fi
if [ "$(key_get KEY1 STATE_DS)" = "rumoured" ] || [ "$(key_get KEY1 STATE_DS)" = "omnipresent" ]; then
response_has_cds_for_key KEY1 "dig.out.$DIR.test$n.cds" || log_error "missing CDS record in response for key $(key_get KEY1 ID)"
check_signatures "CDS" "dig.out.$DIR.test$n.cds" "KSK"
@@ -1210,7 +1228,13 @@ _loadkeys_on() {
nextpart $_dir/named.run > /dev/null
rndccmd $_server loadkeys $_zone in $_view > rndc.dnssec.loadkeys.out.$_zone.$n
wait_for_log 20 "zone ${_zone}/IN (signed): next key event" $_dir/named.run || return 1
if [ "${DYNAMIC}" = "yes" ]; then
wait_for_log 20 "zone ${_zone}/IN: next key event" $_dir/named.run || return 1
else
# inline-signing zone adds "(signed)"
wait_for_log 20 "zone ${_zone}/IN (signed): next key event" $_dir/named.run || return 1
fi
}
# Tell named that the DS for the key in given zone has been seen in the
@@ -1228,21 +1252,23 @@ rndc_checkds() {
_keycmd=""
if [ "${_key}" != "-" ]; then
_keyid=$(key_get $_key ID)
_keycmd="-key ${_keyid}"
_keycmd=" -key ${_keyid}"
fi
_whencmd=""
if [ "${_when}" != "now" ]; then
_whencmd="-when ${_when}"
_whencmd=" -when ${_when}"
fi
n=$((n+1))
echo_i "calling rndc dnssec -checkds ${_keycmd} ${_whencmd} ${_what} zone ${_zone} ($n)"
echo_i "calling rndc dnssec -checkds${_keycmd}${_whencmd} ${_what} zone ${_zone} in ${_view} ($n)"
ret=0
rndccmd $_server dnssec -checkds $_keycmd $_whencmd $_what $_zone in $_view > rndc.dnssec.checkds.out.$_zone.$n || log_error "rndc dnssec -checkds (${_keycmd} ${_whencmd} ${_what} zone ${_zone} failed"
rndccmd $_server dnssec -checkds $_keycmd $_whencmd $_what $_zone in $_view > rndc.dnssec.checkds.out.$_zone.$n || log_error "rndc dnssec -checkds${_keycmd}${_whencmd} ${_what} zone ${_zone} failed"
_loadkeys_on $_server $_dir $_zone || log_error "loadkeys zone ${_zone} failed ($n)"
if [ "$ret" -eq 0 ]; then
_loadkeys_on $_server $_dir $_zone || log_error "loadkeys zone ${_zone} failed ($n)"
fi
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
@@ -1346,6 +1372,7 @@ status=$((status+ret))
# Zone: dynamic.kasp
#
set_zone "dynamic.kasp"
set_dynamic
set_policy "default" "1" "3600"
set_server "ns3" "10.53.0.3"
# Key properties, timings and states same as above.
@@ -1378,6 +1405,7 @@ status=$((status+ret))
# Zone: dynamic-inline-signing.kasp
#
set_zone "dynamic-inline-signing.kasp"
set_dynamic
set_policy "default" "1" "3600"
set_server "ns3" "10.53.0.3"
# Key properties, timings and states same as above.
@@ -2937,7 +2965,12 @@ check_next_key_event() {
grep "zone ${ZONE}.*: next key event in .* seconds" "${DIR}/named.run" > "keyevent.out.$ZONE.test$n" || log_error "no next key event for zone ${ZONE}"
# Get the latest next key event.
_time=$(awk '{print $10}' < "keyevent.out.$ZONE.test$n" | tail -1)
if [ "${DYNAMIC}" = "yes" ]; then
_time=$(awk '{print $9}' < "keyevent.out.$ZONE.test$n" | tail -1)
else
# inline-signing zone adds "(signed)"
_time=$(awk '{print $10}' < "keyevent.out.$ZONE.test$n" | tail -1)
fi
# The next key event time must within threshold of the
# expected time.
@@ -4452,6 +4485,90 @@ dnssec_verify
_migratenomatch_alglen_ksk=$(key_get KEY1 ID)
_migratenomatch_alglen_zsk=$(key_get KEY2 ID)
#
# Testing going insecure.
#
#
# Zone step1.going-insecure.kasp
#
set_zone "step1.going-insecure.kasp"
set_policy "migrate" "2" "7200"
set_server "ns6" "10.53.0.6"
# Policy parameters.
# Lksk: 0
# Lzsk: 60 days (5184000 seconds)
# Iret(KSK): DS TTL (1d) + DprpP (1h) + retire-safety (1h)
# Iret(KSK): 1d2h (93600 seconds)
# Iret(ZSK): RRSIG TTL (1d) + Dprp (5m) + Dsgn (9d) + retire-safety (1h)
# Iret(ZSK): 10d1h5m (867900 seconds)
Lksk=0
Lzsk=5184000
IretKSK=93600
IretZSK=867900
init_migration_insecure() {
key_clear "KEY1"
set_keyrole "KEY1" "ksk"
set_keylifetime "KEY1" "${Lksk}"
set_keyalgorithm "KEY1" "$DEFAULT_ALGORITHM_NUMBER" "$DEFAULT_ALGORITHM" "$DEFAULT_BITS"
set_keysigning "KEY1" "yes"
set_zonesigning "KEY1" "no"
set_keystate "KEY1" "GOAL" "omnipresent"
set_keystate "KEY1" "STATE_DNSKEY" "omnipresent"
set_keystate "KEY1" "STATE_KRRSIG" "omnipresent"
set_keystate "KEY1" "STATE_DS" "omnipresent"
key_clear "KEY2"
set_keyrole "KEY2" "zsk"
set_keylifetime "KEY2" "${Lzsk}"
set_keyalgorithm "KEY2" "$DEFAULT_ALGORITHM_NUMBER" "$DEFAULT_ALGORITHM" "$DEFAULT_BITS"
set_keysigning "KEY2" "no"
set_zonesigning "KEY2" "yes"
set_keystate "KEY2" "GOAL" "omnipresent"
set_keystate "KEY2" "STATE_DNSKEY" "omnipresent"
set_keystate "KEY2" "STATE_ZRRSIG" "omnipresent"
key_clear "KEY3"
key_clear "KEY4"
}
init_migration_insecure
# Various signing policy checks.
check_keys
check_dnssecstatus "$SERVER" "$POLICY" "$ZONE"
# We have set the timing metadata to now - 10 days (864000 seconds).
rollover_predecessor_keytimes -864000
check_keytimes
check_apex
check_subdomain
dnssec_verify
#
# Zone step1.going-insecure-dynamic.kasp
#
set_zone "step1.going-insecure-dynamic.kasp"
set_dynamic
set_policy "migrate" "2" "7200"
set_server "ns6" "10.53.0.6"
init_migration_insecure
# Various signing policy checks.
check_keys
check_dnssecstatus "$SERVER" "$POLICY" "$ZONE"
# We have set the timing metadata to now - 10 days (864000 seconds).
rollover_predecessor_keytimes -864000
check_keytimes
check_apex
check_subdomain
dnssec_verify
# Reconfig dnssec-policy (triggering algorithm roll and other dnssec-policy
# changes).
echo_i "reconfig dnssec-policy to trigger algorithm rollover"
@@ -4501,6 +4618,148 @@ wait_for_done_signing() {
status=$((status+ret))
}
#
# Testing going insecure.
#
#
# Zone: step1.going-insecure.kasp
#
set_zone "step1.going-insecure.kasp"
set_policy "none" "2" "7200"
set_server "ns6" "10.53.0.6"
# Expect a CDS/CDNSKEY Delete Record.
set_cdsdelete
# Key goal states should be HIDDEN.
init_migration_insecure
set_keystate "KEY1" "GOAL" "hidden"
set_keystate "KEY2" "GOAL" "hidden"
# The DS may be removed if we are going insecure.
set_keystate "KEY1" "STATE_DS" "unretentive"
# Various signing policy checks.
check_keys
wait_for_done_signing
check_dnssecstatus "$SERVER" "$POLICY" "$ZONE"
check_apex
check_subdomain
dnssec_verify
# Tell named that the DS has been removed.
rndc_checkds "$SERVER" "$DIR" "KEY1" "now" "withdrawn" "$ZONE"
wait_for_done_signing
check_dnssecstatus "$SERVER" "$POLICY" "$ZONE"
check_apex
check_subdomain
dnssec_verify
# Next key event is when the DS becomes HIDDEN. This happens after the
# parent propagation delay, retire safety delay, and DS TTL:
# 1h + 1h + 1d = 26h = 93600 seconds.
check_next_key_event 93600
#
# Zone: step2.going-insecure.kasp
#
set_zone "step2.going-insecure.kasp"
set_policy "none" "2" "7200"
set_server "ns6" "10.53.0.6"
# Expect a CDS/CDNSKEY Delete Record.
set_cdsdelete
# The DS is long enough removed from the zone to be considered HIDDEN.
# This means the DNSKEY and the KSK signatures can be removed.
set_keystate "KEY1" "STATE_DS" "hidden"
set_keystate "KEY1" "STATE_DNSKEY" "unretentive"
set_keystate "KEY1" "STATE_KRRSIG" "unretentive"
set_keysigning "KEY1" "no"
set_keystate "KEY2" "STATE_DNSKEY" "unretentive"
set_keystate "KEY2" "STATE_ZRRSIG" "unretentive"
set_zonesigning "KEY2" "no"
# Various signing policy checks.
check_keys
check_dnssecstatus "$SERVER" "$POLICY" "$ZONE"
check_apex
check_subdomain
# Next key event is when the DNSKEY becomes HIDDEN. This happens after the
# propagation delay, plus DNSKEY TTL:
# 5m + 2h = 125m = 7500 seconds.
check_next_key_event 7500
#
# Zone: step1.going-insecure-dynamic.kasp
#
set_zone "step1.going-insecure-dynamic.kasp"
set_dynamic
set_policy "none" "2" "7200"
set_server "ns6" "10.53.0.6"
# Expect a CDS/CDNSKEY Delete Record.
set_cdsdelete
# Key goal states should be HIDDEN.
init_migration_insecure
set_keystate "KEY1" "GOAL" "hidden"
set_keystate "KEY2" "GOAL" "hidden"
# The DS may be removed if we are going insecure.
set_keystate "KEY1" "STATE_DS" "unretentive"
# Various signing policy checks.
check_keys
wait_for_done_signing
check_dnssecstatus "$SERVER" "$POLICY" "$ZONE"
check_apex
check_subdomain
dnssec_verify
# Tell named that the DS has been removed.
rndc_checkds "$SERVER" "$DIR" "KEY1" "now" "withdrawn" "$ZONE"
wait_for_done_signing
check_dnssecstatus "$SERVER" "$POLICY" "$ZONE"
check_apex
check_subdomain
dnssec_verify
# Next key event is when the DS becomes HIDDEN. This happens after the
# parent propagation delay, retire safety delay, and DS TTL:
# 1h + 1h + 1d = 26h = 93600 seconds.
check_next_key_event 93600
#
# Zone: step2.going-insecure-dynamic.kasp
#
set_zone "step2.going-insecure-dynamic.kasp"
set_dynamic
set_policy "none" "2" "7200"
set_server "ns6" "10.53.0.6"
# Expect a CDS/CDNSKEY Delete Record.
set_cdsdelete
# The DS is long enough removed from the zone to be considered HIDDEN.
# This means the DNSKEY and the KSK signatures can be removed.
set_keystate "KEY1" "STATE_DS" "hidden"
set_keystate "KEY1" "STATE_DNSKEY" "unretentive"
set_keystate "KEY1" "STATE_KRRSIG" "unretentive"
set_keysigning "KEY1" "no"
set_keystate "KEY2" "STATE_DNSKEY" "unretentive"
set_keystate "KEY2" "STATE_ZRRSIG" "unretentive"
set_zonesigning "KEY2" "no"
# Various signing policy checks.
check_keys
check_dnssecstatus "$SERVER" "$POLICY" "$ZONE"
check_apex
check_subdomain
# Next key event is when the DNSKEY becomes HIDDEN. This happens after the
# propagation delay, plus DNSKEY TTL:
# 5m + 2h = 125m = 7500 seconds.
check_next_key_event 7500
#
# Testing migration.
#
@@ -27,7 +27,6 @@ options {
listen-on { 10.53.0.2; };
listen-on-v6 { none; };
recursion yes;
acache-enable yes;
send-cookie yes;
tcp-advertised-timeout 150;
};
+6 -1
View File
@@ -462,7 +462,9 @@ grep "example..*.RRSIG..*TXT" dig.out.ns2.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
echo_i "reset the root server"
n=$((n+1))
echo_i "reset the root server ($n)"
ret=0
$SETTIME -D none -R none -K ns1 "$original" > /dev/null
$SETTIME -D now -K ns1 "$standby1" > /dev/null
$SETTIME -D now -K ns1 "$standby2" > /dev/null
@@ -470,6 +472,9 @@ $SIGNER -Sg -K ns1 -N unixtime -o . ns1/root.db > /dev/null 2>/dev/null
copy_setports ns1/named2.conf.in ns1/named.conf
rm -f ns1/root.db.signed.jnl
mkeys_reconfig_on 1 || ret=1
mkeys_reload_on 1 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
echo_i "reinitialize trust anchors"
stop_server --use-rndc --port "${CONTROLPORT}" mkeys ns2
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
set -e
rm -f dig.out.* rndc.signing.*
rm -f ns*/named.conf ns*/named.memstats ns*/named.run*
rm -f ns*/*.jnl ns*/*.jbk ns*/managed-keys.bind
rm -f ns*/K*.private ns*/K*.key ns*/K*.state
rm -f ns*/dsset-* ns*/*.db ns*/*.db.signed
+99
View File
@@ -0,0 +1,99 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
// NS3
dnssec-policy "nsec" {
// no need to change configuration: if no 'nsec3param' is set,
// NSEC will be used;
};
dnssec-policy "nsec3" {
nsec3param;
};
dnssec-policy "optout" {
nsec3param optout yes;
};
dnssec-policy "nsec3-other" {
nsec3param iterations 11 optout yes salt-length 0;
};
options {
query-source address 10.53.0.3;
notify-source 10.53.0.3;
transfer-source 10.53.0.3;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.3; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
};
key rndc_key {
secret "1234abcd8765";
algorithm hmac-sha256;
};
controls {
inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
/* This zone starts with NSEC, but will be reconfigured to use NSEC3. */
zone "nsec-to-nsec3.kasp" {
type primary;
file "nsec-to-nsec3.kasp.db";
dnssec-policy "nsec";
};
/* This zone uses the default NSEC3 settings. */
zone "nsec3.kasp" {
type primary;
file "nsec3.kasp.db";
dnssec-policy "nsec3";
};
/* This zone uses non-default NSEC3 settings. */
zone "nsec3-other.kasp" {
type primary;
file "nsec3-other.kasp.db";
dnssec-policy "nsec3-other";
};
/* The zone will be reconfigured to use other NSEC3 settings. */
zone "nsec3-change.kasp" {
type primary;
file "nsec3-change.kasp.db";
dnssec-policy "nsec3";
};
/* The zone will be reconfigured to use opt-out. */
zone "nsec3-to-optout.kasp" {
type primary;
file "nsec3-to-optout.kasp.db";
dnssec-policy "nsec3";
};
/* The zone will be reconfigured to disable opt-out. */
zone "nsec3-from-optout.kasp" {
type primary;
file "nsec3-from-optout.kasp.db";
dnssec-policy "optout";
};
/* The zone starts with NSEC3, but will be reconfigured to use NSEC. */
zone "nsec3-to-nsec.kasp" {
type primary;
file "nsec3-to-nsec.kasp.db";
dnssec-policy "nsec3";
};
+104
View File
@@ -0,0 +1,104 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
// NS3
dnssec-policy "nsec" {
// no need to change configuration: if no 'nsec3param' is set,
// NSEC will be used;
};
dnssec-policy "nsec3" {
nsec3param;
};
dnssec-policy "optout" {
nsec3param optout yes;
};
dnssec-policy "nsec3-other" {
nsec3param iterations 11 optout yes salt-length 0;
};
options {
query-source address 10.53.0.3;
notify-source 10.53.0.3;
transfer-source 10.53.0.3;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.3; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
};
key rndc_key {
secret "1234abcd8765";
algorithm hmac-sha256;
};
controls {
inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
/* This zone starts with NSEC, but will be reconfigured to use NSEC3. */
zone "nsec-to-nsec3.kasp" {
type primary;
file "nsec-to-nsec3.kasp.db";
//dnssec-policy "nsec";
dnssec-policy "nsec3";
};
/* This zone uses the default NSEC3 settings. */
zone "nsec3.kasp" {
type primary;
file "nsec3.kasp.db";
dnssec-policy "nsec3";
};
/* This zone uses non-default NSEC3 settings. */
zone "nsec3-other.kasp" {
type primary;
file "nsec3-other.kasp.db";
dnssec-policy "nsec3-other";
};
/* The zone will be reconfigured to use other NSEC3 settings. */
zone "nsec3-change.kasp" {
type primary;
file "nsec3-change.kasp.db";
//dnssec-policy "nsec3";
dnssec-policy "nsec3-other";
};
/* The zone will be reconfigured to use opt-out. */
zone "nsec3-to-optout.kasp" {
type primary;
file "nsec3-to-optout.kasp.db";
//dnssec-policy "nsec3";
dnssec-policy "optout";
};
/* The zone will be reconfigured to disable opt-out. */
zone "nsec3-from-optout.kasp" {
type primary;
file "nsec3-from-optout.kasp.db";
//dnssec-policy "optout";
dnssec-policy "nsec3";
};
/* The zone starts with NSEC3, but will be reconfigured to use NSEC. */
zone "nsec3-to-nsec.kasp" {
type primary;
file "nsec3-to-nsec.kasp.db";
//dnssec-policy "nsec3";
dnssec-policy "nsec";
};

Some files were not shown because too many files have changed in this diff Show More