Compare commits

...
Author SHA1 Message Date
Petr Špaček 08e5448f4e DO NOT MERGE: hack for measurements: dump cache in plain zone format
Sometimes it's handy to dump cache in a format which can be processed
using standard tools. Don't forget fgrep -v '$DATE'.
2021-12-02 10:13:47 +01:00
Petr Špaček dcf68f6c23 DO NOT MERGE: hack for measurements: cache RRsets for one day
NEVER USE IN PRODUCTION! It's a dirty hack for interoperability tests.

Sometimes combined with
servfail-ttl 0;
lame-ttl 0;
2021-12-02 10:12:44 +01:00
Evan Hunt 4ecbc3d09f Merge branch '3026-premature-tcp-connection-closure-leaks-fetch-contexts-hang-on-shutdown' into 'main'
Shutdown all active TCP connections on error

Closes #3026

See merge request isc-projects/bind9!5599
2021-12-01 20:10:44 +00:00
Ondřej SurýandEvan Hunt 4e779b11f6 Add CHANGES and release notes for [GL #3026] 2021-12-01 11:48:15 -08:00
Ondřej SurýandEvan Hunt 5c17919019 Add TCP connection reset test
The TCP connection reset test starts mock UDP and TCP server which
always returns empty DNS answer with TC bit set over UDP and resets the
TCP connection after five seconds.

When tested without the fix, the DNS query to 10.53.0.2 times out and
the ns2 server hangs at shutdown.
2021-12-01 11:48:12 -08:00
Evan Hunt fa8f409af2 On non-matching answer, check for missed timeout
A TCP connection may be held open past its proper timeout if it's
receiving a stream of DNS responses that don't match any queries.
In this case, we now check whether the oldest query should have timed
out.
2021-12-01 11:45:55 -08:00
Ondřej SurýandEvan Hunt ba1cadf14a Tear down the TCP connection on too many unexpected DNS messages
When the outgoing TCP dispatch times-out active response, we might still
receive the answer during the lifetime of the connection.  Previously,
we would just ignore any non-matching DNS answers, which would allow the
server to feed us with otherwise valid DNS answer and keep the
connection open.

Add a counter for timed-out DNS queries over TCP and tear down the whole
TCP connection if we receive unexpected number of DNS answers.
2021-12-01 11:45:55 -08:00
Ondřej SurýandEvan Hunt c84ed5056e Refactor tcp_recv()
The tcp_recv() function used lot of gotos that made the function hard to
read.  Refactor the function by splitting it into smaller logical chunks.
2021-12-01 11:45:55 -08:00
Ondřej SurýandEvan Hunt 10f4f1a250 Shutdown all TCP connection on invalid DNS message
Previously, when invalid DNS message is received over TCP we throw the
garbage DNS message away and continued looking for valid DNS message
that would match our outgoing queries.  This logic makes sense for UDP,
because anyone can send DNS message over UDP.

Change the logic that the TCP connection is closed when we receive
garbage, because the other side is acting malicious.
2021-12-01 11:45:55 -08:00
Ondřej SurýandEvan Hunt 9230473324 Shutdown all active TCP connections on error
When outgoing TCP connection was prematurely terminated (f.e. with
connection reset), the dispatch code would not cleanup the resources
used by such connection leading to dangling dns_dispentry_t entries.
2021-12-01 11:45:55 -08:00
Ondřej Surý 081e18edc8 Merge branch '1610-disable-UseSTD3ASCIIRules-in-idn2' into 'main'
Disable IDN2_USE_STD3_ASCII_RULES to idn2 conversion functions

Closes #1610

See merge request isc-projects/bind9!5605
2021-12-01 15:32:29 +00:00
Ondřej Surý 1d42178c46 Add CHANGES and release note for [GL #1610] 2021-12-01 16:10:04 +01:00
Ondřej Surý ce1256c066 Add an idna test that _ and * characters are preserved
Add a idna that checks whether non-character letters like _ and * are
preserved when IDN is enabled.  This wasn't the case when
UseSTD3ASCIIRules were enabled, f.e. _ from _tcp would get mangled to
tcp.
2021-12-01 16:10:04 +01:00
Ondřej Surý 70d8395ca3 Remove idna test for UseSTD3ASCIIRules=true
We had to disable UseSTD3ASCIIRules=true because it broke non-letter
domain names like _tcp or *.  Disable the idna test too.
2021-12-01 16:10:04 +01:00
Ondřej Surý 69cfc07d00 Disable IDN2_USE_STD3_ASCII_RULES to idn2 conversion functions
Disable IDN2_USE_STD3_ASCII_RULES to the libidn2 conversion because it
broke encoding some non-letter but valid domain names like _tcp or *.

This reverts commit ef8aa91740.
2021-12-01 16:10:04 +01:00
Artem Boldariev 71ee5f6148 Merge branch '2983-fix-doth-system-test' into 'main'
Resolve #2983: Increase startup timeout for servers in system tests

Closes #2983

See merge request isc-projects/bind9!5609
2021-12-01 14:06:16 +00:00
Artem Boldariev 3e7bcc2939 Increase startup timeout for servers in system tests
This change is made in particular to address the issue with 'doth'
system tests where servers are unable to iniitalise in time in CI
system under high load (that happened particularly often for Debian
Buster cross32 configuration).

The right solution, is, of course, to (re)use TLS context sparingly,
while right now we create too many of them.
2021-12-01 13:11:39 +02:00
Artem Boldariev 6436caa607 Merge branch 'artem-xot-tls-protocols-ciphers' into 'main'
XoT: add support client-side TLS parameters for incoming XFRs, add 'tls' name configuration validation on secondaries

See merge request isc-projects/bind9!5602
2021-12-01 11:05:51 +00:00
Artem Boldariev f3e025643f Add CHANGES entry [GL !5602]
Mention that client-side 'tls' parameters are now supported for XoT.
2021-12-01 12:00:31 +02:00
Artem Boldariev 5f859d8a98 TLS context handling code: Fix an abort on ancient OpenSSL version
There was a logical bug when setting a list of enabled TLS protocols,
which may lead to a crash (an abort()) on systems with ancient OpenSSL
versions.

The problem was due to the fact that we were INSIST()ing on supporting
all of the TLS versions, while checking only for mentioned in the
configuration was implied.
2021-12-01 12:00:30 +02:00
Artem Boldariev 746052031a Extend the 'doth' system test with another XoT-enabled secondary
This commit extends the 'doth' system test to include an additional
XoT-enabled secondary which uses the supported client-side 'tls'
parameters.
2021-12-01 12:00:29 +02:00
Artem Boldariev 69cef39099 Add 'tls' validation for XoT enabled primaries
This commit ensure that the 'tls' name specified in the 'primaries'
clause of a 'zone' statement is a valid one.

Prior to that such a name would be silently accepted, leading to
silent XFRs-via-TLS failures.
2021-12-01 12:00:29 +02:00
Artem Boldariev 7843fb4ece XoT: add support for client-side TLS parameters
This commit adds support for client-side TLS parameters to XoT.

Prior to this commit all client-side TLS contexts were using default
parameters only, ignoring the options from the BIND's configuration
file.

Currently, the following 'tls' parameters are supported:

- protocols;
- ciphers;
- prefer-server-ciphers.
2021-12-01 12:00:28 +02:00
Mark Andrews 17d9a74681 Merge branch '2850-the-list-of-fetches-at-the-end-of-rndc-recursing-output-is-very-poorly-explained-in-the-arm' into 'main'
Resolve "The list of fetches at the end of 'rndc recursing' output is very poorly explained in the ARM - what does 'allowed' mean?"

Closes #2850

See merge request isc-projects/bind9!5388
2021-11-30 11:30:47 +00:00
Mark Andrews 65f6d8af75 Update the description of fetches-per-zone counters 2021-11-30 11:10:04 +00:00
Mark Andrews db2aad0e96 Merge branch '853-dnssec-dsfromkey-doesn-t-omit-revoked-ksk' into 'main'
Resolve "dnssec-dsfromkey doesn't omit revoked KSK"

Closes #853

See merge request isc-projects/bind9!5460
2021-11-30 11:08:28 +00:00
Mark Andrews d632df3c11 Add CHANGES for [GL #853] 2021-11-30 21:48:55 +11:00
Mark Andrews e7a3ada1d2 Check dnssec-dsfromkey with revoked DNSKEY
Checks that there is a revoked key in the DNSKEY RRset then checks
that only the correct number of DS records are produced.
2021-11-30 21:48:17 +11:00
Tony FinchandMark Andrews 04a5529c2d dnssec-dsfromkey should not convert revoked keys
it is pointless to convert revoked keys to DS or CDS records as
they cannot be used to provide a cryptographic link from the parent
zone.
2021-11-30 21:48:17 +11:00
Artem Boldariev 3443938b99 Merge branch '2776-allow-transfer-encrypted' into 'main'
Resolve #2776: Extend 'allow-transfer' with 'port' and 'transport' parameters

Closes #2776

See merge request isc-projects/bind9!5587
2021-11-30 10:44:11 +00:00
Artem Boldariev 7f73e68730 Add transport-acl system test
This commit adds a new system-test: transport-acl system test. It is
intended to test the new, extended syntax for ACLs, the one where port
or transport protocol can be specified. Currently, it includes the
tests only using allow-transfer statement, as this extended syntax is
used only there, at least for now.
2021-11-30 12:21:19 +02:00
Artem Boldariev 758f748d5e Modify CHANGES [GL #2776]
Mention in the CHANGES file that the allow-transfer options has been
extended with 'port' and 'transport' options.
2021-11-30 12:21:17 +02:00
Artem Boldariev 792ff02045 Mention that the allow-transfer option has been extended
This commit updates both the reference manual and release notes with
the information that 'allow-transfer' has been extended with
additional "port" and "transport" options.
2021-11-30 12:20:22 +02:00
Artem Boldariev 3cd2ffc01f Extend the 'doth' system test to test extended allow-transfer option
This commit extends the 'doth' system test to verify that the new
extended 'allow-transfer' option syntax featuring 'port' and
'transport' parameters is supported and works as expected. That is, it
restricts the primary server to allow zone transfers only via XoT.

Additionally to that, it extends the 'checkonf' test with more
configuration file examples featuring the new syntax.
2021-11-30 12:20:22 +02:00
Artem Boldariev 0ee6f66cbd Integrate extended ACLs syntax featuring 'port' and 'transport' opts
This commit completes the integration of the new, extended ACL syntax
featuring 'port' and 'transport' options.

The runtime presentation and ACL loading code are extended to allow
the syntax to be used beyond the 'allow-transfer' option (e.g. in
'acl' definitions and other 'allow-*' options) and can be used to
ultimately extend the ACL support with transport-only
ACLs (e.g. 'transport-acl tls-acl port 853 transport tls'). But, due
to fundamental nature of such a change, it has not been completed as a
part of 9.17.X release series due to it being close to 9.18 stable
release status. That means that we do not have enough time to fully
test it.

The complete integration is planned as a part of 9.19.X release
series.

The code was manually verified to work as expected by temporarily
enabling the extended syntax for 'acl' statements and 'allow-query'
options, including ACL merging, negated ACLs.
2021-11-30 12:20:22 +02:00
Artem Boldariev af2d065c21 Extend ACL syntax handling code with 'port' and 'transport' options
This commit extends ACL syntax handling code with 'port' and
'transport' options. Currently, the extended syntax is available only
for allow-transfer options.
2021-11-30 12:20:22 +02:00
Artem Boldariev f0e18f3927 Add isc_nm_has_encryption()
This commit adds an isc_nm_has_encryption() function intended to check
if a given handle is backed by a connection which uses encryption.
2021-11-30 12:20:22 +02:00
Artem Boldariev 07cf827b0b Add isc_nm_socket_type()
This commit adds an isc_nm_socket_type() function which can be used to
obtain a handle's socket type.

This change obsoletes isc_nm_is_tlsdns_handle() and
isc_nm_is_http_handle(). However, it was decided to keep the latter as
we eventually might end up supporting multiple HTTP versions.
2021-11-30 12:20:22 +02:00
Artem Boldariev 7d7513ccce Merge branch 'artem-disable-unused-tls-syntax' into 'main'
Remove unused 'tls' clause options: 'ca-file' and 'hostname'

See merge request isc-projects/bind9!5600
2021-11-29 12:23:37 +00:00
Artem Boldariev afd53256a5 Modify CHANGES [GL !5600]
Mention that unused 'tls' clause options 'ca-file' and 'hostname' were
removed.
2021-11-29 14:03:58 +02:00
Artem Boldariev 78b73d0865 Disable unused 'tls' clause options: 'ca-file' and 'hostname'
This commit disables the unused 'tls' clause options. For these some
backing code exists, but their values are not really used anywhere,
nor there are sufficient syntax tests for them.

These options are only disabled temporarily, until TLS certificate
verification gets implemented.
2021-11-29 14:02:48 +02:00
Artem Boldariev 2fc4239ccb Merge branch '3022-doh-fix-dig-crash-on-unexpected-alpn' into 'main'
Resolve #3022: DoH: dig eventually aborts on ALPN negotiation failure when issuing a DoH query (because of dangling handles)

Closes #3022

See merge request isc-projects/bind9!5590
2021-11-26 08:53:24 +00:00
Artem Boldariev 44951f8cac Modify CHANGES [GL #3022]
Mention that [GL #3022] was resolved.
2021-11-26 10:24:24 +02:00
Artem Boldariev babc2749b5 DoH: Extend 'doth' test with a check if dig can detect ALPN failure
This commit extends the 'doth' system test to verify if 'dig' can
detect an properly recover after ALPN negotiation failure when making
a DoH query.
2021-11-26 10:23:17 +02:00
Artem Boldariev b211fff4cb TLS stream: disable TLS I/O debug log message by default
This commit makes the TLS stream code to not issue mostly useless
debug log message on error during TLS I/O. This message was cluttering
logs a lot, as it can be generated on (almost) any non-clean TLS
connection termination, even in the cases when the actual query
completed successfully. Nor does it provide much value for end-users,
yet it can occasionally be seen when using dig and quite often when
running BIND over a publicly available network interface.
2021-11-26 10:23:17 +02:00
Artem Boldariev 0b0c29dd51 DoH: Remove unneeded isc__nmsocket_prep_destroy() call
This commit removes unneeded isc__nmsocket_prep_destroy() call on ALPN
negotiation failure, which was eventually causing the TLS handle to
leak.

This call is not needed, as not attaching to the transport (TLS)
handle should be enough. At this point it seems like a kludge from
earlier days of the TLS code.
2021-11-26 10:23:17 +02:00
Matthijs Mekking c52a383523 Merge branch 'matthijs-fix-openssl-init-ssl-leak' into 'main'
Add OPENSSL_cleanup to tls_shutdown function

See merge request isc-projects/bind9!5593
2021-11-26 07:41:02 +00:00
Matthijs Mekking 89f4f8f0c8 Add OPENSSL_cleanup to tls_shutdown function
This prevents a direct leak in OPENSSL_init_crypto (called from
OPENSSL_init_ssl).

Add shim version of OPENSSL_cleanup because it is missing in LibreSSL on
OpenBSD.
2021-11-26 08:20:10 +01:00
Mark Andrews 929e070a59 Merge branch '3021-dns_sdlz_putrr-does-not-auto-increase-buffer' into 'main'
Resolve "dns_sdlz_putrr does not auto increase buffer"

Closes #3021

See merge request isc-projects/bind9!5588
2021-11-25 20:08:02 +00:00
Mark Andrews ed5d28088a Add CHANGES for [GL #3021] 2021-11-25 19:48:20 +00:00
Mark Andrews 6dc5248606 Exercise ISC_R_NOSPACE path in dns_sdlz_putrr
Use relative names when adding SOA record and a long domain
name to create SOA RR where the wire format is longer than
the initial buffer allocation in dns_sdlz_putrr.
2021-11-25 19:48:20 +00:00
Mark Andrews 08f1cba096 Do not convert ISC_R_NOSPACE to DNS_R_SERVFAIL too early
The parsing loop needs to process ISC_R_NOSPACE to properly
size the buffer.  If result is still ISC_R_NOSPACE at the end
of the parsing loop set result to DNS_R_SERVFAIL.
2021-11-25 19:48:20 +00:00
Michal Nowak bf0fce265a Merge branch 'mnowak/warning-array-subscript-is-of-type-char-on-netbsd-9' into 'main'
Fix "array subscript is of type 'char'" on NetBSD 9

See merge request isc-projects/bind9!5591
2021-11-25 17:53:35 +00:00
Michal Nowak d09447287f Fix "array subscript is of type 'char'" on NetBSD 9
In file included from rdata.c:602:
    In file included from ./code.h:88:
    ./rdata/in_1/svcb_64.c:259:9: warning: array subscript is of type 'char' [-Wchar-subscripts]
                            if (!isdigit(*region->base)) {
                                 ^~~~~~~~~~~~~~~~~~~~~~
    /usr/include/sys/ctype_inline.h:51:44: note: expanded from macro 'isdigit'
    #define isdigit(c)      ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_D))
                                                    ^~~~
2021-11-25 18:15:18 +01:00
Mark Andrews 0c2c7636f4 Merge branch '3024-doh_connect_makeuri-fails-on-illumos' into 'main'
Resolve "doh_connect_makeuri fails on illumos"

Closes #3024

See merge request isc-projects/bind9!5592
2021-11-25 12:58:21 +00:00
Mark Andrews 1092d8e25a use .s_addr to handle potential union in struct in_addr 2021-11-25 12:33:04 +00:00
Artem Boldariev 6bd1e6de94 Merge branch '3019-curl-check-http2-features' into 'main'
Fix doth test when curl without HTTP/2 support is unavailable

Closes #3019

See merge request isc-projects/bind9!5585
2021-11-25 09:19:30 +00:00
Artem Boldariev f6ef74b196 Fix doth test when curl without HTTP/2 support is unavailable
This commit makes the 'doth' system test skip HTTP headers check when
curl version is new enough but was compiled without HTTP/2 support.

This should fix the 'doth' system test for macOS systems using
macports.
2021-11-25 10:51:12 +02:00
Artem Boldariev 5069b58dc9 Merge branch 'artem-fix-xot-crash-on-unexpected-incoming-message' into 'main'
Fix a crash on unexpected incoming DNS message during XoT xfer

Closes #3004

See merge request isc-projects/bind9!5567
2021-11-24 09:40:15 +00:00
Artem Boldariev 61d824cd41 Add an entry to CHANGES [GL #3004]
Mentions that there is a fix to a bug in DoT code leading to an abort
when a zone transfer over TLS ends with an unexpected DNS message.
2021-11-24 11:19:21 +02:00
Artem Boldariev 6c8a97c78f Fix a crash on unexpected incoming DNS message during XoT xfer
This commit fixes a peculiar corner case in the client-side DoT code
because of which a crash could occur during a zone transfer. A junk
DNS message should be sent at the end of a zone transfer via TLS to
trigger the crash (abort).

This commit, hopefully, fixes that.

Also, this commit adds similar changes to the TCP DNS code, as it
shares the same origin and most of the logic.
2021-11-24 11:18:36 +02:00
Michał Kępień ce728098ab Merge branch '3002-fix-handling-of-mismatched-responses-past-timeout' into 'main'
Fix handling of mismatched responses past timeout

Closes #3002

See merge request isc-projects/bind9!5586
2021-11-23 14:40:40 +00:00
Michał Kępień 8f8a69aa0a Fix handling of mismatched responses past timeout
When a UDP dispatch receives a mismatched response, it checks whether
there is still enough time to wait for the correct one to arrive before
the timeout fires.  If there is not, the result code is set to
ISC_R_TIMEDOUT, but it is not subsequently used anywhere as 'response'
is set to NULL a few lines earlier.  This results in the higher-level
read callback (resquery_response() in case of resolver code) not being
called.  However, shortly afterwards, a few levels up the call chain,
isc__nm_udp_read_cb() calls isc__nmsocket_timer_stop() on the dispatch
socket, effectively disabling read timeout handling for that socket.
Combined with the fact that reading is not restarted in such a case
(e.g. by calling dispatch_getnext() from udp_recv()), this leads to the
higher-level query structure remaining referenced indefinitely because
the dispatch socket it uses will neither be read from nor closed due to
a timeout.  This in turn causes fetch contexts to linger around
indefinitely, which in turn i.a. prevents certain cache nodes (those
containing rdatasets used by fetch contexts, like fctx->nameservers)
from being cleaned.

Fix by making sure the higher-level callback does get invoked with the
ISC_R_TIMEDOUT result code when udp_recv() determines there is no more
time left to receive the correct UDP response before the timeout fires.
This allows the higher-level callback to clean things up, preventing the
reference leak described above.
2021-11-23 15:35:39 +01:00
Arаm Sаrgsyаn 87acddd760 Merge branch '1608-catz-reconfig-crash-fix' into 'main'
Fix catalog zone reconfiguration crash

Closes #1608

See merge request isc-projects/bind9!5481
2021-11-23 12:32:05 +00:00
Evan HuntandAram Sargsyan bb411af31d Add a regression test
Reconfigure the server without catalog-zone configuration, and then
put it back and reconfigure again, to confirm that there's no crash.
2021-11-23 11:41:50 +00:00
Aram Sargsyan e644738310 Add CHANGES and release notes for [GL #1608] 2021-11-23 11:41:48 +00:00
Aram Sargsyan 43ac2cd229 Fix catalog zone reconfiguration crash
The following scenario triggers a "named" crash:

1. Configure a catalog zone.
2. Start "named".
3. Comment out the "catalog-zone" clause.
4. Run `rndc reconfig`.
5. Uncomment the "catalog-zone" clause.
6. Run `rndc reconfig` again.

Implement the required cleanup of the in-memory catalog zone during
the first `rndc reconfig`, so that the second `rndc reconfig` could
find it in an expected state.
2021-11-23 11:39:37 +00:00
Evan Hunt 995d135b58 Merge branch '3013-resolver-test-failure' into 'main'
fix intermittent resolver test error

Closes #3013

See merge request isc-projects/bind9!5576
2021-11-22 23:18:57 +00:00
Evan Hunt 069625cccb fix intermittent resolver test error
the resolver test checks that the correct number of fetches have
been sent NS rrsets of a given size, but it formerly did so by
counting queries received by the authoritative server, which could
result in an off-by-one count if one of the queries had been resent
due to a timeout or a port number collision.

this commit changes the test to count fetches initiated by the
resolver, which should prevent the intermittent test failure, and
is the actual datum we were interested in anyway.
2021-11-22 14:59:02 -08:00
Mark Andrews 7991eb0bf8 Merge branch '3014-broken-ecdsa-signatures-may-be-generated-with-certain-private-keys' into 'main'
Resolve "Broken ECDSA signatures may be generated with certain private keys"

Closes #3014

See merge request isc-projects/bind9!5580
2021-11-22 22:04:30 +00:00
Mark Andrews f584df4614 Add CHANGES for [GL #3014] 2021-11-23 08:45:21 +11:00
Mark Andrews 34f3240622 Reject too long ECDSA public keys
opensslecdsa_fromdns() already rejects too short ECDSA public keys.
Make it also reject too long ones.  Remove an assignment made redundant
by this change.
2021-11-23 08:44:47 +11:00
Michał KępieńandMark Andrews a9ab2bf60b Pass key length to raw_key_to_ossl() by value
As raw_key_to_ossl() no longer stores anything at the pointer passed to
it in the 'key_len' parameter, change the type of the latter to size_t.
2021-11-23 08:44:47 +11:00
Michał KępieńandMark Andrews a482a6b204 Fix parsing ECDSA keys
raw_key_to_ossl() assumes fixed ECDSA private key sizes (32 bytes for
ECDSAP256SHA256, 48 bytes for ECDSAP384SHA384).  Meanwhile, in rare
cases, ECDSAP256SHA256 private keys are representable in 31 bytes or
less (similarly for ECDSAP384SHA384) and that is how they are then
stored in the "PrivateKey" field of the key file.  Nevertheless,
raw_key_to_ossl() always calls BN_bin2bn() with a fixed length argument,
which in the cases mentioned above leads to erroneously interpreting
uninitialized memory as a part of the private key.  This results in the
latter being malformed and broken signatures being generated.  Address
by using the key length provided by the caller rather than a fixed one.
Apply the same change to public key parsing code for consistency, adding
an INSIST() to prevent buffer overruns.
2021-11-23 08:44:47 +11:00
Mark Andrews dbeea1afa0 Don't use 'dnssec-signzone -P' unless necessary
Most of the test zones in the dnssec system test can be verified.
Use -z when only a single key is being used so that the verifier
knows that only a single key is in use.
2021-11-23 08:44:47 +11:00
Mark Andrews 77ca778377 Generate test zone with multiple NSEC and NSEC3 chains
The method used to generate a test zone with multiple NSEC and
NSEC3 chains was incorrect.  Multiple calls to dnssec-signzone
with multiple parameters is not additive.  Extract the chain on
each run then add them to the final signed zone instance.
2021-11-23 08:44:47 +11:00
Ondřej Surý e3ca3156a5 Merge branch '3018-resolver-crash' into 'main'
fix a use-after-free in resolver

Closes #3018

See merge request isc-projects/bind9!5584
2021-11-22 10:38:15 +00:00
Evan HuntandOndřej Surý 465353d9ca CHANGES for [GL #3018] 2021-11-22 11:35:34 +01:00
Evan HuntandOndřej Surý 326a4fc13b fix a use-after-free in resolver
when processing a mismatched response, we call dns_dispatch_getnext().
If that fails, for example because of a timeout, fctx_done() is called,
which cancels all queries. This triggers a crash afterward when
fctx_cancelquery() is called, and is unnecessary since fctx_done()
would have been called later anyway.
2021-11-22 11:35:34 +01:00
Ondřej Surý 949c3919a8 Merge branch '2978-fix-data-race-in-adb.c' into 'main'
Fix the data race when shutting down dns_adb

Closes #2978

See merge request isc-projects/bind9!5569
2021-11-22 10:29:02 +00:00
Ondřej Surý 7e002d89b4 Fix the data race when shutting down dns_adb
When dns_adb is shutting down, first the adb->shutting_down flag is set
and then task is created that runs shutdown_stage2() that sets the
shutdown flag on names and entries.  However, when dns_adb_createfind()
is called, only the individual shutdown flags are being checked, and the
global adb->shutting_down flag was not checked.  Because of that it was
possible for a different thread to slip in and create new find between
the dns_adb_shutdown() and dns_adb_detach(), but before the
shutdown_stage2() task is complete.  This was detected by
ThreadSanitizer as data race because the zonetable might have been
already detached by dns_view shutdown process and simultaneously
accessed by dns_adb_createfind().

This commit converts the adb->shutting_down to atomic_bool to prevent
the global adb lock when creating the find.
2021-11-22 11:09:21 +01:00
Matthijs Mekking 9d94720735 Merge branch '1836-extended-dns_errors' into 'main'
Set Extended EDNS Error (EDE) Prohibited (18)

See merge request isc-projects/bind9!4793
2021-11-19 09:58:26 +00:00
Matthijs Mekking 4354047f97 Test for EDE option with non-EDNS query
Add a test case to make sure the EDE option is not set on an EDNS
disabled query.
2021-11-19 09:44:28 +01:00
Matthijs Mekking 842fa76cdd Add CHANGES and release notes for EDE:18
New feature.
2021-11-19 09:44:28 +01:00
Matthijs Mekking f14964a1b1 Test for EDE option 18 in allow-query test
If a query is refused because of an ACL error, check that the extended
DNS error "Prohibited (18)" is set.
2021-11-19 09:44:28 +01:00
Matthijs Mekking ca7f2fd903 Add EDE to query messages
Add extended DNS error on refused queries. All instances are related to
unauthorized clients, so set extended DNS error code 18 (Prohibited).
2021-11-19 09:44:28 +01:00
Matthijs Mekking 6c8fc2f4f0 Add method to set extended DNS error
Add a new parameter to 'ns_client_t' to store potential extended DNS
error. Reset when the client request ends, or is put back.

Add defines for all well-known info-codes.

Update the number of DNS_EDNSOPTIONS that we are willing to set.

Create a new function to set the extended error for a client reply.
2021-11-19 09:44:28 +01:00
Matthijs Mekking 36503721f2 Merge branch 'doc-fix-cookie-algorithm-desc' into 'main'
[ISC-support #19862] Update docs to reflect changes to acceptable cookie-algorithm values

See merge request isc-projects/bind9!5573
2021-11-18 12:57:52 +00:00
Dan TheisenandMatthijs Mekking b29a748119 Update docs with correct cookie-algorithm values
The documentation was inconsistent with the code. The new description
for cookie-algorithm now reflects the current behavior.

The following two commits are the relevant code changes to this
section of docs: afa81ee4 a912f313
2021-11-18 13:26:12 +01:00
Michał Kępień a814f72261 Merge branch 'v9_17_20-release' into 'main'
Merge 9.17.20 release branch

See merge request isc-projects/bind9!5581
2021-11-18 08:14:40 +00:00
Michał Kępień d0940f87b6 Set up release notes for BIND 9.17.21 2021-11-18 09:00:07 +01:00
Michał Kępień 50ea1f5fc4 Update BIND version to 9.17.20 2021-11-18 09:00:07 +01:00
Michał Kępień 27abbbafeb Add a CHANGES marker 2021-11-18 09:00:07 +01:00
Michał Kępień ac870ec6d6 Merge branch 'michal/prepare-documentation-for-bind-9.17.20' into 'v9_17_20-release'
Prepare documentation for BIND 9.17.20

See merge request isc-private/bind9!335
2021-11-18 09:00:07 +01:00
Michał Kępień adf37a9d59 Prepare release notes for BIND 9.17.20 2021-11-18 09:00:07 +01:00
Michał Kępień 02b1a18db2 Reorder release notes 2021-11-18 09:00:07 +01:00
Michał Kępień 075f03d37f Tweak and reword release notes 2021-11-18 09:00:07 +01:00
Evan Hunt 00d379da8e Merge branch '2374-mdig-ephemeral' into 'main'
Make mdig use the OS-supplied ephemeral port range

Closes #2374

See merge request isc-projects/bind9!5552
2021-11-17 22:38:50 +00:00
Evan Hunt 0fecb10c17 Make mdig use the OS-supplied ephemeral port range
mdig was always using the default 1024-65535 range for outgoing
messages, instead of using the system's configured ephemeral ports.
2021-11-17 14:13:17 -08:00
Evan Hunt f6fc9d8c61 Merge branch 'each-fix-warnings' into 'main'
address '--disable-doh' failures

See merge request isc-projects/bind9!5561
2021-11-17 22:11:36 +00:00
Evan Hunt 7f63ee3bae address '--disable-doh' failures
Change 5756 (GL #2854) introduced build errors when using
'configure --disable-doh'.  To fix this, isc_nm_is_http_handle() is
now defined in all builds, not just builds that have DoH enabled.

Missing code comments were added both for that function and for
isc_nm_is_tlsdns_handle().
2021-11-17 13:48:43 -08:00
Mark Andrews a58859b197 Merge branch '3012-begin-end-dnssec-managed-keys-in-bin-named-config-c-are-mismatched' into 'main'
Resolve "BEGIN/END DNSSEC/MANAGED KEYS in bin/named/config.c are mismatched."

Closes #3012

See merge request isc-projects/bind9!5575
2021-11-16 21:44:21 +00:00
Mark Andrews 1d7b1f74c9 Embed NAMED_SYSCONFDIR contents in the bind.keys comment 2021-11-16 14:39:05 +11:00
Mark Andrews 43a7f3f532 Update comments around built in trust anchors
The comments now say "# BEGIN TRUST ANCHORS" and "# END TRUST ANCHORS".
2021-11-16 14:36:10 +11:00
Ondřej Surý 92823f9424 Merge branch 'ondrej/update-flycheck-configuration-on-Linux' into 'main'
Add flycheck configuration for libxml2 and json-c on Linux

See merge request isc-projects/bind9!5570
2021-11-15 11:33:37 +00:00
Ondřej Surý 41f86440c4 Add flycheck configuration for libxml2 and json-c on Linux 2021-11-15 12:31:48 +01:00
Mark Andrews e8d1dd30bc Merge branch '3003-greedy-regular-expression-causes-intermittent-nsupdate-system-test-failures' into 'main'
Resolve "Greedy regular expression causes intermittent "nsupdate" system test failures"

Closes #3003

See merge request isc-projects/bind9!5559
2021-11-10 01:49:43 +00:00
Mark Andrews c1df7884f0 Add CHANGES note for [GL #3003] 2021-11-10 12:13:34 +11:00
Mark Andrews be879cda72 Replace incorrect sed expersion with awk
The sed expression could find the wrong instance of 10.
Use awk to replace the TTL field and also to specify the
server and issue the send command.
2021-11-10 12:09:51 +11:00
Petr Špaček ed99c502b6 Merge branch 'pspacek/ci-jobs-interruptible' into 'main'
Automatically cancel CI jobs on outdated branches

See merge request isc-projects/bind9!5558
2021-11-09 10:54:39 +00:00
Petr Špaček 02b438fadf Automatically cancel CI jobs on outdated branches
Gitlab feature
https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-redundant-pipelines
can automatically cancel jobs which operate on an outdated code, i.e. on
branches which received new commits while jobs with an older set of
commits are still running. For this feature to work jobs have to be
configured with boolean interruptible: true.

I think practically all of our current CI jobs can be cancelled,
so the option is now on by default for all jobs.
2021-11-09 11:21:34 +01:00
Petr Špaček a3ea4fec2a Merge branch 'pspacek/gitlab-ci-cleanup' into 'main'
Remove obsolete PYTHONPATH setting from .gitlab-ci.yaml

See merge request isc-projects/bind9!5563
2021-11-09 09:54:51 +00:00
Petr Špaček 310a15ac94 Remove obsolete PYTHONPATH setting from .gitlab-ci.yaml
It was leftover after removing Python tools in commit
98b3b93791.
2021-11-09 10:24:42 +01:00
Petr Špaček 05eab7cf8f Merge branch '2779-wildcard_test_property_based' into 'main'
Add property based test for wildcard expansion

See merge request isc-projects/bind9!5203
2021-11-08 13:20:50 +00:00
Petr Špaček 6495e59a4c Fix system test .status file cleanup 2021-11-08 13:23:22 +01:00
Petr Špaček 49da19c353 Add new system test for wildcard expansion
This is almost minimal prototype to show how to use python-hypothesis
library in a system test. It does not fully replace existing shell-based
system test for wildcards.
2021-11-08 13:23:05 +01:00
Petr Špaček 8ce4759c5c Use more liberal pylint for tests
Ignore wrong-import-position to enable use of pytest.importorskip.
2021-11-08 13:23:05 +01:00
Petr Špaček 1a80e641e9 Use more liberal flake8 for tests
Ignore rule W402 (wrong import order) to enable use of
pytest.importorskip.
2021-11-08 13:23:05 +01:00
Petr Špaček b8829c801f Allow py.test system test to skip itself
Enable use of shortcuts like pytest.importorskip and other tricks
which can cause test to skip itself.
2021-11-08 13:23:03 +01:00
Artem Boldariev 4589146eb1 Merge branch '2854-cache-control-max-age' into 'main'
Resolve #2854: DoH:  Assign HTTP responses freshness lifetime according to the smallest TTL found in the Answer section

Closes #2854

See merge request isc-projects/bind9!5493
2021-11-05 13:02:52 +00:00
Artem Boldariev 2a340ee510 Modify the CHANGES file [GL #2854]
Mentions that we now assign HTTP freshness lifetime to responses sent
over DNS-over-HTTPS.
2021-11-05 14:14:59 +02:00
Evan HuntandArtem Boldariev 03564ba982 add a max-age test to doth system test
use curl, when available, to query for names that do and do not
exist; dump the response headers and check for the expected
max-age value.
2021-11-05 14:14:59 +02:00
Artem Boldariev 51a2c7aed3 DoH: Set the "max-age" "Cache-Control" HTTP header value
This commit makes BIND set the "max-age" value of the "Cache-Control"
HTTP header to the minimal TTL from the Answer section for positive
answers, as RFC 8484 advises in section 5.1.

We calculate the minimal TTL as a side effect of rendering the
response DNS message, so it does not change the code flow much, nor
should it have any measurable negative impact on the performance.

For negative answers, the "max-age" value is set using the TTL and
SOA-minimum values from an SOA record in the Authority section.
2021-11-05 14:14:59 +02:00
Artem Boldariev 80482f8d3e DoH: Add isc_nm_set_min_answer_ttl()
This commit adds an isc_nm_set_min_answer_ttl() function which is
intended to to be used to give a hint to the underlying transport
regarding the answer TTL.

The interface is intentionally kept generic because over time more
transports might benefit from this functionality, but currently it is
intended for DoH to set "max-age" value within "Cache-Control" HTTP
header (as recommended in the RFC8484, section 5.1 "Cache
Interaction").

It is no-op for other DNS transports for the time being.
2021-11-05 14:14:59 +02:00
Michał Kępień b69dfd6a75 Merge branch 'pspacek/stats_version_fix' into 'main'
Fix incorrect version bump in statistics channels

See merge request isc-projects/bind9!5557
2021-11-05 06:42:33 +00:00
Petr ŠpačekandEvan Hunt 660d502c64 Fix incorrect version bump in statistics channels
The version number for the XML statistics channel was not incremented
correctly after removal of isc_socket code in
a55589f881, and the JSON version number
was not incremented at all.
2021-11-04 18:45:36 -07:00
Evan Hunt b3aba19582 Merge branch '2973-http-buffer-fix' into 'main'
statschannel doesn't handle multiple reads correctly

Closes #2973

See merge request isc-projects/bind9!5530
2021-11-05 01:09:44 +00:00
Evan Hunt 5f05cf97c7 CHANGES for [GL #2973] 2021-11-04 17:08:53 -07:00
Mark AndrewsandEvan Hunt 0b83f1495d Handle truncating the request stream in isc_httpd
If we have had to truncate the request stream, don't resume
reading from it.
2021-11-04 17:06:36 -07:00
Mark AndrewsandEvan Hunt 49531e4582 Handle HTTP/1.1 pipelined requests
Check to see whether there are outstanding requests in the
httpd receive buffer after sending the response, and if so,
process them.

Test that pipelined requests are handled by sending multiple
minimal HTTP/1.1 using netcat (nc) and checking that we get
back the same number of responses.
2021-11-04 17:05:29 -07:00
Mark AndrewsandEvan Hunt e46c64bf42 Consume the HTTP headers after processing a request
Remember the amount of space consumed by the HTTP headers, then
move any trailing data to the start of the httpd->recvbuf once
we have finished processing the request.
2021-11-04 17:00:18 -07:00
Evan HuntandMark Andrews cbf8c2e019 statschannel doesn't handle multiple reads correctly
if an incoming HTTP request is incomplete, but nothing else is clearly
wrong with it, the stats channel continues reading to see if there's
more coming.  the buffer length was not being processed correctly in
this case.  also, the server state was not reset correctly when the
request was complete, so that subsequent requests could be appended to
the first buffer instead of being treated as new.

in addition fixing the above problems, this commit also increases the
size of the httpd request buffer from 1024 to 4096, because some
browsers send a lot of headers.
2021-11-04 15:52:58 +11:00
Mark Andrews 76375797b5 Merge branch '2998-cid-340918-uninitialized-variables-uninit' into 'main'
Resolve "CID 340918: Uninitialized variables (UNINIT)"

Closes #2998

See merge request isc-projects/bind9!5556
2021-11-03 09:50:53 +00:00
Mark Andrews 6b6c89b3ea Silence Coverity false positive
Coverity if failing to determine that 'priv.elements[i].length' is
actually valid when 'buf[i]' is non-NULL.  Initialise 'priv' to
zeros.
2021-11-03 20:10:34 +11:00
Michal Nowak 4bebcd4503 Merge branch 'mnowak/fix-typo-in-dns_name_copy-with-result.spatch' into 'main'
Fix typo in dns_name_copy-with-result.spatch

See merge request isc-projects/bind9!5549
2021-11-02 18:27:34 +00:00
Michal Nowak a0d0dee4af Fix typo in dns_name_copy-with-result.spatch
A typo introduced in f3f1cab05e prevents
execution of the dns_name_copy-with-result.spatch. The replacement
should end with semicolon not a colon:

    plus: parse error:
      File "cocci/dns_name_copy-with-result.spatch", line 28, column 23, charpos = 421
      around = ':',
      whole content = + dns_name_copy(E1, E2):
2021-11-02 19:16:41 +01:00
Mark Andrews 26a9c4fba9 Merge branch '2970-bind9-xsl-is-not-properly-transmitted-over-stats-channel' into 'main'
Resolve "bind9.xsl is not properly transmitted over stats channel"

Closes #2970

See merge request isc-projects/bind9!5522
2021-11-02 11:44:44 +00:00
Mark Andrews 04e3ba0b51 Check that bind9.xsl is properly transmitted 2021-11-02 11:18:45 +00:00
Mark Andrews 5bde56a4bb Add '\n' to the end of each line when generating xsl.c
This makes the bind9.xml more readable in a browser when debugging
and also ensures that the file is properly terminated in the HTTP
transaction.
2021-11-02 11:18:45 +00:00
Mark Andrews d051de17de Merge branch '2993-replace-instances-of-arraysize-with-array_size' into 'main'
Resolve "Replace instances of ARRAYSIZE with ARRAY_SIZE"

Closes #2993

See merge request isc-projects/bind9!5551
2021-11-02 10:57:45 +00:00
Mark Andrews 22662fc28e Replace ARRAYSIZE with ARRAY_SIZE 2021-11-02 16:14:40 +11:00
Mark Andrews a174dfb462 Merge branch '2991-address-reported-by-coverity-in-updated-openssl-code' into 'main'
Resolve "Address reports by Coverity in updated OpenSSL code"

Closes #2991

See merge request isc-projects/bind9!5547
2021-11-01 22:37:43 +00:00
Mark Andrews 7806615714 Address bugs in opensslrsa_tofile
1) if 'key->external' is set we just need to call
   dst__privstruct_writefile
2) the cleanup of 'bufs' was incorrect as 'i' doesn't reflect the
   the current index into 'bufs'.  Use a simple for loop.

This review was triggered by Coverity reporting a buffer overrun
on 'bufs'.
2021-11-01 21:50:47 +00:00
Mark Andrews 573a5858fa Address potential memory leak in openssldh_parse()
'dh' was being assigned to key->keydata.dh too soon which could
result in a memory leak on error.  Moved the assignement of
key->keydata.dh until after dh was correct.

Coverity was reporting dead code on the error path cleaning up 'dh'
which triggered this review.
2021-11-01 21:50:47 +00:00
Michal Nowak dfd040a5aa Merge branch 'mnowak/dst-fix-unavailable-comparekeys' into 'main'
Add comparekeys to release tarball

See merge request isc-projects/bind9!5548
2021-11-01 17:48:12 +00:00
Michal Nowak 41c8bb0ad3 Add comparekeys to release tarball
'make dist' omits lib/dns/tests/comparekeys/ (added in
7101afa23c) from release tarball it
creates which makes the unit:gcc:tarball CI job permanently fail in the
dst unit test.
2021-11-01 15:17:31 +01:00
141 changed files with 3506 additions and 576 deletions
+3
View File
@@ -73,6 +73,9 @@
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/rndc/include"))
(expand-file-name "/usr/include/libxml2")
(expand-file-name "/usr/include/json-c")
(expand-file-name "/usr/local/opt/openssl@1.1/include")
(expand-file-name "/usr/local/opt/libxml2/include/libxml2")
(expand-file-name "/usr/local/opt/json-c/include/json-c/")
+13 -3
View File
@@ -47,6 +47,13 @@ variables:
BIND_STRESS_TEST_OS: linux
BIND_STRESS_TEST_ARCH: amd64
# Allow all running CI jobs to be automatically canceled when a new
# version of a branch is pushed.
#
# See: https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-redundant-pipelines
default:
interruptible: true
stages:
- autoconf
- precheck
@@ -481,7 +488,9 @@ flake8:
artifacts: true
script:
- *configure
- flake8 --max-line-length=80 $(git ls-files '*.py' | grep -vE '(ans\.py|dangerfile\.py)')
- flake8 --max-line-length=80 $(git ls-files '*.py' | grep -vE '(ans\.py|dangerfile\.py|^bin/tests/system/)')
# Ignore Flake8 E402 error (module level import not at top of file) in system test to enable use of pytest.importorskip
- flake8 --max-line-length=80 --extend-ignore=E402 $(git ls-files 'bin/tests/system/*.py' | grep -vE 'ans\.py')
pylint:
<<: *default_triggering_rules
@@ -492,8 +501,9 @@ pylint:
artifacts: true
script:
- *configure
- PYTHONPATH="$PYTHONPATH:$CI_PROJECT_DIR/bin/python"
- pylint --rcfile $CI_PROJECT_DIR/.pylintrc $(git ls-files '*.py' | grep -vE '(ans\.py|dangerfile\.py)')
- pylint --rcfile $CI_PROJECT_DIR/.pylintrc $(git ls-files '*.py' | grep -vE '(ans\.py|dangerfile\.py|^bin/tests/system/)')
# Ignore Pylint wrong-import-position error in system test to enable use of pytest.importorskip
- pylint --rcfile $CI_PROJECT_DIR/.pylintrc --disable=wrong-import-position $(git ls-files 'bin/tests/system/*.py' | grep -vE 'ans\.py')
tarball-create:
stage: precheck
+69
View File
@@ -1,3 +1,72 @@
5772. [bug] The resolver could hang on shutdown due to dispatch
resources not being cleaned up when a TCP connection
was reset. [GL #3026]
5771. [bug] Use idn2 UseSTD3ASCIIRules=false to disable additional
unicode validity checks because enabling the additional
checks would break valid domain names that contains
non-alphanumerical characters such as underscore
character (_) or wildcard (*). This reverts change
[GL !5738] from the previous release. [GL #1610]
5770. [func] BIND could abort on startup on systems using old
OpenSSL versions when 'protocols' option is used inside
a 'tls' statement. [GL !5602]
5769. [func] Added support for client-side 'tls' parameters when
doing incoming zone transfers via XoT. [GL !5602]
5768. [bug] dnssec-dsfromkey failed to omit revoked keys. [GL #853]
5767. [func] Extend allow-transfer option with 'port' and
'transport' options to restrict zone transfers to
a specific port and DNS transport protocol.
[GL #2776]
5766. [func] Unused 'tls' clause options 'ca-file' and 'hostname'
were disabled. [GL !5600]
5765. [bug] Fix a bug in DoH implementation making 'dig'
abort when ALPN negotiation fails. [GL #3022]
5764. [bug] dns_sdlz_putrr failed to process some valid resource
records. [GL #3021]
5763. [bug] Fix a bug in DoT code leading to an abort when
a zone transfer ends with an unexpected DNS message.
[GL #3004]
5762. [bug] Fix a "named" crash related to removing and restoring a
`catalog-zone` entry in the configuration file and
running `rndc reconfig`. [GL #1608]
5761. [bug] OpenSSL 3.0.0 support could fail to correctly read
ECDSA private keys leading to incorrect signatures
being generated. [GL #3014]
5760. [bug] Prevent a possible use-after-free error in resolver.
[GL #3018]
5759. [func] Set Extended DNS Error Code 18 - Prohibited if query
access is denied to the specific client. [GL #1836]
5758. [bug] mdig now honors the operating system's preferred
ephemeral port range. [GL #2374]
5757. [test] Replace sed in nsupdate system test with awk to
construct the nsupdate command. The sed expression
was not reliably changing the ttl. [GL #3003]
5756. [func] Assign HTTP freshness lifetime to responses sent
via DNS-over-HTTPS, according to the recommendations
given in RFC 8484. [GL #2854]
--- 9.17.20 released ---
5755. [bug] The statistics channel wasn't correctly handling
multiple HTTP requests, or pipelined or truncated
requests. [GL #2973]
5754. [bug] "tls" statements may omit "key-file" and "cert-file",
but if either one is specified, then both must be.
[GL #2986]
+6 -12
View File
@@ -3149,7 +3149,7 @@ launch_next_query(dig_query_t *query) {
xfr = query->lookup->rdtype == dns_rdatatype_ixfr ||
query->lookup->rdtype == dns_rdatatype_axfr;
if (xfr && isc_nm_is_tlsdns_handle(query->handle) &&
if (xfr && isc_nm_socket_type(query->handle) == isc_nm_tlsdnssocket &&
!isc_nm_xfr_allowed(query->handle))
{
dighost_error("zone transfers over the "
@@ -4365,9 +4365,7 @@ idn_locale_to_ace(const char *src, char *dst, size_t dstlen) {
* We trust libidn2 to return an error if 'src' is too large to be a
* valid domain name.
*/
res = idn2_to_ascii_lz(src, &ascii_src,
IDN2_NONTRANSITIONAL |
IDN2_USE_STD3_ASCII_RULES);
res = idn2_to_ascii_lz(src, &ascii_src, IDN2_NONTRANSITIONAL);
if (res != IDN2_OK) {
fatal("'%s' is not a legal IDNA2008 name (%s), use +noidnin",
src, idn2_strerror(res));
@@ -4422,7 +4420,7 @@ idn_ace_to_locale(const char *src, char **dst) {
*
* First, convert 'src' to UTF-8, ignoring the current locale.
*/
res = idn2_to_unicode_8z8z(src, &utf8_src, IDN2_USE_STD3_ASCII_RULES);
res = idn2_to_unicode_8z8z(src, &utf8_src, 0);
if (res != IDN2_OK) {
fatal("Bad ACE string '%s' (%s), use +noidnout", src,
idn2_strerror(res));
@@ -4431,9 +4429,7 @@ idn_ace_to_locale(const char *src, char **dst) {
/*
* Then, check whether decoded 'src' is a valid IDNA2008 name.
*/
res = idn2_to_ascii_8z(utf8_src, NULL,
IDN2_NONTRANSITIONAL |
IDN2_USE_STD3_ASCII_RULES);
res = idn2_to_ascii_8z(utf8_src, NULL, IDN2_NONTRANSITIONAL);
if (res != IDN2_OK) {
fatal("'%s' is not a legal IDNA2008 name (%s), use +noidnout",
src, idn2_strerror(res));
@@ -4443,13 +4439,11 @@ idn_ace_to_locale(const char *src, char **dst) {
* Finally, try converting the decoded 'src' into the current locale's
* character encoding.
*/
res = idn2_to_unicode_8zlz(utf8_src, &local_src,
IDN2_USE_STD3_ASCII_RULES);
res = idn2_to_unicode_8zlz(utf8_src, &local_src, 0);
if (res != IDN2_OK) {
static bool warned = false;
res = idn2_to_ascii_8z(utf8_src, &local_src,
IDN2_USE_STD3_ASCII_RULES);
res = idn2_to_ascii_8z(utf8_src, &local_src, 0);
if (res != IDN2_OK) {
fatal("Cannot represent '%s' "
"in the current locale nor ascii (%s), "
+4
View File
@@ -260,6 +260,10 @@ emit(dns_dsdigest_t dt, bool showall, bool cds, dns_rdata_t *rdata) {
fatal("can't convert DNSKEY");
}
if ((dnskey.flags & DNS_KEYFLAG_REVOKE) != 0) {
return;
}
if ((dnskey.flags & DNS_KEYFLAG_KSK) == 0 && !showall) {
return;
}
+4
View File
@@ -43,6 +43,10 @@ Description
The ``dnssec-dsfromkey`` command outputs DS (Delegation Signer) resource records
(RRs), or CDS (Child DS) RRs with the ``-C`` option.
By default, only KSKs are converted (keys with flags = 257). The
``-A`` option includes ZSKs (flags = 256). Revoked keys are never
included.
The input keys can be specified in a number of ways:
By default, ``dnssec-dsfromkey`` reads a key file named in the format
+1 -1
View File
@@ -47,7 +47,7 @@ xsl.c: bind9.xsl Makefile
(echo 'const char xslmsg[] =' && \
$(SED) -e 's,\",\\\",g' \
-e 's,^,\",' \
-e 's,$$,\",' && \
-e 's,$$,\\n\",' && \
echo ";") \
< "${srcdir}/bind9.xsl" > $@
+4 -2
View File
@@ -11,8 +11,10 @@
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
<xsl:output method="html" indent="yes" version="5.0"/>
<xsl:template match="statistics[@version=&quot;3.11&quot;]">
<xsl:output method="html" indent="yes" version="4.0"/>
<!-- the version number **below** must match version in bin/named/statschannel.c -->
<!-- don't forget to update "/xml/v<STATS_XML_VERSION_MAJOR>" in the HTTP endpoints listed below -->
<xsl:template match="statistics[@version=&quot;3.12&quot;]">
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
+5 -5
View File
@@ -163,8 +163,8 @@ options {\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\
min-ncache-ttl 86400; /* hack for measurements */\n\
min-cache-ttl 86400; /* hack for measurements */\n\
minimal-any false;\n\
minimal-responses no-auth-recursive;\n\
notify-source *;\n\
@@ -286,14 +286,14 @@ view \"_bind\" chaos {\n\
"#\n\
# Default trusted key(s), used if \n\
# \"dnssec-validation auto;\" is set and\n\
# sysconfdir/bind.keys doesn't exist).\n\
# " NAMED_SYSCONFDIR "/bind.keys doesn't exist).\n\
#\n\
# BEGIN DNSSEC KEYS\n"
# BEGIN TRUST ANCHORS\n"
/* Imported from bind.keys.h: */
TRUST_ANCHORS
"# END MANAGED KEYS\n\
"# END TRUST ANCHORS\n\
\n\
primaries " DEFAULT_IANA_ROOT_ZONE_PRIMARIES " {\n\
2001:500:200::b; # b.root-servers.net\n\
+8 -6
View File
@@ -166,7 +166,8 @@ OPTIONS
allow-query-on { address_match_element; ... };
allow-recursion { address_match_element; ... };
allow-recursion-on { address_match_element; ... };
allow-transfer { address_match_element; ... };
allow-transfer [ port integer ] [ transport string ] {
address_match_element; ... };
allow-update { address_match_element; ... };
allow-update-forwarding { address_match_element; ... };
also-notify [ port integer ] [ dscp integer ] { (
@@ -561,11 +562,9 @@ TLS
::
tls string {
ca-file quoted_string;
cert-file quoted_string;
ciphers string;
dhparam-file quoted_string;
hostname quoted_string;
key-file quoted_string;
prefer-server-ciphers boolean;
protocols { string; ... };
@@ -607,7 +606,8 @@ VIEW
allow-query-on { address_match_element; ... };
allow-recursion { address_match_element; ... };
allow-recursion-on { address_match_element; ... };
allow-transfer { address_match_element; ... };
allow-transfer [ port integer ] [ transport string ] {
address_match_element; ... };
allow-update { address_match_element; ... };
allow-update-forwarding { address_match_element; ... };
also-notify [ port integer ] [ dscp integer ] { (
@@ -891,7 +891,8 @@ VIEW
allow-notify { address_match_element; ... };
allow-query { address_match_element; ... };
allow-query-on { address_match_element; ... };
allow-transfer { address_match_element; ... };
allow-transfer [ port integer ] [ transport string ] {
address_match_element; ... };
allow-update { address_match_element; ... };
allow-update-forwarding { address_match_element; ... };
also-notify [ port integer ] [ dscp integer ] { (
@@ -1011,7 +1012,8 @@ ZONE
allow-notify { address_match_element; ... };
allow-query { address_match_element; ... };
allow-query-on { address_match_element; ... };
allow-transfer { address_match_element; ... };
allow-transfer [ port integer ] [ transport string ] {
address_match_element; ... };
allow-update { address_match_element; ... };
allow-update-forwarding { address_match_element; ... };
also-notify [ port integer ] [ dscp integer ] { (
+4 -6
View File
@@ -152,10 +152,6 @@
#define SIZE_AS_PERCENT ((size_t)-2)
#endif /* ifndef SIZE_AS_PERCENT */
#ifndef ARRAYSIZE
#define ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))
#endif
#ifdef TUNE_LARGE
#define RESOLVER_NTASKS_PERCPU 32
#else
@@ -5829,7 +5825,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
}
name = dns_fixedname_initname(&fixed);
for (ipv4only_zone = 0; ipv4only_zone < ARRAYSIZE(zones);
for (ipv4only_zone = 0; ipv4only_zone < ARRAY_SIZE(zones);
ipv4only_zone++) {
dns_forwarders_t *dnsforwarders = NULL;
@@ -6661,6 +6657,8 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
if (zone_is_catz) {
dns_zone_catz_enable(zone, view->catzs);
} else if (dns_zone_catz_is_enabled(zone)) {
dns_zone_catz_disable(zone);
}
/*
@@ -11398,7 +11396,7 @@ resume:
if (dctx->dumpexpired) {
style = &dns_master_style_cache_with_expired;
} else {
style = &dns_master_style_cache;
style = &dns_master_style_full; /* hack for measurements */
}
/* start cache dump */
if (dctx->view->view->cachedb != NULL) {
+43 -19
View File
@@ -52,6 +52,14 @@
#include "xsl_p.h"
#define STATS_XML_VERSION_MAJOR "3"
#define STATS_XML_VERSION_MINOR "12"
#define STATS_XML_VERSION STATS_XML_VERSION_MAJOR "." STATS_XML_VERSION_MINOR
#define STATS_JSON_VERSION_MAJOR "1"
#define STATS_JSON_VERSION_MINOR "6"
#define STATS_JSON_VERSION STATS_JSON_VERSION_MAJOR "." STATS_JSON_VERSION_MINOR
#define CHECK(m) \
do { \
result = (m); \
@@ -1991,7 +1999,7 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
"href=\"/bind9.xsl\""));
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "statistics"));
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "version",
ISC_XMLCHAR "3.11"));
ISC_XMLCHAR STATS_XML_VERSION));
/* Set common fields for statistics dump */
dumparg.type = isc_statsformat_xml;
@@ -2778,7 +2786,7 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
/*
* These statistics are included no matter which URL we use.
*/
obj = json_object_new_string("1.5");
obj = json_object_new_string(STATS_JSON_VERSION);
CHECKMEM(obj);
json_object_object_add(bindstats, "json-stats-version", obj);
@@ -3599,42 +3607,58 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml", false, render_xml_all,
server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/xml/v" STATS_XML_VERSION_MAJOR, false,
render_xml_all, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/status", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/xml/v" STATS_XML_VERSION_MAJOR "/status", false,
render_xml_status, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/server", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/xml/v" STATS_XML_VERSION_MAJOR "/server", false,
render_xml_server, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/zones", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/xml/v" STATS_XML_VERSION_MAJOR "/zones", false,
render_xml_zones, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/net", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/xml/v" STATS_XML_VERSION_MAJOR "/net", false,
render_xml_net, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/tasks", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/xml/v" STATS_XML_VERSION_MAJOR "/tasks", false,
render_xml_tasks, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/mem", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/xml/v" STATS_XML_VERSION_MAJOR "/mem", false,
render_xml_mem, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/xml/v3/traffic", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/xml/v" STATS_XML_VERSION_MAJOR "/traffic", false,
render_xml_traffic, server);
#endif /* ifdef HAVE_LIBXML2 */
#ifdef HAVE_JSON_C
isc_httpdmgr_addurl(listener->httpdmgr, "/json", false, render_json_all,
server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/json/v" STATS_JSON_VERSION_MAJOR, false,
render_json_all, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/status", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/json/v" STATS_JSON_VERSION_MAJOR "/status", false,
render_json_status, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/server", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/json/v" STATS_JSON_VERSION_MAJOR "/server", false,
render_json_server, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/zones", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/json/v" STATS_JSON_VERSION_MAJOR "/zones", false,
render_json_zones, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/tasks", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/json/v" STATS_JSON_VERSION_MAJOR "/tasks", false,
render_json_tasks, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/net", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/json/v" STATS_JSON_VERSION_MAJOR "/net", false,
render_json_net, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/mem", false,
isc_httpdmgr_addurl(listener->httpdmgr,
"/json/v" STATS_JSON_VERSION_MAJOR "/mem", false,
render_json_mem, server);
isc_httpdmgr_addurl(listener->httpdmgr, "/json/v1/traffic", false,
render_json_traffic, server);
isc_httpdmgr_addurl(listener->httpdmgr,
"/json/v" STATS_JSON_VERSION_MAJOR "/traffic",
false, render_json_traffic, server);
#endif /* ifdef HAVE_JSON_C */
isc_httpdmgr_addurl(listener->httpdmgr, "/bind9.xsl", true, render_xsl,
server);
+67
View File
@@ -47,6 +47,47 @@
} \
}
#define parse_transport_tls_versions(map, transport, name, setter) \
{ \
const cfg_obj_t *obj = NULL; \
cfg_map_get(map, name, &obj); \
if (obj != NULL) { \
{ \
uint32_t tls_protos = 0; \
const cfg_listelt_t *proto = NULL; \
INSIST(obj != NULL); \
for (proto = cfg_list_first(obj); proto != 0; \
proto = cfg_list_next(proto)) { \
const cfg_obj_t *tls_proto_obj = \
cfg_listelt_value(proto); \
const char *tls_sver = \
cfg_obj_asstring( \
tls_proto_obj); \
const isc_tls_protocol_version_t ver = \
isc_tls_protocol_name_to_version( \
tls_sver); \
INSIST(ver != \
ISC_TLS_PROTO_VER_UNDEFINED); \
INSIST(isc_tls_protocol_supported( \
ver)); \
tls_protos |= ver; \
} \
if (tls_protos != 0) { \
setter(transport, tls_protos); \
} \
} \
} \
}
#define parse_transport_bool_option(map, transport, name, setter) \
{ \
const cfg_obj_t *obj = NULL; \
cfg_map_get(map, name, &obj); \
if (obj != NULL) { \
setter(transport, cfg_obj_asboolean(obj)); \
} \
}
static isc_result_t
add_doh_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
const cfg_obj_t *doh = NULL;
@@ -71,10 +112,23 @@ add_doh_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
dns_transport_set_keyfile);
parse_transport_option(doh, transport, "cert-file",
dns_transport_set_certfile);
parse_transport_tls_versions(doh, transport, "protocols",
dns_transport_set_tls_versions);
parse_transport_option(doh, transport, "ciphers",
dns_transport_set_ciphers);
parse_transport_bool_option(
doh, transport, "prefer-server-ciphers",
dns_transport_set_prefer_server_ciphers)
#if 0
/*
* The following two options need to remain unavailable until
* TLS certificate verification gets implemented.
*/
parse_transport_option(doh, transport, "ca-file",
dns_transport_set_cafile);
parse_transport_option(doh, transport, "hostname",
dns_transport_set_hostname);
#endif
}
return (ISC_R_SUCCESS);
@@ -115,10 +169,23 @@ add_tls_transports(const cfg_obj_t *transportlist, dns_transport_list_t *list) {
dns_transport_set_keyfile);
parse_transport_option(tls, transport, "cert-file",
dns_transport_set_certfile);
parse_transport_tls_versions(tls, transport, "protocols",
dns_transport_set_tls_versions);
parse_transport_option(tls, transport, "ciphers",
dns_transport_set_ciphers);
parse_transport_bool_option(
tls, transport, "prefer-server-ciphers",
dns_transport_set_prefer_server_ciphers)
#if 0
/*
* The following two options need to remain unavailable until
* TLS certificate verification gets implemented.
*/
parse_transport_option(tls, transport, "ca-file",
dns_transport_set_cafile);
parse_transport_option(tls, transport, "hostname",
dns_transport_set_hostname);
#endif
}
return (ISC_R_SUCCESS);
+18 -5
View File
@@ -370,11 +370,24 @@ Currently supported commands are:
avoids the need to examine the modification times of the zone files.
``recursing``
This command dumps the list of queries ``named`` is currently recursing on, and the
list of domains to which iterative queries are currently being sent.
The second list includes the number of fetches currently active for
the given domain, and how many have been passed or dropped because of
the ``fetches-per-zone`` option.
This command dumps the list of queries ``named`` is currently
recursing on, and the list of domains to which iterative queries
are currently being sent.
The first list includes all unique clients that are waiting for
recursion to complete, including the query that is awaiting a
response and the timestamp (seconds since the Unix epoch) of
when named started processing this client query.
The second list comprises of domains for which there are active
(or recently active) fetches in progress. It reports the number
of active fetches for each domain and the number of queries that
have been passed (allowed) or dropped (spilled) as a result of
the ``fetches-per-zone`` limit. (Note: these counters are not
cumulative over time; whenever the number of active fetches for
a domain drops to zero, the counter for that domain is deleted,
and the next time a fetch is sent to that domain, it is recreated
with the counters set to zero).
``refresh`` *zone* [*class* [*view*]]
This command schedules zone maintenance for the given zone.
+1
View File
@@ -1,4 +1,5 @@
.cache
.hypothesis
__pycache__
dig.out*
rndc.out*
+2 -1
View File
@@ -157,6 +157,7 @@ TESTS += \
synthfromdnssec \
tkey \
tools \
transport-acl \
tsig \
tsiggss \
ttl \
@@ -212,7 +213,7 @@ if HAVE_PYTHON
TESTS += kasp keymgr2kasp tcp pipelined
if HAVE_PYMOD_DNS
TESTS += checkds qmin cookie timeouts
TESTS += checkds dispatch qmin cookie timeouts
if HAVE_PERLMOD_NET_DNS
TESTS += dnssec
+43
View File
@@ -91,6 +91,19 @@ echo_i "test $n: none - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
DIGNOEDNS="+tcp +nosea +nostat +nocmd +norec +noques +noauth +noadd +nostats +noedns -p ${PORT}"
echo_i "test $n: none - query refused (no edns)"
ret=0
$DIG $DIGNOEDNS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null && ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -117,6 +130,7 @@ echo_i "test $n: address not allowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -130,6 +144,7 @@ echo_i "test $n: address disallowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -156,6 +171,7 @@ echo_i "test $n: acl not allowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -170,6 +186,7 @@ echo_i "test $n: acl disallowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -196,6 +213,7 @@ echo_i "test $n: key not allowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -209,6 +227,7 @@ echo_i "test $n: key disallowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -251,6 +270,7 @@ echo_i "test $n: views none - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -277,6 +297,7 @@ echo_i "test $n: views address not allowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -290,6 +311,7 @@ echo_i "test $n: views address disallowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -316,6 +338,7 @@ echo_i "test $n: views acl not allowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -329,6 +352,7 @@ echo_i "test $n: views acl disallowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -355,6 +379,7 @@ echo_i "test $n: views key not allowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -368,6 +393,7 @@ echo_i "test $n: views key disallowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -394,6 +420,7 @@ echo_i "test $n: views over options, views disallow - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -431,6 +458,7 @@ echo_i "test $n: zone none - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.none.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.none.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -451,6 +479,7 @@ echo_i "test $n: zone address not allowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.addrnotallow.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.addrnotallow.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -461,6 +490,7 @@ echo_i "test $n: zone address disallowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.addrdisallow.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.addrdisallow.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -481,6 +511,7 @@ echo_i "test $n: zone acl not allowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.aclnotallow.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.aclnotallow.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -491,6 +522,7 @@ echo_i "test $n: zone acl disallowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.acldisallow.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.acldisallow.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -511,6 +543,7 @@ echo_i "test $n: zone key not allowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.keyallow.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.keyallow.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -521,6 +554,7 @@ echo_i "test $n: zone key disallowed - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.keydisallow.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.keydisallow.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -547,6 +581,7 @@ echo_i "test $n: views over options, views disallow - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -573,6 +608,7 @@ echo_i "test $n: zones over views, views disallow - query refused"
ret=0
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -589,6 +625,7 @@ grep 'status: NOERROR' dig.out.ns2.1.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.1.$n > /dev/null || ret=1
$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.aclnotallow.example a > dig.out.ns2.2.$n || ret=1
grep 'status: REFUSED' dig.out.ns2.2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.2.$n > /dev/null || ret=1
grep '^a.aclnotallow.example' dig.out.ns2.2.$n > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -601,6 +638,7 @@ $DIG -p ${PORT} @10.53.0.3 -b 127.0.0.1 a.normal.example a > dig.out.ns3.1.$n
grep 'status: NOERROR' dig.out.ns3.1.$n > /dev/null || ret=1
$DIG -p ${PORT} @10.53.0.3 -b 10.53.0.1 a.normal.example a > dig.out.ns3.2.$n
grep 'status: REFUSED' dig.out.ns3.2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns3.2.$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -612,6 +650,7 @@ $DIG -p ${PORT} @10.53.0.3 -b 127.0.0.1 ns . > dig.out.ns3.1.$n
grep 'status: NOERROR' dig.out.ns3.1.$n > /dev/null || ret=1
$DIG -p ${PORT} @10.53.0.3 -b 10.53.0.1 ns . > dig.out.ns3.2.$n
grep 'status: REFUSED' dig.out.ns3.2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns3.2.$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -647,6 +686,7 @@ grep 'ANSWER: 1' dig.out.ns3.1.$n > /dev/null || ret=1
$DIG -p ${PORT} @10.53.1.2 a.normal.example a > dig.out.ns3.2.$n
grep 'recursion requested but not available' dig.out.ns3.2.$n > /dev/null || ret=1
grep 'status: REFUSED' dig.out.ns3.2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns3.2.$n > /dev/null || ret=1
# this should require recursion and should be allowed
$DIG -p ${PORT} @10.53.0.3 c.normal.example a > dig.out.ns3.3.$n
grep 'ANSWER: 1' dig.out.ns3.3.$n > /dev/null || ret=1
@@ -654,6 +694,7 @@ grep 'ANSWER: 1' dig.out.ns3.3.$n > /dev/null || ret=1
$DIG -p ${PORT} @10.53.1.2 d.normal.example a > dig.out.ns3.4.$n
grep 'recursion requested but not available' dig.out.ns3.4.$n > /dev/null || ret=1
grep 'status: REFUSED' dig.out.ns3.4.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns3.4.$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -671,6 +712,7 @@ grep 'ANSWER: 1' dig.out.ns3.1.$n > /dev/null || ret=1
$DIG -p ${PORT} @10.53.1.2 a.normal.example a > dig.out.ns3.2.$n
grep 'recursion requested but not available' dig.out.ns3.2.$n > /dev/null || ret=1
grep 'status: REFUSED' dig.out.ns3.2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns3.2.$n > /dev/null || ret=1
# this should require recursion and should be allowed
$DIG -p ${PORT} @10.53.0.3 e.normal.example a > dig.out.ns3.3.$n
grep 'ANSWER: 1' dig.out.ns3.3.$n > /dev/null || ret=1
@@ -678,6 +720,7 @@ grep 'ANSWER: 1' dig.out.ns3.3.$n > /dev/null || ret=1
$DIG -p ${PORT} @10.53.1.2 f.normal.example a > dig.out.ns3.4.$n
grep 'recursion requested but not available' dig.out.ns3.4.$n > /dev/null || ret=1
grep 'status: REFUSED' dig.out.ns3.4.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns3.4.$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
+60
View File
@@ -0,0 +1,60 @@
/*
* 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.
*/
include "../../common/rndc.key";
controls {
inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
options {
query-source address 10.53.0.2;
notify-source 10.53.0.2;
transfer-source 10.53.0.2;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.2; };
listen-on-v6 { fd92:7065:b8e:ffff::2; };
notify no;
recursion no;
serial-query-rate 100;
# removed catalog-zone option, otherwise this is
# identical to named1.conf.in
};
zone "catalog1.example" {
type secondary;
file "catalog1.example.db";
primaries { 10.53.0.1; };
};
zone "catalog2.example" {
type secondary;
file "catalog2.example.db";
primaries { 10.53.0.3; };
};
zone "catalog3.example" {
type secondary;
file "catalog3.example.db";
primaries { 10.53.0.1; };
};
zone "catalog4.example" {
type secondary;
file "catalog4.example.db";
primaries { 10.53.0.1; };
};
key tsig_key. {
secret "LSAnCU+Z";
algorithm hmac-md5;
};
+1 -1
View File
@@ -14,7 +14,7 @@
$SHELL clean.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
copy_setports ns2/named1.conf.in ns2/named.conf
copy_setports ns3/named.conf.in ns3/named.conf
cp -f ns1/catalog.example.db.in ns1/catalog1.example.db
+13 -3
View File
@@ -1178,7 +1178,7 @@ status=$((status+ret))
n=$((n+1))
echo_i "reconfiguring secondary - adding catalog4 catalog zone ($n)"
ret=0
sed -e "s/^#T1//g" < ns2/named.conf.in > ns2/named.conf.tmp
sed -e "s/^#T1//g" < ns2/named1.conf.in > ns2/named.conf.tmp
copy_setports ns2/named.conf.tmp ns2/named.conf
rndccmd 10.53.0.2 reconfig || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
@@ -1209,7 +1209,7 @@ status=$((status+ret))
n=$((n+1))
echo_i "reconfiguring secondary - removing catalog4 catalog zone, adding non-existent catalog5 catalog zone ($n)"
ret=0
sed -e "s/^#T2//" < ns2/named.conf.in > ns2/named.conf.tmp
sed -e "s/^#T2//" < ns2/named1.conf.in > ns2/named.conf.tmp
copy_setports ns2/named.conf.tmp ns2/named.conf
$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reconfig > /dev/null 2>&1 && ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
@@ -1218,7 +1218,7 @@ status=$((status+ret))
n=$((n+1))
echo_i "reconfiguring secondary - removing non-existent catalog5 catalog zone ($n)"
ret=0
copy_setports ns2/named.conf.in ns2/named.conf
copy_setports ns2/named1.conf.in ns2/named.conf
rndccmd 10.53.0.2 reconfig || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
@@ -1729,5 +1729,15 @@ wait_for_no_soa @10.53.0.2 dom16.example. dig.out.test$n || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "checking that reconfig can delete and restore catalog zone configuration ($n)"
ret=0
copy_setports ns2/named2.conf.in ns2/named.conf
rndccmd 10.53.0.2 reconfig || ret=1
copy_setports ns2/named1.conf.in ns2/named.conf
rndccmd 10.53.0.2 reconfig || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
@@ -0,0 +1,16 @@
/*
* 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.
*/
zone "example1" {
type primary;
file "example1.db";
allow-transfer port 99999 { any; };
};
@@ -0,0 +1,16 @@
/*
* 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.
*/
zone "example1" {
type primary;
file "example1.db";
allow-transfer port 44344 transport blah { any; };
};
@@ -0,0 +1,16 @@
/*
* 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.
*/
zone "example1" {
type primary;
file "example1.db";
allow-transfer port 44344 transport udp { any; };
};
@@ -0,0 +1,16 @@
/*
* 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.
*/
zone "example1" {
type primary;
file "example1.db";
allow-transfer port 44344 transport http { any; };
};
@@ -0,0 +1,16 @@
/*
* 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.
*/
zone "example1" {
type primary;
file "example1.db";
allow-transfer port 44344 transport http-plain { any; };
};
@@ -0,0 +1,17 @@
/*
* 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.
*/
zone "example" {
type secondary;
primaries { 10.53.0.1 tls undefined; };
file "example.db";
allow-transfer { any; };
};
@@ -0,0 +1,47 @@
/*
* 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.
*/
zone "example1" {
type primary;
file "example1.db";
allow-transfer port 44344 transport tls { any; };
};
zone "example2" {
type primary;
file "example2.db";
allow-transfer port 44344 transport tcp { any; };
};
zone "example3" {
type primary;
file "example3.db";
allow-transfer transport tls { any; };
};
zone "example4" {
type primary;
file "example4.db";
allow-transfer transport tcp { any; };
};
zone "example5" {
type primary;
file "example5.db";
allow-transfer port 53 { any; };
};
zone "example6" {
type primary;
file "example6.db";
allow-transfer { any; };
};
@@ -12,5 +12,4 @@
# In some cases a "tls" statement may omit key-file and cert-file.
tls local-tls {
protocols {TLSv1.2;};
hostname "fqdn.example.com";
};
@@ -0,0 +1,17 @@
/*
* 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.
*/
zone "example" {
type secondary;
primaries { 10.53.0.1 tls ephemeral; };
file "example.db";
allow-transfer { any; };
};
@@ -0,0 +1,23 @@
/*
* 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 {
protocols { TLSv1.2; };
ciphers "HIGH:!kRSA:!aNULL:!eNULL:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!SHA1:!SHA256:!SHA384";
prefer-server-ciphers no;
};
zone "example" {
type secondary;
primaries { 10.53.0.1 tls local-tls; };
file "example.db";
allow-transfer { any; };
};
-1
View File
@@ -21,5 +21,4 @@ rm -f ns*/keygen.out.* ns*/settime.out.* ns*/signer.out.*
rm -f ns*/managed-keys.bind*
rm -f ns*/*.mkeys
rm -f ns*/zones
rm -f tests-checkds.py.status
rm -f *.checkds.out
+3
View File
@@ -112,6 +112,9 @@ SHELL=@SHELL@
# CURL will be empty if no program was found by configure
CURL=@CURL@
# NC will be empty if no program was found by configure
NC=@NC@
# XMLLINT will be empty if no program was found by configure
XMLLINT=@XMLLINT@
+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 https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
############################################################################
import os
import select
import signal
import socket
import sys
import time
import dns.flags
import dns.message
def port():
env_port = os.getenv("PORT")
if env_port is None:
env_port = 5300
else:
env_port = int(env_port)
return env_port
def udp_listen(port):
udp = socket.socket(type=socket.SOCK_DGRAM)
udp.bind(('10.53.0.3', port))
return udp
def tcp_listen(port):
tcp = socket.socket(type=socket.SOCK_STREAM)
tcp.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
tcp.bind(('10.53.0.3', port))
tcp.listen(100)
return tcp
def udp_tc_once(udp):
qrybytes, clientaddr = udp.recvfrom(65535)
qry = dns.message.from_wire(qrybytes)
answ = dns.message.make_response(qry)
answ.flags |= dns.flags.TC
answbytes = answ.to_wire()
udp.sendto(answbytes, clientaddr)
def tcp_once(tcp):
csock, _clientaddr = tcp.accept()
time.sleep(5)
csock.close()
def sigterm(signum, frame):
os.remove('ans.pid')
sys.exit(0)
def write_pid():
with open('ans.pid', 'w') as f:
pid = os.getpid()
f.write("{}".format(pid))
signal.signal(signal.SIGTERM, sigterm)
write_pid()
udp = udp_listen(port())
tcp = tcp_listen(port())
input = [udp, tcp]
while True:
try:
inputready, outputready, exceptready = select.select(input, [], [])
except select.error:
break
except socket.error:
break
except KeyboardInterrupt:
break
for s in inputready:
if s == udp:
udp_tc_once(udp)
if s == tcp:
tcp_once(tcp)
sigterm(signal.SIGTERM, 0)
+12
View File
@@ -0,0 +1,12 @@
# 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 ns*/named.run ns*/named.conf ns*/named.pid ns*/managed-keys.bind*
rm -f ans*/ans.run ans*/ans.pid
rm -f ns*/named.memstats
+25
View File
@@ -0,0 +1,25 @@
############################################################################
# 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.
############################################################################
import os
import pytest
@pytest.fixture
def port(request):
# pylint: disable=unused-argument
env_port = os.getenv("PORT")
if env_port is None:
env_port = 5300
else:
env_port = int(env_port)
return env_port
@@ -0,0 +1,42 @@
/*
* 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.
*/
key rndc_key {
secret "1234abcd8765";
algorithm hmac-sha256;
};
controls {
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
options {
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.1; };
query-source address 10.53.0.1;
notify-source 10.53.0.1;
transfer-source 10.53.0.1;
listen-on-v6 { fd92:7065:b8e:ffff::1; };
query-source-v6 address fd92:7065:b8e:ffff::1;
notify-source-v6 fd92:7065:b8e:ffff::1;
transfer-source-v6 fd92:7065:b8e:ffff::1;
recursion no;
servfail-ttl 0;
};
zone "." {
type primary;
file "root.db";
};
+14
View File
@@ -0,0 +1,14 @@
; 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.
. 300 SOA . . 0 0 0 0 0
. 300 NS ns.nil.
ns.nil. 300 A 10.53.0.1
example. 300 NS ns.example.
ns.example. 300 A 10.53.0.2
+6
View File
@@ -0,0 +1,6 @@
example. 86400 IN SOA ns.example. root.example. 43 10800 900 604800 86400
example. 86400 IN NS ns.example.
ns.example. A 10.53.0.2
ns.sub.example. A 10.53.0.3
sub.example. NS ns.sub.example.
@@ -0,0 +1,47 @@
/*
* 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.
*/
key rndc_key {
secret "1234abcd8765";
algorithm hmac-sha256;
};
controls {
inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
options {
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.2; };
query-source address 10.53.0.2;
notify-source 10.53.0.2;
transfer-source 10.53.0.2;
listen-on-v6 { fd92:7065:b8e:ffff::2; };
query-source-v6 address fd92:7065:b8e:ffff::2;
notify-source-v6 fd92:7065:b8e:ffff::2;
transfer-source-v6 fd92:7065:b8e:ffff::2;
recursion yes;
servfail-ttl 0;
};
zone "." {
type hint;
file "../../common/root.hint";
};
zone "example" {
type primary;
file "example.db";
};
+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.
. ../conf.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
@@ -0,0 +1,25 @@
#!/usr/bin/python3
############################################################################
# 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.
############################################################################
import pytest
pytest.importorskip("dns")
import dns.message
import dns.query
import dns.rcode
def test_connreset(port):
msg = dns.message.make_query("sub.example.", "A", want_dnssec=True,
use_edns=0, payload=1232)
ans = dns.query.udp(msg, "10.53.0.2", timeout=10, port=port)
assert ans.rcode() == dns.rcode.SERVFAIL
+11 -12
View File
@@ -255,10 +255,9 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
struct dlz_example_data *state;
const char *helper_name;
va_list ap;
char soa_data[1024];
const char *extra;
char soa_data[sizeof("@ hostmaster.root 123 900 600 86400 3600")];
isc_result_t result;
int n;
size_t n;
UNUSED(dlzname);
@@ -292,19 +291,19 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[], void **dbdata,
sprintf(state->zone_name, "%s.", argv[1]);
}
/*
* Use relative names to trigger ISC_R_NOSPACE in dns_sdlz_putrr.
*/
if (strcmp(state->zone_name, ".") == 0) {
extra = ".root";
n = strlcpy(soa_data,
"@ hostmaster.root 123 900 600 86400 3600",
sizeof(soa_data));
} else {
extra = ".";
n = strlcpy(soa_data, "@ hostmaster 123 900 600 86400 3600",
sizeof(soa_data));
}
n = sprintf(soa_data, "%s hostmaster%s%s 123 900 600 86400 3600",
state->zone_name, extra, state->zone_name);
if (n < 0) {
CHECK(ISC_R_FAILURE);
}
if ((unsigned)n >= sizeof(soa_data)) {
if (n >= sizeof(soa_data)) {
CHECK(ISC_R_NOSPACE);
}
@@ -46,6 +46,11 @@ dlz "example three" {
database "dlopen ../driver/.libs/dlzexternal.so example.org";
};
dlz "example four" {
// Long zone name to trigger ISC_R_NOSPACE in dns_sdlz_putrr.
database "dlopen ../driver/.libs/dlzexternal.so 123456789.123456789.123456789.123456789.123456789.example.foo";
};
dlz "unsearched1" {
database "dlopen ../driver/.libs/dlzexternal.so other.nil";
search no;
+1
View File
@@ -94,6 +94,7 @@ rm -f ./ns3/ttlpatch.example.db ./ns3/ttlpatch.example.db.signed
rm -f ./ns3/ttlpatch.example.db.patched
rm -f ./ns3/unsecure.example.db ./ns3/bogus.example.db ./ns3/keyless.example.db
rm -f ./ns3/unsupported.managed.db.tmp ./ns3/unsupported.trusted.db.tmp
rm -f ./ns3/NSEC ./ns3/NSEC3
rm -f ./ns4/managed-keys.bind*
rm -f ./ns4/named_dump.db*
rm -f ./ns6/optout-tld.db
+1 -1
View File
@@ -36,7 +36,7 @@ zsk=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
cat "$infile" "$ksk.key" "$zsk.key" > "$zonefile"
"$SIGNER" -P -g -o "$zone" "$zonefile" > /dev/null 2>&1
"$SIGNER" -g -o "$zone" "$zonefile" > /dev/null 2>&1
# Configure the resolving server with a staitc key.
keyfile_to_static_ds "$ksk" > trusted.conf
+16 -16
View File
@@ -36,7 +36,7 @@ keyname2=$("$KEYGEN" -q -a "$ALTERNATIVE_ALGORITHM" -b "$ALTERNATIVE_BITS" -n zo
cat "$infile" "$keyname1.key" "$keyname2.key" > "$zonefile"
"$SIGNER" -P -g -o "$zone" -k "$keyname1" "$zonefile" "$keyname2" > /dev/null 2>&1
"$SIGNER" -g -o "$zone" -k "$keyname1" "$zonefile" "$keyname2" > /dev/null 2>&1
zone=trusted.
infile=key.db.in
@@ -47,7 +47,7 @@ keyname2=$("$KEYGEN" -q -a "$ALTERNATIVE_ALGORITHM" -b "$ALTERNATIVE_BITS" -n zo
cat "$infile" "$keyname1.key" "$keyname2.key" > "$zonefile"
"$SIGNER" -P -g -o "$zone" -k "$keyname1" "$zonefile" "$keyname2" > /dev/null 2>&1
"$SIGNER" -g -o "$zone" -k "$keyname1" "$zonefile" "$keyname2" > /dev/null 2>&1
# The "example." zone.
zone=example.
@@ -72,7 +72,7 @@ keyname2=$("$KEYGEN" -q -a "$ALTERNATIVE_ALGORITHM" -b "$ALTERNATIVE_BITS" -n zo
cat "$infile" "$keyname1.key" "$keyname2.key" > "$zonefile"
"$SIGNER" -P -g -o "$zone" -k "$keyname1" "$zonefile" "$keyname2" > /dev/null 2>&1
"$SIGNER" -g -o "$zone" -k "$keyname1" "$zonefile" "$keyname2" > /dev/null 2>&1
#
# lower/uppercase the signature bits with the exception of the last characters
@@ -134,7 +134,7 @@ keyname1=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone -f KS
keyname2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
cat "$infile" "$keyname1.key" "$keyname2.key" > "$zonefile"
"$SIGNER" -P -g -o "$zone" -k "$keyname1" "$zonefile" "$keyname2" > /dev/null 2>&1
"$SIGNER" -g -o "$zone" -k "$keyname1" "$zonefile" "$keyname2" > /dev/null 2>&1
# Sign the badparam secure file
@@ -147,7 +147,7 @@ keyname2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zon
cat "$infile" "$keyname1.key" "$keyname2.key" > "$zonefile"
"$SIGNER" -P -3 - -H 1 -g -o "$zone" -k "$keyname1" "$zonefile" "$keyname2" > /dev/null 2>&1
"$SIGNER" -3 - -H 1 -g -o "$zone" -k "$keyname1" "$zonefile" "$keyname2" > /dev/null 2>&1
sed -e 's/IN NSEC3 1 0 1 /IN NSEC3 1 0 10 /' "$zonefile.signed" > "$zonefile.bad"
@@ -162,7 +162,7 @@ keyname2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zon
cat "$infile" "$keyname1.key" "$keyname2.key" > "$zonefile"
"$SIGNER" -P -3 - -A -H 1 -g -o "$zone" -k "$keyname1" "$zonefile" "$keyname2" > /dev/null 2>&1
"$SIGNER" -3 - -A -H 1 -g -o "$zone" -k "$keyname1" "$zonefile" "$keyname2" > /dev/null 2>&1
#
# algroll has just has the old DNSKEY records removed and is waiting
@@ -180,7 +180,7 @@ keynew2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keynew1.key" "$keynew2.key" > "$zonefile"
"$SIGNER" -P -o "$zone" -k "$keyold1" -k "$keynew1" "$zonefile" "$keyold1" "$keyold2" "$keynew1" "$keynew2" > /dev/null 2>&1
"$SIGNER" -o "$zone" -k "$keyold1" -k "$keynew1" "$zonefile" "$keyold1" "$keyold2" "$keynew1" "$keynew2" > /dev/null 2>&1
#
# Make a zone big enough that it takes several seconds to generate a new
@@ -204,7 +204,7 @@ done >> "$zonefile"
key1=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone -f KSK "$zone")
key2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
cat "$key1.key" "$key2.key" >> "$zonefile"
"$SIGNER" -P -3 - -A -H 1 -g -o "$zone" -k "$key1" "$zonefile" "$key2" > /dev/null 2>&1
"$SIGNER" -3 - -A -H 1 -g -o "$zone" -k "$key1" "$zonefile" "$key2" > /dev/null 2>&1
zone=cds.secure
infile=cds.secure.db.in
@@ -213,7 +213,7 @@ key1=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone -f KSK "$
key2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
"$DSFROMKEY" -C "$key1.key" > "$key1.cds"
cat "$infile" "$key1.key" "$key2.key" "$key1.cds" >$zonefile
"$SIGNER" -P -g -o "$zone" "$zonefile" > /dev/null 2>&1
"$SIGNER" -g -o "$zone" "$zonefile" > /dev/null 2>&1
zone=cds-x.secure
infile=cds.secure.db.in
@@ -223,7 +223,7 @@ key2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone -f KSK "$
key3=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
"$DSFROMKEY" -C "$key2.key" > "$key2.cds"
cat "$infile" "$key1.key" "$key2.key" "$key3.key" "$key2.cds" > "$zonefile"
"$SIGNER" -P -g -x -o "$zone" "$zonefile" > /dev/null 2>&1
"$SIGNER" -g -x -o "$zone" "$zonefile" > /dev/null 2>&1
zone=cds-update.secure
infile=cds-update.secure.db.in
@@ -231,7 +231,7 @@ zonefile=cds-update.secure.db
key1=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone -f KSK "$zone")
key2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
cat "$infile" "$key1.key" "$key2.key" > "$zonefile"
"$SIGNER" -P -g -o "$zone" "$zonefile" > /dev/null 2>&1
"$SIGNER" -g -o "$zone" "$zonefile" > /dev/null 2>&1
zone=cds-kskonly.secure
infile=cds-kskonly.secure.db.in
@@ -239,7 +239,7 @@ zonefile=cds-kskonly.secure.db
key1=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone -f KSK "$zone")
key2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
cat "$infile" "$key1.key" "$key2.key" > "$zonefile"
"$SIGNER" -P -g -o "$zone" "$zonefile" > /dev/null 2>&1
"$SIGNER" -g -o "$zone" "$zonefile" > /dev/null 2>&1
keyfile_to_key_id "$key1" > cds-kskonly.secure.id
zone=cds-auto.secure
@@ -257,7 +257,7 @@ key1=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone -f KSK "$
key2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
sed 's/DNSKEY/CDNSKEY/' "$key1.key" > "$key1.cds"
cat "$infile" "$key1.key" "$key2.key" "$key1.cds" > "$zonefile"
"$SIGNER" -P -g -o "$zone" "$zonefile" > /dev/null 2>&1
"$SIGNER" -g -o "$zone" "$zonefile" > /dev/null 2>&1
zone=cdnskey-x.secure
infile=cdnskey.secure.db.in
@@ -267,7 +267,7 @@ key2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone -f KSK "$
key3=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
sed 's/DNSKEY/CDNSKEY/' "$key1.key" > "$key1.cds"
cat "$infile" "$key1.key" "$key2.key" "$key3.key" "$key1.cds" > "$zonefile"
"$SIGNER" -P -g -x -o "$zone" "$zonefile" > /dev/null 2>&1
"$SIGNER" -g -x -o "$zone" "$zonefile" > /dev/null 2>&1
zone=cdnskey-update.secure
infile=cdnskey-update.secure.db.in
@@ -275,7 +275,7 @@ zonefile=cdnskey-update.secure.db
key1=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone -f KSK "$zone")
key2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
cat "$infile" "$key1.key" "$key2.key" > "$zonefile"
"$SIGNER" -P -g -o "$zone" "$zonefile" > /dev/null 2>&1
"$SIGNER" -g -o "$zone" "$zonefile" > /dev/null 2>&1
zone=cdnskey-kskonly.secure
infile=cdnskey-kskonly.secure.db.in
@@ -283,7 +283,7 @@ zonefile=cdnskey-kskonly.secure.db
key1=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone -f KSK "$zone")
key2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
cat "$infile" "$key1.key" "$key2.key" > "$zonefile"
"$SIGNER" -P -g -o "$zone" "$zonefile" > /dev/null 2>&1
"$SIGNER" -g -o "$zone" "$zonefile" > /dev/null 2>&1
keyfile_to_key_id "$key1" > cdnskey-kskonly.secure.id
zone=cdnskey-auto.secure
+31 -30
View File
@@ -49,7 +49,7 @@ do
keyname4=$("$KEYGEN" -f KSK -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
cat "$infile" "$keyname4.key" > "$zonefile"
"$SIGNER" -z -P -3 - -o "$zone" -O full -f ${zonefile}.tmp "$zonefile" > /dev/null
"$SIGNER" -z -3 - -o "$zone" -O full -f ${zonefile}.tmp "$zonefile" > /dev/null
awk '$4 == "DNSKEY" { $7 = 255 } $4 == "RRSIG" { $6 = 255 } { print }' ${zonefile}.tmp > ${zonefile}.signed
# Make trusted-keys and managed keys conf sections for ns8.
@@ -86,7 +86,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$cnameandkey.key" "$dnameandkey.key" "$keyname.key" > "$zonefile"
"$SIGNER" -P -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -o "$zone" "$zonefile" > /dev/null
zone=bogus.example.
infile=bogus.example.db.in
@@ -96,7 +96,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -o "$zone" "$zonefile" > /dev/null
zone=dynamic.example.
infile=dynamic.example.db.in
@@ -107,7 +107,7 @@ keyname2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone -f KS
cat "$infile" "$keyname1.key" "$keyname2.key" > "$zonefile"
"$SIGNER" -P -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -o "$zone" "$zonefile" > /dev/null
zone=keyless.example.
infile=generic.example.db.in
@@ -117,7 +117,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -o "$zone" "$zonefile" > /dev/null
# Change the signer field of the a.b.keyless.example SIG A
# to point to a provably nonexistent KEY record.
@@ -138,7 +138,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -o "$zone" "$zonefile" > /dev/null
#
# NSEC3/NSEC3 test zone
@@ -151,7 +151,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -3 - -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -3 - -o "$zone" "$zonefile" > /dev/null
#
# OPTOUT/NSEC3 test zone
@@ -164,7 +164,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -3 - -A -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -3 - -A -o "$zone" "$zonefile" > /dev/null
#
# A nsec3 zone (non-optout).
@@ -177,7 +177,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -g -3 - -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -g -3 - -o "$zone" "$zonefile" > /dev/null
#
# OPTOUT/NSEC test zone
@@ -190,7 +190,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -o "$zone" "$zonefile" > /dev/null
#
# OPTOUT/NSEC3 test zone
@@ -203,7 +203,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -3 - -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -3 - -o "$zone" "$zonefile" > /dev/null
#
# OPTOUT/OPTOUT test zone
@@ -216,7 +216,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -3 - -A -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -3 - -A -o "$zone" "$zonefile" > /dev/null
#
# A optout nsec3 zone.
@@ -229,7 +229,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -g -3 - -A -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -g -3 - -A -o "$zone" "$zonefile" > /dev/null
#
# A nsec3 zone (non-optout) with unknown nsec3 hash algorithm (-U).
@@ -242,7 +242,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -3 - -U -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -3 - -PU -o "$zone" "$zonefile" > /dev/null
#
# A optout nsec3 zone with a unknown nsec3 hash algorithm (-U).
@@ -255,7 +255,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -3 - -U -A -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -3 - -PU -A -o "$zone" "$zonefile" > /dev/null
#
# A zone that is signed with an unknown DNSKEY algorithm.
@@ -269,7 +269,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -3 - -o "$zone" -O full -f ${zonefile}.tmp "$zonefile" > /dev/null
"$SIGNER" -z -3 - -o "$zone" -O full -f ${zonefile}.tmp "$zonefile" > /dev/null
awk '$4 == "DNSKEY" { $7 = 100 } $4 == "RRSIG" { $6 = 100 } { print }' ${zonefile}.tmp > ${zonefile}.signed
@@ -288,7 +288,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -3 - -o "$zone" -O full -f ${zonefile}.tmp "$zonefile" > /dev/null
"$SIGNER" -z -3 - -o "$zone" -O full -f ${zonefile}.tmp "$zonefile" > /dev/null
awk '$4 == "DNSKEY" { $7 = 255 } $4 == "RRSIG" { $6 = 255 } { print }' ${zonefile}.tmp > ${zonefile}.signed
@@ -308,7 +308,7 @@ zsk=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
cat "$infile" "$ksk.key" "$zsk.key" unsupported-algorithm.key > "$zonefile"
"$SIGNER" -P -3 - -o "$zone" -f ${zonefile}.signed "$zonefile" > /dev/null
"$SIGNER" -3 - -o "$zone" -f ${zonefile}.signed "$zonefile" > /dev/null
#
# A zone with a unknown DNSKEY algorithm + unknown NSEC3 hash algorithm (-U).
@@ -322,7 +322,7 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -3 - -o "$zone" -U -O full -f ${zonefile}.tmp "$zonefile" > /dev/null
"$SIGNER" -z -3 - -o "$zone" -PU -O full -f ${zonefile}.tmp "$zonefile" > /dev/null
awk '$4 == "DNSKEY" { $7 = 100; print } $4 == "RRSIG" { $6 = 100; print } { print }' ${zonefile}.tmp > ${zonefile}.signed
@@ -340,17 +340,18 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -o "$zone" "$zonefile" > /dev/null
mv "$zonefile".signed "$zonefile"
"$SIGNER" -P -u3 - -o "$zone" "$zonefile" > /dev/null
mv "$zonefile".signed "$zonefile"
"$SIGNER" -P -u3 AAAA -o "$zone" "$zonefile" > /dev/null
mv "$zonefile".signed "$zonefile"
"$SIGNER" -P -u3 BBBB -o "$zone" "$zonefile" > /dev/null
mv "$zonefile".signed "$zonefile"
"$SIGNER" -P -u3 CCCC -o "$zone" "$zonefile" > /dev/null
mv "$zonefile".signed "$zonefile"
"$SIGNER" -P -u3 DDDD -o "$zone" "$zonefile" > /dev/null
"$SIGNER" -z -O full -o "$zone" "$zonefile" > /dev/null
awk '$4 == "NSEC" || ( $4 == "RRSIG" && $5 == "NSEC" ) { print }' "$zonefile".signed > NSEC
"$SIGNER" -z -O full -u3 - -o "$zone" "$zonefile" > /dev/null
awk '$4 == "NSEC3" || ( $4 == "RRSIG" && $5 == "NSEC3" ) { print }' "$zonefile".signed > NSEC3
"$SIGNER" -z -O full -u3 AAAA -o "$zone" "$zonefile" > /dev/null
awk '$4 == "NSEC3" || ( $4 == "RRSIG" && $5 == "NSEC3" ) { print }' "$zonefile".signed >> NSEC3
"$SIGNER" -z -O full -u3 BBBB -o "$zone" "$zonefile" > /dev/null
awk '$4 == "NSEC3" || ( $4 == "RRSIG" && $5 == "NSEC3" ) { print }' "$zonefile".signed >> NSEC3
"$SIGNER" -z -O full -u3 CCCC -o "$zone" "$zonefile" > /dev/null
awk '$4 == "NSEC3" || ( $4 == "RRSIG" && $5 == "NSEC3" ) { print }' "$zonefile".signed >> NSEC3
"$SIGNER" -z -O full -u3 DDDD -o "$zone" "$zonefile" > /dev/null
cat NSEC NSEC3 >> "$zonefile".signed
#
# A RSASHA256 zone.
+1 -1
View File
@@ -24,4 +24,4 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
cat "$infile" "$keyname.key" > "$zonefile"
"$SIGNER" -P -3 - -A -o "$zone" "$zonefile" > /dev/null 2>&1
"$SIGNER" -z -3 - -A -o "$zone" "$zonefile" > /dev/null 2>&1
+12
View File
@@ -2898,6 +2898,18 @@ n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "check dnssec-dsfromkey with revoked key ($n)"
ret=0
dig_with_opts revkey.example dnskey @10.53.0.4 > dig.out.ns4.test$n || ret=1
grep "DNSKEY.256 3 13" dig.out.ns4.test$n > /dev/null || ret=1 # ZSK
grep "DNSKEY.385 3 13" dig.out.ns4.test$n > /dev/null || ret=1 # revoked KSK
grep "DNSKEY.257 3 13" dig.out.ns4.test$n > /dev/null || ret=1 # KSK
test $(awk '$4 == "DNSKEY" { print }' dig.out.ns4.test$n | wc -l) -eq 3 || ret=1
$DSFROMKEY -f dig.out.ns4.test$n revkey.example. > dsfromkey.out.test$n || ret=1
test $(wc -l < dsfromkey.out.test$n) -eq 1 || ret=1
n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
echo_i "testing soon-to-expire RRSIGs without a replacement private key ($n)"
ret=0
dig_with_answeropts +nottlid expiring.example ns @10.53.0.3 | grep RRSIG > dig.out.ns3.test$n 2>&1
+25
View File
@@ -0,0 +1,25 @@
DoH query values that can be passed on the command line for testing
with curl can be obtained by encoding binary DNS messages into
base64url, with trailing '='s removed.
For example:
$ perl bin/tests/system/fromhex.pl << EOF | base64url
# Transaction ID
0001
# Standard query
0000
# Questions: 1, Additional: 0
0001 0000 0000 0000
# QNAME: example
07 6578616d706c65 00
# Type: SOA
0006
Class: IN
0001
EOF
This produces the string "AAEAAAABAAAAAAAAB2V4YW1wbGUAAAbFrMonAAE=". With
the trailing '=' removed, this can then be passed to curl:
curl "https://<server>/dns-query?dns=AAEAAAABAAAAAAAAB2V4YW1wbGUAAAbFrMonAAE"
+2 -1
View File
@@ -18,4 +18,5 @@ rm -f ./*/named.memstats
rm -f ./*/named.run
rm -f ./*/named.run.prev
rm -f ./dig.out.*
rm -f ./*/example.db
rm -f ./*/example*.db
rm -rf ./headers.*
+30 -4
View File
@@ -19,6 +19,24 @@ http local {
endpoints { "/dns-query"; "/alter"; };
};
tls tls-forward-secrecy {
protocols { TLSv1.2; };
ciphers "HIGH:!kRSA:!aNULL:!eNULL:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!SHA1:!SHA256:!SHA384";
prefer-server-ciphers yes;
key-file "../ns2/key.pem";
cert-file "../ns2/cert.pem";
dhparam-file "../ns2/dhparam3072.pem";
};
tls tls-pfs-aes256 {
protocols { TLSv1.2; };
ciphers "AES256:!kRSA:!aNULL:!eNULL:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!SHA1:!SHA256:!SHA384";
prefer-server-ciphers yes;
key-file "../ns2/key.pem";
cert-file "../ns2/cert.pem";
dhparam-file "../ns2/dhparam3072.pem";
};
options {
port @PORT@;
tls-port @TLSPORT@;
@@ -26,13 +44,15 @@ options {
http-port @HTTPPORT@;
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on tls ephemeral { 10.53.0.1; }; // DoT
listen-on-v6 tls ephemeral { fd92:7065:b8e:ffff::1;};
listen-on tls tls-forward-secrecy { 10.53.0.1; }; // DoT
listen-on-v6 tls tls-forward-secrecy { fd92:7065:b8e:ffff::1;};
listen-on tls ephemeral http local { 10.53.0.1; }; // DoH
listen-on-v6 tls ephemeral http local { fd92:7065:b8e:ffff::1; };
listen-on tls none http local { 10.53.0.1; }; // unencrypted DoH
listen-on-v6 tls none http local { fd92:7065:b8e:ffff::1; };
listen-on-v6 { none; };
listen-on port @EXTRAPORT1@ tls tls-pfs-aes256 { 10.53.0.1; }; // DoT
listen-on-v6 port @EXTRAPORT1@ tls tls-pfs-aes256 { fd92:7065:b8e:ffff::1;};
recursion no;
notify explicit;
also-notify { 10.53.0.2 port @PORT@; };
@@ -44,11 +64,17 @@ options {
zone "." {
type primary;
file "root.db";
allow-transfer { any; };
allow-transfer port @TLSPORT@ transport tls { any; };
};
zone "example" {
type primary;
file "example.db";
allow-transfer { any; };
allow-transfer port @TLSPORT@ transport tls { any; };
};
zone "example2" {
type primary;
file "example.db";
allow-transfer port @EXTRAPORT1@ transport tls { any; };
};
+82
View File
@@ -0,0 +1,82 @@
/*
* 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.
*/
include "../../common/rndc.key";
controls {
inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
tls local {
key-file "../ns2/key.pem";
cert-file "../ns2/cert.pem";
dhparam-file "../ns2/dhparam3072.pem";
};
http local {
endpoints { "/dns-query"; };
};
options {
query-source address 10.53.0.3;
notify-source 10.53.0.3;
transfer-source 10.53.0.3;
port @PORT@;
tls-port @TLSPORT@;
https-port @HTTPSPORT@;
http-port @HTTPPORT@;
pid-file "named.pid";
listen-on { 10.53.0.3; };
listen-on tls local { 10.53.0.3; }; // DoT
listen-on-v6 tls local { fd92:7065:b8e:ffff::3; };
listen-on tls local http local { 10.53.0.3; }; // DoH
listen-on-v6 tls local http local { fd92:7065:b8e:ffff::3; };
listen-on tls none http local { 10.53.0.3; }; // unencrypted DoH
listen-on-v6 tls none http local { fd92:7065:b8e:ffff::3; };
listen-on-v6 { none; };
recursion no;
notify no;
ixfr-from-differences yes;
check-integrity no;
dnssec-validation yes;
};
zone "." {
type hint;
file "../../common/root.hint";
};
tls tls-v1.2-pfs {
protocols { TLSv1.2; };
ciphers "HIGH:!kRSA:!aNULL:!eNULL:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!SHA1:!SHA256:!SHA384";
prefer-server-ciphers no;
};
zone "example" {
type secondary;
primaries { 10.53.0.1 tls tls-v1.2-pfs; };
file "example.db";
allow-transfer { any; };
};
tls tls-pfs-aes-128 {
protocols { TLSv1.2; };
// AES128 does not match the setting on the server: AES256
ciphers "AES128:!kRSA:!aNULL:!eNULL:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!SHA1:!SHA256:!SHA384";
prefer-server-ciphers no;
};
zone "example2" {
type secondary;
primaries port @EXTRAPORT1@ { 10.53.0.1 tls tls-pfs-aes-128; };
file "example2.db";
allow-transfer { any; };
};
+1
View File
@@ -26,3 +26,4 @@ done
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
copy_setports ns3/named.conf.in ns3/named.conf
+102 -6
View File
@@ -30,9 +30,18 @@ dig_with_http_opts() {
"$DIG" +http-plain $common_dig_options -p "${HTTPPORT}" "$@"
}
dig_with_opts() {
# shellcheck disable=SC2086
"$DIG" $common_dig_options -p "${PORT}" "$@"
}
wait_for_tls_xfer() (
dig_with_tls_opts -b 10.53.0.3 @10.53.0.2 example. AXFR > "dig.out.ns2.test$n" || return 1
grep "^;" "dig.out.ns2.test$n" > /dev/null && return 1
srv_number="$1"
shift
zone_name="$1"
shift
dig_with_tls_opts -b 10.53.0.3 "@10.53.0.$srv_number" "${zone_name}." AXFR > "dig.out.ns$srv_number.${zone_name}.test$n" || return 1
grep "^;" "dig.out.ns$srv_number.${zone_name}.test$n" > /dev/null && return 1
return 0
)
@@ -49,11 +58,11 @@ if test $ret != 0 ; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "testing incoming XoT functionality (from secondary) ($n)"
echo_i "testing incoming XoT functionality (from the first secondary) ($n)"
ret=0
if retry_quiet 10 wait_for_tls_xfer; then
grep "^;" "dig.out.ns2.test$n" | cat_i
digcomp example.axfr.good "dig.out.ns2.test$n" || ret=1
if retry_quiet 10 wait_for_tls_xfer 2 example; then
grep "^;" "dig.out.ns2.example.test$n" | cat_i
digcomp example.axfr.good "dig.out.ns2.example.test$n" || ret=1
else
echo_i "timed out waiting for zone transfer"
ret=1
@@ -61,6 +70,31 @@ fi
if test $ret != 0 ; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "testing incoming XoT functionality (from the second secondary) ($n)"
ret=0
if retry_quiet 10 wait_for_tls_xfer 3 example; then
grep "^;" "dig.out.ns3.example.test$n" | cat_i
digcomp example.axfr.good "dig.out.ns3.example.test$n" || ret=1
else
echo_i "timed out waiting for zone transfer"
ret=1
fi
if test $ret != 0 ; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "testing incoming XoT functionality (from the second secondary, mismatching ciphers, failure expected) ($n)"
ret=0
if retry_quiet 10 wait_for_tls_xfer 3 example2; then
grep "^;" "dig.out.ns3.example2.test$n" | cat_i
test -f "ns3/example2.db" && ret=1
else
echo_i "timed out waiting for zone transfer"
fi
if test $ret != 0 ; then echo_i "failed"; fi
status=$((status+ret))
n=$((n + 1))
echo_i "checking DoT query (ephemeral key) ($n)"
ret=0
@@ -101,6 +135,24 @@ grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
# zone transfers are allowed only via TLS
n=$((n+1))
echo_i "testing zone transfer over Do53 server functionality (using dig, failure expected) ($n)"
ret=0
dig_with_opts example. -b 10.53.0.3 @10.53.0.1 axfr > dig.out.ns1.test$n || ret=1
grep "; Transfer failed." dig.out.ns1.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
# querying zones is still allowed via UDP/TCP
n=$((n + 1))
echo_i "checking Do53 query ($n)"
ret=0
dig_with_opts @10.53.0.1 example SOA > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
# In this test we are trying to establish a DoT connection over the
# DoH port. That is intentional, as dig should fail right after
# handshake has happened and before sending any queries, as XFRs, per
@@ -116,6 +168,17 @@ grep "$msg_xfrs_not_allowed" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
# Let's try to issue an HTTP/2 query over TLS port to check if dig
# will detect ALPN token negotiation problem.
n=$((n + 1))
echo_i "checking DoH query when ALPN is expected to fail (dot, failure expected) ($n)"
ret=0
# shellcheck disable=SC2086
"$DIG" +https $common_dig_options -p "${TLSPORT}" "$@" @10.53.0.1 . SOA > dig.out.test$n
grep "ALPN for HTTP/2 failed." dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "checking DoH query (POST) ($n)"
ret=0
@@ -443,5 +506,38 @@ fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
# check whether we can use curl for sending test queries.
if [ -x "${CURL}" ] ; then
CURL_HTTP2="$(${CURL} --version | grep '^Features:.* HTTP2\( \|$\)')"
if [ -n "$CURL_HTTP2" ]; then
testcurl=1
else
echo_i "The available version of CURL does not have HTTP/2 support"
fi
fi
# Note: see README.curl for information on how to generate curl
# queries.
if [ -n "$testcurl" ]; then
n=$((n + 1))
echo_i "checking max-age for positive answer ($n)"
ret=0
# use curl to query for 'example/SOA'
$CURL -kD headers.$n "https://10.53.0.1:${HTTPSPORT}/dns-query?dns=AAEAAAABAAAAAAAAB2V4YW1wbGUAAAYAAQ" > /dev/null 2>&1
grep "cache-control: max-age=86400" headers.$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "checking max-age for negative answer ($n)"
ret=0
# use curl to query for 'fake.example/TXT'
$CURL -kD headers.$n "https://10.53.0.1:${HTTPSPORT}/dns-query?dns=AAEAAAABAAAAAAAABGZha2UHZXhhbXBsZQAAEAAB" > /dev/null 2>&1
grep "cache-control: max-age=3600" headers.$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
fi
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
+16 -21
View File
@@ -348,28 +348,23 @@ idna_enabled_test() {
idna_fail "$text" "+noidnin +idnout" "xn--19g"
idna_fail "$text" "+idnin +idnout" "xn--19g"
# Test that the UseSTD3ASCIIRules is being used
#
# Note that "+noidnin +idnout" is not tested because libidn2 2.2.0+ parses
# Punycode more strictly than older versions and thus dig succeeds with that
# combination of options with libidn2 2.2.0+ but fails with older
# versions.
#
# Note that "+idnin +idnout" is not tested because libidn2 2.2.0+ parses
# Punycode more strictly than older versions and thus dig fails with that
# combination of options with libidn2 2.2.0+ but succeeds with older
# versions.
#
# With UseSTD13ASCIIRules=false, '☺' produces 'xn--\032o-oia59s'
#
# With UseSTD13ASCIIRules=true, '☺' produces 'xn--o-vfa'
text="Check that UseSTD3ASCIIRules is being used"
idna_test "$text" "" "☺" "\195\162\203\156\194\186."
idna_test "$text" "+noidnin +noidnout" "☺" "\195\162\203\156\194\186."
# idna_test "$text" "+noidnin +idnout" "☺" "xn--o-vfa."
idna_test "$text" "+idnin +noidnout" "☺" "xn--o-vfa."
# idna_fail "$text" "+idnin +idnout" "☺" "âo."
# Test that non-letter characters are preserved in the output. When
# UseSTD3ASCIIRules are enabled, it would mangle non-letter characters like
# `_` (underscore) and `*` (wildcard.
test="Checking valid non-letter characters"
idna_test "$text" "" "*.xn--nxasmq6b.com" "*.xn--nxasmq6b.com."
idna_test "$text" "+noidnin +noidnout" "*.xn--nxasmq6b.com" "*.xn--nxasmq6b.com."
idna_test "$text" "+noidnin +idnout" "*.xn--nxasmq6b.com" "*.βόλοσ.com."
idna_test "$text" "+idnin +noidnout" "*.xn--nxasmq6b.com" "*.xn--nxasmq6b.com."
idna_test "$text" "+idnin +idnout" "*.xn--nxasmq6b.com" "*.βόλοσ.com."
idna_test "$text" "" "_tcp.xn--nxasmq6b.com" "_tcp.xn--nxasmq6b.com."
idna_test "$text" "+noidnin +noidnout" "_tcp.xn--nxasmq6b.com" "_tcp.xn--nxasmq6b.com."
idna_test "$text" "+noidnin +idnout" "_tcp.xn--nxasmq6b.com" "_tcp.βόλοσ.com."
idna_test "$text" "+idnin +noidnout" "_tcp.xn--nxasmq6b.com" "_tcp.xn--nxasmq6b.com."
idna_test "$text" "+idnin +idnout" "_tcp.xn--nxasmq6b.com" "_tcp.βόλοσ.com."
}
+1
View File
@@ -63,4 +63,5 @@ rm -f perl.update_test.out
rm -f nsupdate.out*
rm -f typelist.out.*
rm -f update.out.*
rm -f update.in.*
rm -f verylarge
+4 -3
View File
@@ -750,9 +750,10 @@ ret=0
echo_i "check that changes to the DNSKEY RRset TTL do not have side effects ($n)"
$DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd dnskey.test. \
@10.53.0.3 dnskey | \
sed -n 's/\(.*\)10.IN/update add \1600 IN/p' |
(echo server 10.53.0.3 ${PORT}; cat - ; echo send ) |
$NSUPDATE
awk -v port="${PORT}" 'BEGIN { print "server 10.53.0.3", port; }
$2 == 10 && $3 == "IN" && $4 == "DNSKEY" { $2 = 600; print "update add", $0 }
END { print "send" }' > update.in.$n
$NSUPDATE update.in.$n
$DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd dnskey.test. \
@10.53.0.3 any > dig.out.ns3.$n
+1 -1
View File
@@ -14,7 +14,7 @@
#
rm -f */named.conf
rm -f */named.memstats
rm -f */named.run
rm -f */named.run */named.run.prev
rm -f */ans.run
rm -f */*.jdb
rm -f dig.out dig.out.* dig.*.out.*
+15 -15
View File
@@ -256,10 +256,17 @@ status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that the resolver limits the number of NS records it follows in a referral response ($n)"
# ns5 is the recusor being tested. ns4 holds the sourcens zone containing names with varying numbers of NS
# records pointing to non-existent nameservers in the targetns zone on ns6.
# ns5 is the recusor being tested. ns4 holds the sourcens zone containing
# names with varying numbers of NS records pointing to non-existent
# nameservers in the targetns zone on ns6.
ret=0
$RNDCCMD 10.53.0.5 flush || ret=1 # Ensure cache is empty before doing this test
count_fetches () {
actual=$(nextpartpeek ns5/named.run |
grep " fetch: ns.fake${nscount}" | wc -l)
[ ${actual:-0} -eq ${expected} ] || return 1
return 0
}
for nscount in 1 2 3 4 5 6 7 8 9 10
do
# Verify number of NS records at source server
@@ -267,23 +274,16 @@ do
sourcerecs=`grep NS dig.ns4.out.${nscount}.${n} | grep -v ';' | wc -l`
test $sourcerecs -eq $nscount || ret=1
test $sourcerecs -eq $nscount || echo_i "NS count incorrect for target${nscount}.sourcens"
# Expected queries = 2 * number of NS records, up to a maximum of 10.
expected=`expr 2 \* $nscount`
if [ $expected -gt 10 ]; then expected=10; fi
# Work out the queries made by checking statistics on the target before and after the test
$RNDCCMD 10.53.0.6 stats || ret=1
initial_count=`awk '/responses sent/ {print $1}' ns6/named.stats`
mv ns6/named.stats ns6/named.stats.initial.${nscount}.${n}
# Count the number of logged fetches
nextpart ns5/named.run > /dev/null
$DIG $DIGOPTS @10.53.0.5 target${nscount}.sourcens A > dig.ns5.out.${nscount}.${n} || ret=1
$RNDCCMD 10.53.0.6 stats || ret=1
final_count=`awk '/responses sent/ {print $1}' ns6/named.stats`
mv ns6/named.stats ns6/named.stats.final.${nscount}.${n}
# Check number of queries during the test is as expected
actual=`expr $final_count - $initial_count`
if [ $actual -ne $expected ]; then
echo_i "query count error: $nscount NS records: expected queries $expected, actual $actual"
ret=1
fi
retry_quiet 5 count_fetches ns5/named.run $nscount $expected || {
echo_i "query count error: $nscount NS records: expected queries $expected, actual $actual"; ret=1;
}
done
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
-1
View File
@@ -14,4 +14,3 @@ rm -f ns*/named.memstats
rm -f ns*/named.run
rm -f ns*/rpz*.txt
rm -rf __pycache__
rm -f *.status
+11 -4
View File
@@ -201,23 +201,30 @@ fi
if [ $status -eq 0 ]; then
if [ -n "$PYTEST" ]; then
run=$((run+1))
for test in $(cd "${systest}" && find . -name "tests*.py"); do
rm -f "$systest/$test.status"
if start_servers; then
rm -f "$systest/$test.status"
run=$((run+1))
test_status=0
(cd "$systest" && "$PYTEST" -v "$test" "$@" || echo "$?" > "$test.status") | SYSTESTDIR="$systest" cat_d
if [ -f "$systest/$test.status" ]; then
echo_i "FAILED"
test_status=$(cat "$systest/$test.status")
if [ "$(cat "$systest/$test.status")" = "5" ]; then
echowarn "R:$systest:SKIPPED"
else
echo_i "FAILED"
test_status=$(cat "$systest/$test.status")
fi
fi
status=$((status+test_status))
stop_servers || status=1
else
status=1
fi
if [ $status -ne 0 ]; then
break
fi
done
rm -f "$systest/$test.status"
else
echoinfo "I:$systest:pytest not installed, skipping python tests"
fi
-1
View File
@@ -14,4 +14,3 @@ rm -f ns*/rpz*.txt
rm -f */named.conf
rm -f */named.run
rm -rf __pycache__
rm -f *.status
+2 -2
View File
@@ -202,12 +202,12 @@ sub start_server {
my $child = `$command`;
chomp($child);
# wait up to 25 seconds for the server to start and to write the
# wait up to 40 seconds for the server to start and to write the
# pid file otherwise kill this server and any others that have
# already been started
my $tries = 0;
while (!-s $pid_file) {
if (++$tries > 250) {
if (++$tries > 400) {
print "I:$test:Couldn't start server $command (pid=$child)\n";
print "I:$test:failed\n";
kill "ABRT", $child if ("$child" ne "");
+7 -2
View File
@@ -175,8 +175,13 @@ echo_i "checking bind9.xsl vs xml ($n)"
if $FEATURETEST --have-libxml2 && [ -x "${CURL}" ] && [ -x "${XSLTPROC}" ] ; then
$DIGCMD +notcp +recurse @10.53.0.3 soa . > dig.out.test$n.1 2>&1
$DIGCMD +notcp +recurse @10.53.0.3 soa example > dig.out.test$n.2 2>&1
${CURL} http://10.53.0.3:${EXTRAPORT1}/xml/v3 > curl.out.${n}.xml 2>/dev/null || ret=1
${CURL} http://10.53.0.3:${EXTRAPORT1}/bind9.xsl > curl.out.${n}.xsl 2>/dev/null || ret=1
# check multiple requests over the same socket
time1=$($PERL -e 'print time(), "\n";')
${CURL} --http1.1 -o curl.out.${n}.xml http://10.53.0.3:${EXTRAPORT1}/xml/v3 \
-o curl.out.${n}.xsl http://10.53.0.3:${EXTRAPORT1}/bind9.xsl 2>/dev/null || ret=1
time2=$($PERL -e 'print time(), "\n";')
test $((time2 - time1)) -lt 5 || ret=1
${DIFF} ${TOP_SRCDIR}/bin/named/bind9.xsl curl.out.${n}.xsl || ret=1
${XSLTPROC} curl.out.${n}.xsl - < curl.out.${n}.xml > xsltproc.out.${n} 2>/dev/null || ret=1
cp curl.out.${n}.xml stats.xml.out || ret=1
+2
View File
@@ -28,3 +28,5 @@ rm -f xml.*mem json.*mem
rm -f xml.*stats json.*stats
rm -f zones zones.out.* zones.json.* zones.xml.* zones.expect.*
rm -rf ./__pycache__
rm -f nc.out*
rm -f send.in* send.out*
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/perl
#
# 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.
#
# Send a file to a given address and port using TCP. Used for
# configuring the test server in ans.pl.
#
use IO::File;
use IO::Socket;
@ARGV == 2 or die "usage: send.pl host port\n";
my $host = shift @ARGV;
my $port = shift @ARGV;
my $sock = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port,
Proto => "tcp",) or die "$!";
#send the file
while ($n = read(STDIN, $buf, 64000)) {
$sock->syswrite($buf, $n);
}
#get the response with with a 15 second timeout
my $rin;
my $rout;
my $n;
do {
$rin = '';
vec($rin, fileno($sock), 1) = 1;
$n = select($rout = $rin, undef, undef, 15);
$n = $sock->sysread($buf, 64000) if ($n > 0);
print STDOUT $buf if ($n > 0);
} while ($n > 0);
$sock->close;
+48
View File
@@ -374,5 +374,53 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
if [ -x "${NC}" ] ; then
echo_i "Check HTTP/1.1 pipelined requests are handled ($n)"
ret=0
${NC} 10.53.0.3 ${EXTRAPORT1} << EOF > nc.out$n || ret=1
GET /xml/v3/status HTTP/1.1
Host: 10.53.0.3:${EXTRAPORT1}
GET /xml/v3/status HTTP/1.1
Host: 10.53.0.3:${EXTRAPORT1}
Connection: close
EOF
lines=$(grep "^HTTP/1.1" nc.out$n | wc -l)
test $lines = 2 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
else
echo_i "skipping test as nc not found"
fi
echo_i "Check HTTP/1.1 pipelined with truncated stream ($n)"
ret=0
i=0
# build input stream.
cp /dev/null send.in$n
while test $i -lt 500
do
cat >> send.in$n << EOF
GET /xml/v3/status HTTP/1.1
Host: 10.53.0.3
EOF
i=$((i+1))
done
# send the requests then wait for named to close the socket.
time1=$($PERL -e 'print time(), "\n";')
${PERL} send64k.pl 10.53.0.3 ${EXTRAPORT1} < send.in$n > send.out$n
time2=$($PERL -e 'print time(), "\n";')
test $((time2 - time1)) -lt 5 || ret=1
# we expect 91 of the 500 requests to be processed.
lines=$(grep "^HTTP/1.1" send.out$n | wc -l)
test $lines = 91 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
+22
View File
@@ -0,0 +1,22 @@
#!/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.
#
# Clean up after zone transfer tests.
#
rm -f ./*/named.conf
rm -f ./*/named.memstats
rm -f ./*/named.run
rm -f ./*/named.run.prev
rm -f ./dig.out.*
rm -f ./*/example.db
rm -rf ./headers.*
@@ -0,0 +1,127 @@
/*
* 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.
*/
include "../../common/rndc.key";
controls {
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
tls self-signed {
cert-file "../self-signed-cert.pem";
key-file "../self-signed-key.pem";
};
options {
pid-file "named.pid";
##
# generic test
listen-on port @PORT@ { 10.53.0.1; };
listen-on port @TLSPORT@ tls self-signed { 10.53.0.1; };
# test #1
listen-on port @EXTRAPORT1@ { 10.53.0.1; };
listen-on port @EXTRAPORT1@ tls self-signed { 10.53.0.2; };
listen-on port @EXTRAPORT2@ { 10.53.0.1; };
listen-on port @EXTRAPORT2@ tls self-signed { 10.53.0.2; };
# test #2
listen-on port @EXTRAPORT1@ { 10.53.0.3; };
listen-on port @EXTRAPORT2@ { 10.53.0.3; };
listen-on port @EXTRAPORT1@ tls self-signed { 10.53.0.4; };
listen-on port @EXTRAPORT2@ tls self-signed { 10.53.0.4; };
# test #3
listen-on port @EXTRAPORT3@ tls self-signed { 10.53.0.3; };
listen-on port @EXTRAPORT4@ tls self-signed { 10.53.0.3; };
listen-on port @EXTRAPORT3@ { 10.53.0.4; };
listen-on port @EXTRAPORT4@ { 10.53.0.4; };
# test #4
listen-on port @EXTRAPORT1@ { 10.53.0.5; };
listen-on port @EXTRAPORT2@ { 10.53.0.5; };
listen-on port @EXTRAPORT1@ tls self-signed { 10.53.0.6; };
# test #5
listen-on port @EXTRAPORT3@ tls self-signed { 10.53.0.1; };
listen-on port @EXTRAPORT4@ tls self-signed { 10.53.0.1; };
listen-on port @EXTRAPORT3@ { 10.53.0.2; };
# test #6
listen-on port @EXTRAPORT5@ { 10.53.0.1; };
# test #7
listen-on port @EXTRAPORT6@ tls self-signed { 10.53.0.1; };
# test #7
listen-on port @EXTRAPORT7@ tls self-signed { 10.53.0.1; };
# test #8
listen-on port @EXTRAPORT8@ { 10.53.0.1; };
##
listen-on-v6 { none; };
recursion no;
notify explicit;
statistics-file "named.stats";
dnssec-validation yes;
tcp-initial-timeout 1200;
};
zone "example0" {
type primary;
file "example.db";
allow-transfer port @TLSPORT@ transport tls { any; };
};
zone "example1" {
type primary;
file "example.db";
allow-transfer port @EXTRAPORT1@ { any; };
};
zone "example2" {
type primary;
file "example.db";
allow-transfer transport tcp { any; };
};
zone "example3" {
type primary;
file "example.db";
allow-transfer transport tls { any; };
};
zone "example4" {
type primary;
file "example.db";
allow-transfer port @EXTRAPORT1@ transport tcp { any; };
};
zone "example5" {
type primary;
file "example.db";
allow-transfer port @EXTRAPORT3@ transport tls { any; };
};
zone "example6" {
type primary;
file "example.db";
allow-transfer port @EXTRAPORT5@ transport tcp { 10.53.0.7; 10.53.0.8; 10.53.0.9; };
};
zone "example7" {
type primary;
file "example.db";
allow-transfer port @EXTRAPORT6@ transport tls { 10.53.0.7; 10.53.0.8; 10.53.0.9; };
};
zone "example8" {
type primary;
file "example.db";
allow-transfer port @EXTRAPORT7@ transport tls { 10.53.0.1; 10.53.0.2; 10.53.0.3; };
};
zone "example9" {
type primary;
file "example.db";
allow-transfer port @EXTRAPORT8@ transport tcp { 10.53.0.7; !10.53.0.8; 10.53.0.9; };
};
@@ -0,0 +1,28 @@
-----BEGIN CERTIFICATE-----
MIIEwTCCAymgAwIBAgIUJm/nnhqH3omkx9PqEyewJhYg/sQwDQYJKoZIhvcNAQEL
BQAwbzELMAkGA1UEBhMCVUExGDAWBgNVBAgMD0toYXJraXYgT2JsYXN0JzEQMA4G
A1UEBwwHS2hhcmtpdjEMMAoGA1UECgwDSVNDMQ8wDQYDVQQLDAZTVy1FbmcxFTAT
BgNVBAMMDHRlc3QuaXNjLm9yZzAgFw0yMTExMjkxMTQ0MDRaGA8yMTIxMTEzMDEx
NDQwNFowbzELMAkGA1UEBhMCVUExGDAWBgNVBAgMD0toYXJraXYgT2JsYXN0JzEQ
MA4GA1UEBwwHS2hhcmtpdjEMMAoGA1UECgwDSVNDMQ8wDQYDVQQLDAZTVy1Fbmcx
FTATBgNVBAMMDHRlc3QuaXNjLm9yZzCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCC
AYoCggGBAM8hzYSedQFajsjJKVnZ3BeWLOGULJO2ixQZ/vMnAk6q5a6JFST5DYVA
G84S8GKzswZibNNuKJnuuQO3mBE2+Pioc+vxtewxlzbcQ2EaKgbx5IVezzHtQUYw
WUUdSv7ViKOVeaI9jvXqpYUbbtLogSVkPB+/oWU1Wu4y/TkXc4wEqBxQx+P4kNnj
stCP7r5HMkvBqQgmod5rjqLFohtIQbEhjSBaoK+td25vWUvfG/isduiKx52tC4k3
CBnBOIfvgkNmJk5Rh3RufbiyBSCtgBcH3wp9VSByqC7roFQqzBkZm0aCmuggNmXb
OXU7klEyVmAeiqLvfQSkjNsDmlaTsHCszgIB9RPA4f07KV62uFsdOu0K48yXBnEa
nZeIFqwuTS+PU7T+SnWQGoJLDvCa6IPERqk+5j94BET84/z942WLVqSLlqAoa1rF
5686m2Dgj10SRUpE99bmVg+HZRwO/ZbkLgu+tILqpYpnKP6n8FDpjW0Jnl77uw9S
UeAvbGyw5QIDAQABo1MwUTAdBgNVHQ4EFgQUJV5YRDD9iF+uz9AFx5fA86CtlVQw
HwYDVR0jBBgwFoAUJV5YRDD9iF+uz9AFx5fA86CtlVQwDwYDVR0TAQH/BAUwAwEB
/zANBgkqhkiG9w0BAQsFAAOCAYEAi8sOMYGFs6n1C23vXorx5Zbbym5QkUVgYbxe
9VaBy0Y/PgvXaxtz8zytbtFhyU5izXNZ7k8A4vnJ/TGxoIj503ArBMZj+CiwIBVI
yMzheDp+MY4F19OIy/TsQglYeOEhK/PA9uj5GZYE1Ar6Qck4wl2vk3iaTMsaniyV
zPqCiso2YDLISSvF3nvLcTQ8nX6JyYR/3J0t5biLcissPvubgzguoULRn2VwWw/7
MaRXXPMTBTyCAylJrSgfBKvYmJcnHHocTAZkGElDaYHfALlR+5K9wi/QYwz3kFpN
mS55yjSBlPPxH0rZw8fOdCLNbyzPjP+aXXoTUJa5/X7RNGKQTcuohektsuU1quxo
lugrRYjhiytqBUek3qtBJfmX28LnfZHyKpDpHO6wykQS7FTWb69c6tvAzlwFbH7o
onyhZz1Z2iXw4u7N4nTlj1VqHVMiEr2KUfxtOm5HQ7tZFSaWIA0HfIRB7WD3Escz
DY3Bbu9bS711Yywp+NpvOqBSvMon
-----END CERTIFICATE-----
@@ -0,0 +1,40 @@
-----BEGIN PRIVATE KEY-----
MIIG/AIBADANBgkqhkiG9w0BAQEFAASCBuYwggbiAgEAAoIBgQDPIc2EnnUBWo7I
ySlZ2dwXlizhlCyTtosUGf7zJwJOquWuiRUk+Q2FQBvOEvBis7MGYmzTbiiZ7rkD
t5gRNvj4qHPr8bXsMZc23ENhGioG8eSFXs8x7UFGMFlFHUr+1YijlXmiPY716qWF
G27S6IElZDwfv6FlNVruMv05F3OMBKgcUMfj+JDZ47LQj+6+RzJLwakIJqHea46i
xaIbSEGxIY0gWqCvrXdub1lL3xv4rHboisedrQuJNwgZwTiH74JDZiZOUYd0bn24
sgUgrYAXB98KfVUgcqgu66BUKswZGZtGgproIDZl2zl1O5JRMlZgHoqi730EpIzb
A5pWk7BwrM4CAfUTwOH9OyletrhbHTrtCuPMlwZxGp2XiBasLk0vj1O0/kp1kBqC
Sw7wmuiDxEapPuY/eARE/OP8/eNli1aki5agKGtaxeevOptg4I9dEkVKRPfW5lYP
h2UcDv2W5C4LvrSC6qWKZyj+p/BQ6Y1tCZ5e+7sPUlHgL2xssOUCAwEAAQKCAYAy
VN9wy2RZKN0rUx5WNAc0QAy13+CZIDFZeBuokCESZpqbN7pImrA7YeGfyKBbC5mE
AqS5F7qL9SNGEPXFsRr8qUpJ2hk/xKke7pT84nO17k9+TRSB6EoFOThn//86Pz8N
qQO+dcDoZtVDq+/ZFiBTqrClclZQlo969C7uEZHFQ1hqUQLRlZP1LkxEO8VivUAu
gmeFkIWi23X0fZuvj3ZPCX0WkI8dQUSVND95nURZv+bBCQAKg4MbG6E/SOFovrzz
ohKK2zqSU+ncfWROYX/ulKMJKIhOKtxkprBnj2nSemTUEf5gDk9oDqsYClGmEcSL
XvNxq3WpVt4u7Fsr1QZ6fh/IYIQnKvI/H0wwYojtzkh3FGdb/K0dnKeoebUqlc9Q
4UwKGshhcbk2130t/zIdd5wnL5uj+xjh0cYSO5JqlcZwXC97SWDmEowCo8M/k8ie
c9cQeIOXUKvT3DvnEh1LAtfI8gW3g9GVHad4k25dQ4ZSiyXsKL2+mOWn+4WmQx0C
gcEA6UqykoDp2j6nfMA+5fEfNOplyXJMyTBxMoaFb+cO8P2qjjKOMyLJewXqW/3g
wWaPcl3dGVCPaqmQxf+fDEarSkDxkroN02YaQy3xdAAZvoUDc00VKq9BFe3TZEuP
7/sN3t3Ey7K5KVyKgh4cGPqSCCXrk3OPCyiRFxWa4wQAXuntT1iXkXGzXuoDPzCH
xWRiM+z3se6PdoPXMbJhuL04b4CIUmHSrGbqtO5bi6IDOksIhaKMFs4c7escSF+7
jj0zAoHBAONLPcUT9uhzMIXe9BBdRYms65G3VjsTbS8MC/QiR6nl5/evQb0hDp0G
/tbLf9F9QVMA2onhK1mjafHFC4oVrwrLT+VZezKsQm3ICoqOFqxL+6dAu93A2dDA
99YCc6pCrmagaDpA5tz1UwBwA77pl2aMV2g7iIe2p+hmL6dx6Tp8jN+Mu0KXViyT
gPG9LITJQSu13EZgRukNnYu7+L2+NWfyGCbfCJ5/2qXmryjefoboR48sa8jZyUmQ
rf/VAG3phwKBwDE/lqD82+E5tsvMHbsXAtp93Q0AtxsFwe/DnCm6YloXgsjP/Vro
LhZtckMHPko1p3SiQgmVCyGeODTEOMQzqvda7GRoKIEHHeYurbkqSEUC+W5+yEgh
hSDm+uhCV1l26z+wG1pRGWuU4JyFVLMlOmzD7I5NJ9ZYMwDni7H+50EiKvnEHwMS
OKaByjutuAvAnEaP8N48GUcQn/4axSxlraNERAL4KaxBcazOYL8CbaIBswPbA63Q
xySmrGrO4t4tJwKBwGITmnDKv5Tn930cimXxSUsyAWgcGypcpJVTdmj+zbuDCAg5
aH1qoTqixR38K4hCqwhc6u/p6GHCgLmhU+xelOxsdGo7pUxlRjjGw72ruB7anpk5
9pamW5aXXZnL7wr9wPFpr+/LB5M6jHk43HTpqLnIPwMsBSrCZ0uBpHh1T7U7/zGL
MVZ3pOiRMWeeQHJ/wQ5SZ906N/7iMCQWlSuSwsq6jS9guABknP1PQC+7ag9edVpT
SaMeTpvewSYOTCQhSwKBwEmZP/Jh76G3bETPSPcIyPB0vgYmYiAftmvtwHzUL14V
dOfNbwXF6WiepSceLbw99LNpMwfRfKBGVDLRhKMqL7QR8ZKNew5AvfXVZ1yDNKu+
/4hqFLUhsAARsfNofAzvKOtWmghVBzO9TauAyv3prFgjfvDkA+EZ2amDvXChkP/Q
7ck2aIUu9Sr4kPTUigIRlu6c18QQiLobXC7yKx6GhEpJsh9xGHHDJqkG16l+u1ju
bEd5UJArJoST5lff5y7MyQ==
-----END PRIVATE KEY-----
+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.
# shellcheck disable=SC1091
. ../conf.sh
$SHELL clean.sh
$SHELL "${TOP_SRCDIR}"/bin/tests/system/genzone.sh 2 > ns1/example.db
copy_setports ns1/named.conf.in ns1/named.conf
+120
View File
@@ -0,0 +1,120 @@
#!/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 disable=SC1091
. ../conf.sh
dig_out_basename="dig.out.test"
testing="testing allow-transfer transport ACL functionality"
dig_with_opts() {
# shellcheck disable=SC2086
"$DIG" +noadd +nosea +nostat +noquest +nocmd "$@"
}
status=0
n=0
run_dig_test () {
test_message="$1"
shift
n=$((n+1))
echo_i "$test_message ($n)"
ret=0
dig_with_opts "$@" > "$dig_out_basename$n" || ret=1
}
run_dig_expect_axfr_success () {
run_dig_test "$@"
grep "; Transfer failed" "$dig_out_basename$n" > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
}
run_dig_expect_axfr_failure () {
run_dig_test "$@"
grep "; Transfer failed" "$dig_out_basename$n" > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
}
# generic tests
run_dig_expect_axfr_success "$testing for XoT" -p "${TLSPORT}" +tls -b 10.53.0.10 @10.53.0.1 axfr example0
run_dig_expect_axfr_failure "$testing XFR via TCP (failure expected)" -p "${PORT}" +tcp -b 10.53.0.10 @10.53.0.1 axfr example0
# 1. Test allow-transfer port X, transfer works with TCP and TLS on port X but not port Y.
run_dig_expect_axfr_success "$testing for XFR via TCP" -p "${EXTRAPORT1}" +tcp -b 10.53.0.10 @10.53.0.1 axfr example1
run_dig_expect_axfr_success "$testing for XoT" -p "${EXTRAPORT1}" +tls -b 10.53.0.10 @10.53.0.2 axfr example1
run_dig_expect_axfr_failure "$testing for XFR via TCP (failure expected)" -p "${EXTRAPORT2}" +tcp -b 10.53.0.10 @10.53.0.1 axfr example1
run_dig_expect_axfr_failure "$testing for XoT (failure expected)" -p "${EXTRAPORT2}" +tls -b 10.53.0.10 @10.53.0.2 axfr example1
# 2. Test allow-transfer transport tcp, transfer works with TCP on any port but not TLS.
run_dig_expect_axfr_success "$testing for XFR via TCP" -p "${EXTRAPORT1}" +tcp -b 10.53.0.10 @10.53.0.3 axfr example2
run_dig_expect_axfr_success "$testing for XFR via TCP" -p "${EXTRAPORT2}" +tcp -b 10.53.0.10 @10.53.0.3 axfr example2
run_dig_expect_axfr_failure "$testing for XoT (failure expected)" -p "${EXTRAPORT1}" +tls -b 10.53.0.10 @10.53.0.4 axfr example2
run_dig_expect_axfr_failure "$testing for XoT (failure expected)" -p "${EXTRAPORT2}" +tls -b 10.53.0.10 @10.53.0.4 axfr example2
# 3. Test allow-transfer transport tls, transfer works with TLS on any port but not TCP.
run_dig_expect_axfr_success "$testing for XoT" -p "${EXTRAPORT3}" +tls -b 10.53.0.10 @10.53.0.3 axfr example3
run_dig_expect_axfr_success "$testing for XoT" -p "${EXTRAPORT4}" +tls -b 10.53.0.10 @10.53.0.3 axfr example3
run_dig_expect_axfr_failure "$testing for XFR via TCP (failure expected)" -p "${EXTRAPORT3}" +tcp -b 10.53.0.10 @10.53.0.4 axfr example3
run_dig_expect_axfr_failure "$testing for XFR via TCP (failure expected)" -p "${EXTRAPORT4}" +tcp -b 10.53.0.10 @10.53.0.4 axfr example3
# 4. Test allow-transfer port X transport tcp, transfer works with TCP on port X but not port Y and not with TLS on port X.
run_dig_expect_axfr_success "$testing for XFR via TCP" -p "${EXTRAPORT1}" +tcp -b 10.53.0.10 @10.53.0.5 axfr example4
run_dig_expect_axfr_failure "$testing for XFR via TCP (failure expected)" -p "${EXTRAPORT2}" +tcp -b 10.53.0.10 @10.53.0.5 axfr example4
run_dig_expect_axfr_failure "$testing for XoT (failure expected)" -p "${EXTRAPORT1}" +tls -b 10.53.0.10 @10.53.0.6 axfr example4
# 5. Test allow-transfer port X transport tls, transfer works with TLS on port X but not port Y and not with TCP on port X.
run_dig_expect_axfr_success "$testing for XoT" -p "${EXTRAPORT3}" +tls -b 10.53.0.10 @10.53.0.1 axfr example5
run_dig_expect_axfr_failure "$testing for XoT (failure expected)" -p "${EXTRAPORT4}" +tls -b 10.53.0.10 @10.53.0.1 axfr example5
run_dig_expect_axfr_failure "$testing for XFR via TCP (failure expected)" -p "${EXTRAPORT3}" +tcp -b 10.53.0.10 @10.53.0.2 axfr example5
# 6. Test with multiple allow-transfer available, first ACL is a match.
run_dig_expect_axfr_success "$testing for XFR via TCP" -p "${EXTRAPORT5}" +tcp -b 10.53.0.7 @10.53.0.1 axfr example6
run_dig_expect_axfr_failure "$testing for XFR via TCP (failure expected)" -p "${EXTRAPORT5}" +tcp -b 10.53.0.6 @10.53.0.1 axfr example6
# 7. Test with multiple allow-transfer available, last ACL is a match.
run_dig_expect_axfr_success "$testing for XoT" -p "${EXTRAPORT6}" +tls -b 10.53.0.9 @10.53.0.1 axfr example7
run_dig_expect_axfr_failure "$testing for XoT (failure expected)" -p "${EXTRAPORT6}" +tls -b 10.53.0.6 @10.53.0.1 axfr example7
# 8. Test with multiple allow-transfer available, no ACL is a match.
run_dig_expect_axfr_failure "$testing for XoT (failure expected)" -p "${EXTRAPORT7}" +tls -b 10.53.0.7 @10.53.0.1 axfr example8
# 9. Test with multiple allow-transfer available, negated ACL is used.
run_dig_expect_axfr_success "$testing for XFR via TCP" -p "${EXTRAPORT8}" +tcp -b 10.53.0.7 @10.53.0.1 axfr example9
run_dig_expect_axfr_failure "$testing for XoT (failure expected)" -p "${EXTRAPORT8}" +tcp -b 10.53.0.8 @10.53.0.1 axfr example9
run_dig_expect_axfr_success "$testing for XFR via TCP" -p "${EXTRAPORT8}" +tcp -b 10.53.0.9 @10.53.0.1 axfr example9
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
+18
View File
@@ -0,0 +1,18 @@
############################################################################
# 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.
############################################################################
import os
import pytest
@pytest.fixture(scope='module')
def named_port():
return int(os.environ.get("PORT", default=5300))
@@ -0,0 +1,4 @@
$ORIGIN allwild.test.
allwild.test. 3600 IN SOA . . 0 0 0 0 0
allwild.test. 3600 NS ns.example.test.
*.allwild.test. 3600 A 192.0.2.1
@@ -27,6 +27,7 @@ zone "." { type primary; file "root.db.signed"; };
/*
* RFC 4592 example zone.
*/
zone "allwild.test" { type primary; file "allwild.db"; };
zone "example" { type primary; file "example.db"; };
zone "nsec" { type primary; file "nsec.db.signed"; };
zone "private.nsec" { type primary; file "private.nsec.db.signed"; };
+1
View File
@@ -16,6 +16,7 @@ SYSTESTDIR=wildcard
dssets=
# RFC 4592 example zone.
cp allwild.db.in allwild.db
cp example.db.in example.db
zone=nsec
+103
View File
@@ -0,0 +1,103 @@
#!/usr/bin/python3
############################################################################
# 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.
############################################################################
"""
Example property-based test for wildcard synthesis.
Verifies that otherwise-empty zone with single wildcard record * A 192.0.2.1
produces synthesized answers for <random_label>.test. A, and returns NODATA for
<random_label>.test. when rdtype is not A.
Limitations - untested properties:
- expansion works with multiple labels
- asterisk in qname does not cause expansion
- empty non-terminals prevent expansion
- or more generally any existing node prevents expansion
- DNSSEC record inclusion
- possibly others, see RFC 4592 and company
- content of authority & additional sections
- flags beyond RCODE
- special behavior of rdtypes like CNAME
"""
import pytest
pytest.importorskip("dns")
import dns.message
import dns.name
import dns.query
import dns.rcode
import dns.rdatatype
pytest.importorskip("hypothesis")
from hypothesis import given
from hypothesis.strategies import binary, integers
# labels of a zone with * A 192.0.2.1 wildcard
WILDCARD_ZONE = ('allwild', 'test', '')
WILDCARD_RDTYPE = dns.rdatatype.A
WILDCARD_RDATA = '192.0.2.1'
IPADDR = '10.53.0.1'
TIMEOUT = 5 # seconds, just a sanity check
# Helpers
def is_nonexpanding_rdtype(rdtype):
"""skip meta types to avoid weird rcodes caused by AXFR etc.; RFC 6895"""
return not(rdtype == WILDCARD_RDTYPE
or dns.rdatatype.is_metatype(rdtype) # known metatypes: OPT ...
or 128 <= rdtype <= 255) # unknown meta types
def tcp_query(where, port, qname, qtype):
querymsg = dns.message.make_query(qname, qtype)
assert len(querymsg.question) == 1
return querymsg, dns.query.tcp(querymsg, where, port=port, timeout=TIMEOUT)
def query(where, port, label, rdtype):
labels = (label, ) + WILDCARD_ZONE
qname = dns.name.Name(labels)
return tcp_query(where, port, qname, rdtype)
# Tests
@given(label=binary(min_size=1, max_size=63),
rdtype=integers(min_value=0, max_value=65535).filter(
is_nonexpanding_rdtype))
def test_wildcard_rdtype_mismatch(label, rdtype, named_port):
"""any label non-matching rdtype must result in to NODATA"""
check_answer_nodata(*query(IPADDR, named_port, label, rdtype))
def check_answer_nodata(querymsg, answer):
assert querymsg.is_response(answer), str(answer)
assert answer.rcode() == dns.rcode.NOERROR, str(answer)
assert answer.answer == [], str(answer)
@given(label=binary(min_size=1, max_size=63))
def test_wildcard_match(label, named_port):
"""any label with maching rdtype must result in wildcard data in answer"""
check_answer_noerror(*query(IPADDR, named_port, label, WILDCARD_RDTYPE))
def check_answer_noerror(querymsg, answer):
assert querymsg.is_response(answer), str(answer)
assert answer.rcode() == dns.rcode.NOERROR, str(answer)
assert len(querymsg.question) == 1, str(answer)
expected_answer = [dns.rrset.from_text(
querymsg.question[0].name,
300, # TTL, ignored by dnspython comparison
dns.rdataclass.IN,
WILDCARD_RDTYPE,
WILDCARD_RDATA)]
assert answer.answer == expected_answer, str(answer)
+44
View File
@@ -27,6 +27,7 @@
#include <isc/netmgr.h>
#include <isc/nonce.h>
#include <isc/parseint.h>
#include <isc/portset.h>
#include <isc/print.h>
#include <isc/random.h>
#include <isc/result.h>
@@ -2054,6 +2055,47 @@ parse_args(bool is_batchfile, int argc, char **argv) {
}
}
/*
* Try honoring the operating system's preferred ephemeral port range.
*/
static void
set_source_ports(dns_dispatchmgr_t *manager) {
isc_portset_t *v4portset = NULL, *v6portset = NULL;
in_port_t udpport_low, udpport_high;
isc_result_t result;
result = isc_portset_create(mctx, &v4portset);
if (result != ISC_R_SUCCESS) {
fatal("isc_portset_create (v4) failed");
}
result = isc_net_getudpportrange(AF_INET, &udpport_low, &udpport_high);
if (result != ISC_R_SUCCESS) {
fatal("isc_net_getudpportrange (v4) failed");
}
isc_portset_addrange(v4portset, udpport_low, udpport_high);
result = isc_portset_create(mctx, &v6portset);
if (result != ISC_R_SUCCESS) {
fatal("isc_portset_create (v6) failed");
}
result = isc_net_getudpportrange(AF_INET6, &udpport_low, &udpport_high);
if (result != ISC_R_SUCCESS) {
fatal("isc_net_getudpportrange (v6) failed");
}
isc_portset_addrange(v6portset, udpport_low, udpport_high);
result = dns_dispatchmgr_setavailports(manager, v4portset, v6portset);
if (result != ISC_R_SUCCESS) {
fatal("dns_dispatchmgr_setavailports failed");
}
isc_portset_destroy(mctx, &v4portset);
isc_portset_destroy(mctx, &v6portset);
}
/*% Main processing routine for mdig */
int
main(int argc, char *argv[]) {
@@ -2119,6 +2161,8 @@ main(int argc, char *argv[]) {
RUNCHECK(isc_task_create(taskmgr, 0, &task));
RUNCHECK(dns_dispatchmgr_create(mctx, netmgr, &dispatchmgr));
set_source_ports(dispatchmgr);
if (have_ipv4) {
isc_sockaddr_any(&bind_any);
} else {
+1 -1
View File
@@ -25,6 +25,6 @@ statement S1, S2;
- V = dns_name_copy(E1, E2, NULL);
- S1
- if (V == ISC_R_SUCCESS) S2
+ dns_name_copy(E1, E2):
+ dns_name_copy(E1, E2);
+ S1
+ S2
+9 -2
View File
@@ -14,7 +14,7 @@
#
m4_define([bind_VERSION_MAJOR], 9)dnl
m4_define([bind_VERSION_MINOR], 17)dnl
m4_define([bind_VERSION_PATCH], 19)dnl
m4_define([bind_VERSION_PATCH], 20)dnl
m4_define([bind_VERSION_EXTRA], )dnl
m4_define([bind_DESCRIPTION], [(Development Release)])dnl
m4_define([bind_SRCID], [m4_esyscmd_s([git rev-parse --short HEAD | cut -b1-7])])dnl
@@ -624,7 +624,7 @@ AC_COMPILE_IFELSE(
# Check for functions added in OpenSSL or LibreSSL
#
AC_CHECK_FUNCS([OPENSSL_init_ssl OPENSSL_init_crypto])
AC_CHECK_FUNCS([OPENSSL_init_ssl OPENSSL_init_crypto OPENSSL_cleanup])
AC_CHECK_FUNCS([CRYPTO_zalloc])
AC_CHECK_FUNCS([EVP_PKEY_new_raw_private_key EVP_PKEY_eq])
AC_CHECK_FUNCS([EVP_CIPHER_CTX_new EVP_CIPHER_CTX_free])
@@ -1256,6 +1256,13 @@ AC_CONFIG_FILES([doc/doxygen/doxygen-input-filter],
AC_PATH_PROG(CURL, curl, curl)
AC_SUBST(CURL)
#
# Look for nc
#
AC_PATH_PROGS(NC, nc, nc)
AC_SUBST(NC)
#
# IDN support using libidn2
#
+1
View File
@@ -52,6 +52,7 @@ https://www.isc.org/download/. There you will find additional
information about each release, and source code.
.. include:: ../notes/notes-current.rst
.. include:: ../notes/notes-9.17.20.rst
.. include:: ../notes/notes-9.17.19.rst
.. include:: ../notes/notes-9.17.18.rst
.. include:: ../notes/notes-9.17.17.rst
+18 -15
View File
@@ -293,7 +293,7 @@ The following statements are supported:
Declares communication channels to get access to ``named`` statistics.
``tls``
Specifies configuration information for a TLS connection, including a ``key-file``, ``cert-file``, ``ca-file``, ``dhparam-file``, ``hostname``, ``ciphers``, ``protocols``, ``prefer-server-ciphers``, and ``session-tickets``.
Specifies configuration information for a TLS connection, including a ``key-file``, ``cert-file``, ``dhparam-file``, ``ciphers``, ``protocols``, ``prefer-server-ciphers``, and ``session-tickets``.
``http``
Specifies configuration information for an HTTP connection, including ``endponts``, ``listener-clients`` and ``streams-per-connection``.
@@ -1920,8 +1920,8 @@ Boolean Options
``cookie-algorithm``
This sets the algorithm to be used when generating the server cookie; the options are
"aes", "sha1", or "sha256". The default is "aes" if supported by
the cryptographic library; otherwise, "sha256".
"aes" or "siphash24". The default is "siphash24". The "aes" option remains for legacy
purposes.
``cookie-secret``
If set, this is a shared secret used for generating and verifying
@@ -2416,6 +2416,14 @@ for details on how to specify IP address lists.
statement set in ``options`` or ``view``. If not specified, the
default is to allow transfers to all hosts.
The transport level limitations can also be specified. In
particular, zone transfers can be restricted to a specific port and
DNS transport protocol by using the options ``port`` and
``transport``. Zone transfers are currently only possible via the
TCP and TLS transports; either option can be specified.
For example: ``allow-transfer port 853 transport tls { any; };``
``blackhole``
This specifies a list of addresses which the server does not accept queries
from or use to resolve a query. Queries from these addresses are not
@@ -2990,12 +2998,13 @@ system.
The current list of active fetches can be dumped by running
``rndc recursing``. The list includes the number of active fetches
for each domain and the number of queries that have been passed or
dropped as a result of the ``fetches-per-zone`` limit. (Note: these
counters are not cumulative over time; whenever the number of active
fetches for a domain drops to zero, the counter for that domain is
deleted, and the next time a fetch is sent to that domain, it is
recreated with the counters set to zero.)
for each domain and the number of queries that have been passed
(allowed) or dropped (spilled) as a result of the ``fetches-per-zone``
limit. (Note: these counters are not cumulative over time;
whenever the number of active fetches for a domain drops to zero,
the counter for that domain is deleted, and the next time a fetch
is sent to that domain, it is recreated with the counters set
to zero.)
``fetches-per-server``
This sets the maximum number of simultaneous iterative queries that the server
@@ -4756,9 +4765,6 @@ The following options can be specified in a ``tls`` statement:
Path to a file containing the TLS certificate to be used for
the connection.
``ca-file``
Path to a file containing trusted TLS certificates.
``dhparam-file``
Path to a file containing Diffie-Hellman parameters,
which is needed to enable the cipher suites depending on the
@@ -4766,9 +4772,6 @@ The following options can be specified in a ``tls`` statement:
specified is essential for enabling perfect forward secrecy capable
ciphers in TLSv1.2.
``hostname``
The hostname associated with the certificate.
``protocols``
Allowed versions of the TLS protocol. TLS version 1.2 and higher are
supported, depending on the cryptographic library in use. Multiple
+4
View File
@@ -44,6 +44,10 @@ dnssec-dsfromkey \- DNSSEC DS RR generation tool
The \fBdnssec\-dsfromkey\fP command outputs DS (Delegation Signer) resource records
(RRs), or CDS (Child DS) RRs with the \fB\-C\fP option.
.sp
By default, only KSKs are converted (keys with flags = 257). The
\fB\-A\fP option includes ZSKs (flags = 256). Revoked keys are never
included.
.sp
The input keys can be specified in a number of ways:
.sp
By default, \fBdnssec\-dsfromkey\fP reads a key file named in the format
+8 -6
View File
@@ -233,7 +233,8 @@ options {
allow\-query\-on { address_match_element; ... };
allow\-recursion { address_match_element; ... };
allow\-recursion\-on { address_match_element; ... };
allow\-transfer { address_match_element; ... };
allow\-transfer [ port integer ] [ transport string ] {
address_match_element; ... };
allow\-update { address_match_element; ... };
allow\-update\-forwarding { address_match_element; ... };
also\-notify [ port integer ] [ dscp integer ] { (
@@ -652,11 +653,9 @@ statistics\-channels {
.nf
.ft C
tls string {
ca\-file quoted_string;
cert\-file quoted_string;
ciphers string;
dhparam\-file quoted_string;
hostname quoted_string;
key\-file quoted_string;
prefer\-server\-ciphers boolean;
protocols { string; ... };
@@ -710,7 +709,8 @@ view string [ class ] {
allow\-query\-on { address_match_element; ... };
allow\-recursion { address_match_element; ... };
allow\-recursion\-on { address_match_element; ... };
allow\-transfer { address_match_element; ... };
allow\-transfer [ port integer ] [ transport string ] {
address_match_element; ... };
allow\-update { address_match_element; ... };
allow\-update\-forwarding { address_match_element; ... };
also\-notify [ port integer ] [ dscp integer ] { (
@@ -994,7 +994,8 @@ view string [ class ] {
allow\-notify { address_match_element; ... };
allow\-query { address_match_element; ... };
allow\-query\-on { address_match_element; ... };
allow\-transfer { address_match_element; ... };
allow\-transfer [ port integer ] [ transport string ] {
address_match_element; ... };
allow\-update { address_match_element; ... };
allow\-update\-forwarding { address_match_element; ... };
also\-notify [ port integer ] [ dscp integer ] { (
@@ -1118,7 +1119,8 @@ zone string [ class ] {
allow\-notify { address_match_element; ... };
allow\-query { address_match_element; ... };
allow\-query\-on { address_match_element; ... };
allow\-transfer { address_match_element; ... };
allow\-transfer [ port integer ] [ transport string ] {
address_match_element; ... };
allow\-update { address_match_element; ... };
allow\-update\-forwarding { address_match_element; ... };
also\-notify [ port integer ] [ dscp integer ] { (
+18 -5
View File
@@ -372,11 +372,24 @@ full \fBreload\fP when there is a large number of zones, because it
avoids the need to examine the modification times of the zone files.
.TP
.B \fBrecursing\fP
This command dumps the list of queries \fBnamed\fP is currently recursing on, and the
list of domains to which iterative queries are currently being sent.
The second list includes the number of fetches currently active for
the given domain, and how many have been passed or dropped because of
the \fBfetches\-per\-zone\fP option.
This command dumps the list of queries \fBnamed\fP is currently
recursing on, and the list of domains to which iterative queries
are currently being sent.
.sp
The first list includes all unique clients that are waiting for
recursion to complete, including the query that is awaiting a
response and the timestamp (seconds since the Unix epoch) of
when named started processing this client query.
.sp
The second list comprises of domains for which there are active
(or recently active) fetches in progress. It reports the number
of active fetches for each domain and the number of queries that
have been passed (allowed) or dropped (spilled) as a result of
the \fBfetches\-per\-zone\fP limit. (Note: these counters are not
cumulative over time; whenever the number of active fetches for
a domain drops to zero, the counter for that domain is deleted,
and the next time a fetch is sent to that domain, it is recreated
with the counters set to zero).
.TP
.B \fBrefresh\fP \fIzone\fP [\fIclass\fP [\fIview\fP]]
This command schedules zone maintenance for the given zone.
+1 -1
View File
@@ -2,7 +2,7 @@ zone <string> [ <class> ] {
type ( master | primary );
allow-query { <address_match_element>; ... };
allow-query-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] { <address_match_element>; ... };
allow-update { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { ( <remote-servers> | <ipv4_address> [ port <integer> ] | <ipv6_address> [ port <integer> ] ) [ key <string> ] [ tls <string> ]; ... };
alt-transfer-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ] [ dscp <integer> ];
+1 -1
View File
@@ -4,7 +4,7 @@
type ( master | primary );
allow-query { <address_match_element>; ... };
allow-query-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] { <address_match_element>; ... };
allow-update { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { ( <remote-servers> | <ipv4_address> [ port <integer> ] | <ipv6_address> [ port <integer> ] ) [ key <string> ] [ tls <string> ]; ... };
alt-transfer-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ] [ dscp <integer> ];
+1 -1
View File
@@ -3,7 +3,7 @@ zone <string> [ <class> ] {
allow-notify { <address_match_element>; ... };
allow-query { <address_match_element>; ... };
allow-query-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { ( <remote-servers> | <ipv4_address> [ port <integer> ] | <ipv6_address> [ port <integer> ] ) [ key <string> ] [ tls <string> ]; ... };
alt-transfer-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ] [ dscp <integer> ];
+1 -1
View File
@@ -5,7 +5,7 @@
allow-notify { <address_match_element>; ... };
allow-query { <address_match_element>; ... };
allow-query-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { ( <remote-servers> | <ipv4_address> [ port <integer> ] | <ipv6_address> [ port <integer> ] ) [ key <string> ] [ tls <string> ]; ... };
alt-transfer-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ] [ dscp <integer> ];
+8 -6
View File
@@ -90,7 +90,8 @@ options {
allow-query-on { <address_match_element>; ... };
allow-recursion { <address_match_element>; ... };
allow-recursion-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] {
<address_match_element>; ... };
allow-update { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { (
@@ -457,11 +458,9 @@ statistics-channels {
}; // may occur multiple times
tls <string> {
ca-file <quoted_string>;
cert-file <quoted_string>;
ciphers <string>;
dhparam-file <quoted_string>;
hostname <quoted_string>;
key-file <quoted_string>;
prefer-server-ciphers <boolean>;
protocols { <string>; ... };
@@ -486,7 +485,8 @@ view <string> [ <class> ] {
allow-query-on { <address_match_element>; ... };
allow-recursion { <address_match_element>; ... };
allow-recursion-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] {
<address_match_element>; ... };
allow-update { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { (
@@ -772,7 +772,8 @@ view <string> [ <class> ] {
allow-notify { <address_match_element>; ... };
allow-query { <address_match_element>; ... };
allow-query-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] {
<address_match_element>; ... };
allow-update { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { (
@@ -888,7 +889,8 @@ zone <string> [ <class> ] {
allow-notify { <address_match_element>; ... };
allow-query { <address_match_element>; ... };
allow-query-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] {
<address_match_element>; ... };
allow-update { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { (
+8 -6
View File
@@ -89,7 +89,8 @@ options {
allow-query-on { <address_match_element>; ... };
allow-recursion { <address_match_element>; ... };
allow-recursion-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] {
<address_match_element>; ... };
allow-update { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { (
@@ -454,11 +455,9 @@ statistics-channels {
}; // may occur multiple times
tls <string> {
ca-file <quoted_string>;
cert-file <quoted_string>;
ciphers <string>;
dhparam-file <quoted_string>;
hostname <quoted_string>;
key-file <quoted_string>;
prefer-server-ciphers <boolean>;
protocols { <string>; ... };
@@ -483,7 +482,8 @@ view <string> [ <class> ] {
allow-query-on { <address_match_element>; ... };
allow-recursion { <address_match_element>; ... };
allow-recursion-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] {
<address_match_element>; ... };
allow-update { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { (
@@ -767,7 +767,8 @@ view <string> [ <class> ] {
allow-notify { <address_match_element>; ... };
allow-query { <address_match_element>; ... };
allow-query-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] {
<address_match_element>; ... };
allow-update { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { (
@@ -882,7 +883,8 @@ zone <string> [ <class> ] {
allow-notify { <address_match_element>; ... };
allow-query { <address_match_element>; ... };
allow-query-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] {
<address_match_element>; ... };
allow-update { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { (
+2 -1
View File
@@ -9,7 +9,8 @@
allow-query-on { <address_match_element>; ... };
allow-recursion { <address_match_element>; ... };
allow-recursion-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] {
<address_match_element>; ... };
allow-update { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { (
+1 -1
View File
@@ -3,7 +3,7 @@ zone <string> [ <class> ] {
allow-notify { <address_match_element>; ... };
allow-query { <address_match_element>; ... };
allow-query-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { ( <remote-servers> | <ipv4_address> [ port <integer> ] | <ipv6_address> [ port <integer> ] ) [ key <string> ] [ tls <string> ]; ... };
alt-transfer-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ] [ dscp <integer> ];
+1 -1
View File
@@ -5,7 +5,7 @@
allow-notify { <address_match_element>; ... };
allow-query { <address_match_element>; ... };
allow-query-on { <address_match_element>; ... };
allow-transfer { <address_match_element>; ... };
allow-transfer [ port <integer> ] [ transport <string> ] { <address_match_element>; ... };
allow-update-forwarding { <address_match_element>; ... };
also-notify [ port <integer> ] [ dscp <integer> ] { ( <remote-servers> | <ipv4_address> [ port <integer> ] | <ipv6_address> [ port <integer> ] ) [ key <string> ] [ tls <string> ]; ... };
alt-transfer-source ( <ipv4_address> | * ) [ port ( <integer> | * ) ] [ dscp <integer> ];
-2
View File
@@ -1,11 +1,9 @@
::
tls <string> {
ca-file <quoted_string>;
cert-file <quoted_string>;
ciphers <string>;
dhparam-file <quoted_string>;
hostname <quoted_string>;
key-file <quoted_string>;
prefer-server-ciphers <boolean>;
protocols { <string>; ... };
+83
View File
@@ -0,0 +1,83 @@
..
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.
Notes for BIND 9.17.20
----------------------
New Features
~~~~~~~~~~~~
- New finer-grained ``update-policy`` rule types,
``krb5-subdomain-self-rhs`` and ``ms-subdomain-self-rhs``, were added.
These rule types restrict updates to SRV and PTR records so that their
content can only match the machine name embedded in the Kerberos
principal making the change. :gl:`#481`
- Support for OpenSSL 3.0.0 APIs was added. :gl:`#2843`
Removed Features
~~~~~~~~~~~~~~~~
- OpenSSL 3.0.0 deprecated support for so-called "engines." Since BIND 9
currently uses engine_pkcs11 for PKCS#11, compiling BIND 9 against an
OpenSSL 3.0.0 build which does not retain support for deprecated APIs
makes it impossible to use PKCS#11 in BIND 9. A replacement for
engine_pkcs11 which employs the new "provider" approach introduced in
OpenSSL 3.0.0 is in the making. :gl:`#2843`
- Since the old socket manager API has been removed, "socketmgr"
statistics are no longer reported by the :ref:`statistics channel
<statschannels>`. :gl:`#2926`
Feature Changes
~~~~~~~~~~~~~~~
- The default for ``dnssec-dnskey-kskonly`` was changed to ``yes``. This
means that DNSKEY, CDNSKEY, and CDS RRsets are now only signed with
the KSK by default. The additional signatures prepared using the ZSK
when the option is set to ``no`` add to the DNS response payload
without offering added value. :gl:`#1316`
- The default NSEC3 parameters for ``dnssec-policy`` were updated to no
extra SHA-1 iterations and no salt (``NSEC3PARAM 1 0 0 -``).
:gl:`#2956`
- Internal data structures maintained for each cache database are now
grown incrementally when they need to be expanded. This helps maintain
a steady response rate on a loaded resolver while these internal data
structures are resized. :gl:`#2941`
- The output of ``rndc serve-stale status`` has been clarified. It now
explicitly reports whether retention of stale data in the cache is
enabled (``stale-cache-enable``), and whether returning such data in
responses is enabled (``stale-answer-enable``). :gl:`#2742`
- The `UseSTD3ASCIIRules`_ flag is now set for libidn2 function calls.
This enables additional validation rules for IDN domains and hostnames
in ``dig``. :gl:`#1610`
.. _UseSTD3ASCIIRules: http://www.unicode.org/reports/tr46/#UseSTD3ASCIIRules
Bug Fixes
~~~~~~~~~
- Reloading a catalog zone which referenced a missing/deleted member
zone triggered a runtime check failure, causing ``named`` to exit
prematurely. This has been fixed. :gl:`#2308`
- Some lame delegations could trigger a dependency loop, in which a
resolver fetch waited for a name server address lookup which was
waiting for the same resolver fetch. This could cause a recursive
lookup to hang until timing out. This situation is now detected and
prevented. :gl:`#2927`
- Log files using ``timestamp``-style suffixes were not always correctly
removed when the number of files exceeded the limit set by
``versions``. This has been fixed. :gl:`#828`
+21 -43
View File
@@ -8,7 +8,7 @@
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
Notes for BIND 9.17.20
Notes for BIND 9.17.21
----------------------
Security Fixes
@@ -24,60 +24,38 @@ Known Issues
New Features
~~~~~~~~~~~~
- Implement incremental resizing of RBT hash tables to perform the rehashing
gradually instead all-at-once to be able to grow the memory usage gradually
while keeping steady response rate during the rehashing. :gl:`#2941`
- Add finer-grained ``update-policy`` rule types, ``krb5-subdomain-self-rhs``
and ``ms-subdomain-self-rhs``, that restrict updates to SRV and PTR records
so that their content can only match the machine name embedded in the
Kerberos principal making the change. :gl:`#481`
- Set Extended DNS Error Code 18 - Prohibited if query access is denied to the
specific client. :gl:`#1836`
Removed Features
~~~~~~~~~~~~~~~~
- Add support for OpenSSL 3.0.0. OpenSSL 3.0.0 deprecated 'engine' support.
If OpenSSL 3.0.0 has been built without support for deprecated functionality
pkcs11 via engine_pkcs11 is no longer available. At this point in time
there is no replacement ``provider`` for pkcs11 which is the replacement to
the ``engine API``. :gl:`#2843`
- None.
Feature Changes
~~~~~~~~~~~~~~~
- Because the old socket manager API has been removed, "socketmgr"
statistics are no longer reported by the statistics channel. :gl:`#2926`
- The ``allow-transfers`` option was extended to accept additional
``port`` and ``transport`` parameters, to further restrict zone
transfers to a particular port and DNS transport protocol. Either of
these options can be specified.
- `UseSTD3ASCIIRules`_ is now enabled for IDN support. This enables additional
validation rules for domains and hostnames within dig. :gl:`#1610`
For example: ``allow-transfer port 853 transport tls { any; };``
:gl:`#2776`
.. _UseSTD3ASCIIRules: http://www.unicode.org/reports/tr46/#UseSTD3ASCIIRules
- The default for ``dnssec-dnskey-kskonly`` is changed to ``yes``. This means
that DNSKEY, CDNSKEY, and CDS RRsets are now only signed with the KSK by
default. The additional signatures from the ZSK that are added if the option
is set to ``no`` add to the DNS response payload without offering added value.
:gl:`#1316`
- The output of ``rndc serve-stale status`` has been clarified. It now
explicitly reports whether retention of stale data in the cache is enabled
(``stale-cache-enable``), and whether returning of such data in responses is
enabled (``stale-answer-enable``). :gl:`#2742`
- The default for ``dnssec-policy``'s ``nsec3param`` is changed to use
no extra iterations and no salt. :gl:`#2956`.
- `UseSTD3ASCIIRules`_ is now disabled for IDN support. This disables additional
validation rules for domain names in dig because applying the rules would
silently strip characters not-allowed in hostnames such as underscore (``_``)
or wildcard (``*``) characters. This reverts change :gl:`!5738` from the
previous release. :gl:`#1610`
Bug Fixes
~~~~~~~~~
- Reloading a catalog zone that referenced a missing/deleted zone
caused a crash. This has been fixed. :gl:`#2308`
- Removing a configured ``catalog-zone`` clause from the configuration, running
``rndc reconfig``, then bringing back the removed ``catalog-zone`` clause and
running ``rndc reconfig`` again caused ``named`` to crash. This has been fixed.
:gl:`#1608`
- Logfiles using ``timestamp``-style suffixes were not always correctly
removed when the number of files exceeded the limit set by ``versions``.
:gl:`#828`
- Some lame delegations could trigger a dependency loop, in which a
resolver fetch was waiting for a name server address lookup which was
waiting for the same resolver fetch. This could cause a recursive lookup
to hang until timing out. This now detected and avoided. :gl:`#2927`
- The resolver could hang on shutdown due to dispatch resources not being
cleaned up when a TCP connection was reset. This has been fixed. :gl:`#3026`

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