Compare commits

...
Author SHA1 Message Date
Evan Hunt f187c948c4 WIP: non-blocking zone lookup
- add a DNS_DBFIND_NONBLOCK option, which causes dns_db_find/findext()
  to return ISC_R_LOCKBUSY if unable to acquire a read lock on the
  database.
- use the asynchronous hook mechanism to postpone query_lookup() if
  this occurs.
2021-06-03 22:59:57 -07:00
Mark Andrews 7fef01201d Merge branch '2751-serve-stale-tests-false-negative' into 'main'
Resolve "serve-stale tests false negative"

Closes #2751

See merge request isc-projects/bind9!5143
2021-06-03 08:40:38 +00:00
Mark Andrews af95cb8ccc Address test race condition in serve-stale
the dig.out.test# files could still be being written when the
content greps where being made.
2021-06-03 18:20:14 +10:00
Mark Andrews d242ccfbdf Merge branch '2750-provide-more-insight-into-why-the-timer_test-is-failing' into 'main'
Resolve "Provide more insight into why the timer_test is failing."

Closes #2750

See merge request isc-projects/bind9!5142
2021-06-03 07:31:26 +00:00
Mark Andrews 66d1df57cb Report which assertion failed when calling set_global_error 2021-06-03 11:55:31 +10:00
Mark Andrews 5bd7caba9c Merge branch '2724-statschannel-system-test-sometimes-hangs' into 'main'
Resolve "statschannel system test sometimes hangs"

Closes #2724

See merge request isc-projects/bind9!5123
2021-06-02 22:37:10 +00:00
Mark Andrews 02726cb66e Add timeout to url get requests
to prevent the system test taking forever on failures.
2021-06-02 22:18:21 +00:00
Ondřej Surý 0dded90ae4 Merge branch '2746-fix-the-typo-in-setsockopt_off' into 'main'
Fix copy&paste error in setsockopt_off

Closes #2746

See merge request isc-projects/bind9!5138
2021-06-02 16:09:48 +00:00
Ondřej Surý 22aa929aac Add CHANGES and release note for [GL #2746] 2021-06-02 17:47:14 +02:00
Ondřej Surý f14d870d15 Fix copy&paste error in setsockopt_off
Because of copy&paste error the setsockopt_off macro would enable
the socket option instead of disabling it.
2021-06-02 17:47:14 +02:00
Michał Kępień 5e1a48a605 Merge branch '2540-check-dname-resolution-via-itself' into 'main'
Check DNAME resolution via itself

Closes #2540

See merge request isc-projects/bind9!5135
2021-06-02 12:49:05 +00:00
Mark AndrewsandMichał Kępień cbdea694e8 Check DNAME resolution via itself 2021-06-02 14:20:35 +02:00
Michał Kępień 715dc196e2 Merge branch '2467-add-a-system-test-checking-a-malformed-ixfr' into 'main'
Add a system test checking a malformed IXFR

Closes #2467

See merge request isc-projects/bind9!5132
2021-06-02 11:35:55 +00:00
Mark AndrewsandMichał Kępień 5547003a3d Add a system test checking a malformed IXFR
Make sure an incoming IXFR containing an SOA record which is not placed
at the apex of the transferred zone does not result in a broken version
of the zone being served by named and/or a subsequent crash.
2021-06-02 13:15:25 +02:00
Ondřej Surý c70d9c4e9a Merge branch 'ondrej/fix-uv_udp_connect-detection' into 'main'
Cleanup the remaining of HAVE_UV_<func> macros

See merge request isc-projects/bind9!5127
2021-06-02 09:56:20 +00:00
Ondřej Surý 67afea6cfc Cleanup the remaining of HAVE_UV_<func> macros
While cleaning up the usage of HAVE_UV_<func> macros, we forgot to
cleanup the HAVE_UV_UDP_CONNECT in the actual code and
HAVE_UV_TRANSLATE_SYS_ERROR and this was causing Windows build to fail
on uv_udp_send() because the socket was already connected and we were
falsely assuming that it was not.

The platforms with autoconf support were not affected, because we were
still checking for the functions from the configure.
2021-06-02 11:23:36 +02:00
Ondřej Surý 479dc58877 Merge branch 'ondrej/add-libnghttp2-dev-to-lgtm.yml' into 'main'
Add libnghttp2-dev to .lgtm.yml

See merge request isc-projects/bind9!5125
2021-06-02 07:35:39 +00:00
Ondřej Surý d67e16ae3c Add libnghttp2-dev to .lgtm.yml
The LGTM.com configuration was missing required library, so the
"Extraction" step of the analysis was failing.
2021-06-02 09:33:27 +02:00
Artem Boldariev 2fc89e0353 Merge branch 'artem-http-write-buffering' into 'main'
HTTP/2 write buffering

See merge request isc-projects/bind9!5121
2021-06-01 18:28:34 +00:00
Artem Boldariev 35d0027f36 HTTP/2 write buffering
This commit adds the ability to consolidate HTTP/2 write requests if
there is already one in flight. If it is the case, the code will
consolidate multiple subsequent write request into a larger one
allowing to utilise the network in a more efficient way by creating
larger TCP packets as well as by reducing TLS records overhead (by
creating large TLS records instead of multiple small ones).

This optimisation is especially efficient for clients, creating many
concurrent HTTP/2 streams over a transport connection at once.  This
way, the code might create a small amount of multi-kilobyte requests
instead of many 50-120 byte ones.

In fact, it turned out to work so well that I had to add a work-around
to the code to ensure compatibility with the flamethrower, which, at
the time of writing, does not support TLS records larger than two
kilobytes. Now the code tries to flush the write buffer after 1.5
kilobyte, which is still pretty adequate for our use case.

Essentially, this commit implements a recommendation given by nghttp2
library:

https://nghttp2.org/documentation/nghttp2_session_mem_send.html
2021-06-01 21:07:45 +03:00
Ondřej Surý 5a8a21a88d Merge branch '2732-zone-dumping-is-blocking-the-networking-io' into 'main'
Improve the zone dumping impact on the networking

Closes #2732

See merge request isc-projects/bind9!5107
2021-05-31 13:51:48 +00:00
Ondřej Surý 3e433b87fb Add CHANGES and release note for [GL #2732] 2021-05-31 14:52:05 +02:00
Ondřej Surý e83b6569da Indicate to the kernel that we won't be needing the zone dumps
Add a call to posix_fadvise() to indicate to the kernel, that `named`
won't be needing the dumped zone files any time soon with:

 * POSIX_FADV_DONTNEED - The specified data will not be accessed in the
   near future.

Notes:

 POSIX_FADV_DONTNEED attempts to free cached pages associated with the
 specified region. This is useful, for example, while streaming large
 files. A program may periodically request the kernel to free cached
 data that has already been used, so that more useful cached pages are
 not discarded instead.
2021-05-31 14:52:05 +02:00
Ondřej SurýandOndřej Surý 8a5c62de83 Refactor zone dumping code to use netmgr async threadpools
Previously, dumping the zones to the files were quantized, so it doesn't
slow down network IO processing.  With the introduction of network
manager asynchronous threadpools, we can move the IO intensive work to
use that API and we don't have to quantize the work anymore as it the
file IO won't block anything except other zone dumping processes.
2021-05-31 14:52:05 +02:00
Ondřej SurýandOndřej Surý 7670f98377 Add isc_task_getnetmgr() function
Add a function to pull the attached netmgr from inside the executed
task.  This is needed for any task that needs to call the netmgr API.
2021-05-31 14:52:05 +02:00
Ondřej SurýandOndřej Surý 87fe97ed91 Add asynchronous work API to the network manager
The libuv has a support for running long running tasks in the dedicated
threadpools, so it doesn't affect networking IO.

This commit adds isc_nm_work_enqueue() wrapper that would wraps around
the libuv API and runs it on top of associated worker loop.

The only limitation is that the function must be called from inside
network manager thread, so the call to the function should be wrapped
inside a (bound) task.
2021-05-31 14:52:05 +02:00
Ondřej Surý 211bfefbaa Use UV_VERSION_HEX to decide whether we need libuv shim functions
Instead of having a configure check for every missing function that has
been added in later version of libuv, we now use UV_VERSION_HEX to
decide whether we need the shim or not.
2021-05-31 14:52:05 +02:00
Ondřej Surý 7477d1b2ed Add uv_os_getenv() and uv_os_setenv() compatibility shims
The uv_os_getenv() and uv_os_setenv() functions were introduced in the
libuv >= 1.12.0.  Add simple compatibility shims for older versions.
2021-05-31 14:52:05 +02:00
Ondřej Surý f752840db3 Add uv_req_get_data() and uv_req_set_data() compatibility shims
The uv_req_get_data() and uv_req_set_data() functions were introduced in
libuv >= 1.19.0, so we need to add compatibility shims with older libuv
versions.
2021-05-31 14:52:05 +02:00
Ondřej Surý 7b02848865 Cleanup the uv_import check
The uv_import() is not needed anymore, so we can remove the autoconf
check for it.
2021-05-31 14:52:05 +02:00
Michał Kępień db8ff45f0b Merge branch 'michal/regenerate-man-pages-with-docutils-0.16' into 'main'
Regenerate man pages with docutils 0.16

See merge request isc-projects/bind9!5119
2021-05-31 12:34:45 +00:00
Michał Kępień 6a2daddf5b Regenerate man pages with docutils 0.16
Commit bdb777b2a2 updated the man pages
to contents produced using:

  - Sphinx 4.0.2
  - sphinx-rtd-theme 0.5.2
  - docutils 0.17.1

However, sphinx-rtd-theme 0.5.2 is incompatible with versions 0.17+ of
the docutils package.  This problem was addressed in the Docker image
used for building man pages by downgrading the docutils package to
version 0.16.

Regenerate the man pages again, this time using:

  - Sphinx 4.0.2
  - sphinx-rtd-theme 0.5.2
  - docutils 0.16

This is necessary to prevent the "docs" GitLab CI job from failing.
2021-05-31 11:22:52 +02:00
Evan Hunt 6702f23dcd Merge branch 'kchen-servestale-fix' into 'main'
Several serve-stale fixes

See merge request isc-projects/bind9!199
2021-05-30 19:28:59 +00:00
Matthijs MekkingandEvan Hunt f7f543d99b Reuse rdatset->ttl when dumping ancient RRsets
Rather than having an expensive 'expired' (fka 'stale_ttl') in the
rdataset structure, that is only used to be printed in a comment on
ancient RRsets, reuse the TTL field of the RRset.
2021-05-30 11:48:36 -07:00
Kevin ChenandEvan Hunt 0cdf85d204 Several serve-stale improvements
Commit a83c8cb0af updated masterdump so
that stale records in "rndc dumpdb" output no longer shows 0 TTLs.  In
this commit we change the name of the `rdataset->stale_ttl` field to
`rdataset->expired` to make its purpose clearer, and set it to zero in
cases where it's unused.

Add 'rbtdb->serve_stale_ttl' to various checks so that stale records
are not purged from the cache when they've been stale for RBTDB_VIRTUAL
(300) seconds.

Increment 'ns_statscounter_usedstale' when a stale answer is used.

Note: There was a question of whether 'overmem_purge' should be
purging ancient records, instead of stale ones.  It is left as purging
stale records, since stale records could take up the majority of the
cache.

This submission is copyrighted Akamai Technologies, Inc. and provided
under an MPL 2.0 license.

This commit was originally authored by Kevin Chen, and was updated by
Matthijs Mekking to match recent serve-stale developments.
2021-05-30 11:45:35 -07:00
Evan Hunt fc1e3efc41 Merge branch '2733-serve-stale-prefetch-crash' into 'main'
Fix crash with serve-stale in combination with prefetch

Closes #2733

See merge request isc-projects/bind9!5111
2021-05-30 07:31:38 +00:00
Matthijs MekkingandEvan Hunt 7ca253818e Add CHANGES and notes for [#2733] 2021-05-30 00:04:01 -07:00
Evan Hunt 8c047feb3a add a system test for the prefetch bug
Ensure that if prefetch is triggered as a result of a query
restart, it won't have the TRYSTALE_ONTIMEOUT flag set.
2021-05-30 00:04:01 -07:00
Matthijs MekkingandEvan Hunt c0dc5937c7 Reset DNS_FETCHOPT_TRYSTALE_ONTIMEOUT on resume
Once we resume a query, we should clear DNS_FETCHOPT_TRYSTALE_ONTIMEOUT
from the options to prevent triggering the stale-answer-client-timeout
on subsequent fetches.

If we don't this may cause a crash when for example when prefetch is
triggered after a query restart.
2021-05-30 00:03:51 -07:00
Michal Nowak 9fbe80d646 Merge branch 'mnowak/add-fedora-34' into 'main'
Add Fedora 34

See merge request isc-projects/bind9!5075
2021-05-28 10:50:51 +00:00
Michal Nowak 5f27aaa0ff Add Fedora 34 2021-05-28 11:57:31 +02:00
Evan Hunt 5ca27cc33d Merge branch '2731-servestale-dns64' into 'main'
fix a crash when using stale data with dns64

Closes #2731

See merge request isc-projects/bind9!5102
2021-05-27 18:52:31 +00:00
Evan Hunt d8b793760c CHANGES, release note 2021-05-27 10:37:16 -07:00
Matthijs MekkingandEvan Hunt c64589bf46 Test with stale timeout cache miss, then fetch completes
Add a test case where a client request is received and the stale
timeout occurs, but it is not served stale data because there is no entry
in the cache, then is served an authoritative answer once the background
fetch completes. This ensures that a stale timeout only affects a
subsequent response if the client was answered.
2021-05-27 10:35:48 -07:00
Evan Hunt 8bd8e995f1 clean up query correctly if already answered by serve-stale
when a serve-stale answer has been sent, the client continues waiting
for a proper answer. if a final completion event for the client does
arrive, it can just be cleaned up without sending a response, similar
to a canceled fetch.
2021-05-27 10:35:48 -07:00
Evan Hunt 453e905d7e add a test of DNS64 processing with a stale negative response
- send a query for an AAAA which will be resolved as a mapped A
- disable authoritative responses
- wait for the negative AAAA response to become stale
- send another query, wait for the stale answer
- re-enable authorative responses so that a real answer arrives
- currently, this triggers an assertion in query.c
2021-05-27 10:33:31 -07:00
Ondřej Surý e7f5c9582a Merge branch '2708-named-doesn-t-compile-with-gcc-10' into 'main'
Resolve "named doesn't compile with GCC 10."

Closes #2708

See merge request isc-projects/bind9!5057
2021-05-27 06:22:14 +00:00
Mark AndrewsandOndřej Surý d68b009cfe Remove priority from attribute constructor/destructor
On some platforms, the __attribute__ constructor and destructor won't
take priorities and the compilation failed.  On such platform would be
macOS.  For this reason, the constructor/destructor in the libisc was
reworked to not use priorities, but have a single constructor and
destructor that calls the appropriate routines in correct order.

This commit removes the extra priority because it's now not needed and
it also breaks a compilation on macOS with GCC 10.
2021-05-27 08:02:21 +02:00
Mark Andrews 728422d939 Merge branch '2282-shutdown-system-test-needs-to-be-tweaked-to-account-for-recent-netmgr-changes' into 'main'
Resolve ""shutdown" system test needs to be tweaked to account for recent netmgr changes"

Closes #2282

See merge request isc-projects/bind9!4923
2021-05-27 02:56:57 +00:00
Diego FronzaandMark Andrews b19cd2d83b Handling NoNameservers exception
In the shutdown system test multiple queries are sent to a resolver
instance, in the meantime we terminate the same resolver process for
which the queries were sent to, either via rndc stop or a SIGTERM
signal, that means the resolver may not be able to answer all those
queries, since it has initiated the shutdown process.

The dnspython library raises a dns.resolver.NoNameservers exception when
a resolver object fails to receive an answer from the specified list
of nameservers (resolver.nameservers list), we need to handle this
exception as this is something that may happen since we asked the
resolver to terminate, as a result it may not answer clients even if
an answer is available, as the operation will be canceled.
2021-05-27 12:37:49 +10:00
Ondřej Surý 91cd1ef9ff Merge branch 'ondrej/revert-OpenBSD-system-wide-connection-timeout' into 'main'
Revert "Configure the system-wide TCP connection timeout on OpenBSD"

See merge request isc-projects/bind9!5100
2021-05-26 14:24:58 +00:00
Ondřej Surý a0f6275ef8 Revert "Configure the system-wide TCP connection timeout on OpenBSD"
This reverts commit 8ff15fc028.
2021-05-26 16:16:00 +02:00
Mark Andrews d3a8aa4daa Merge branch 'marka-missing-initialisations' into 'main'
Add missing initialisations

See merge request isc-projects/bind9!5097
2021-05-26 08:52:46 +00:00
Mark Andrews 715a2c7fc1 Add missing initialisations
configuring with --enable-mutex-atomics flagged these incorrectly
initialised variables on systems where pthread_mutex_init doesn't
just zero out the structure.
2021-05-26 08:15:08 +00:00
Ondřej Surý 5a10cde89a Merge branch '2722-bad-sizeof-declaration-in-main' into 'main'
Fix the sizeof() for array holding the pointers to clientmgr

Closes #2722

See merge request isc-projects/bind9!5098
2021-05-26 08:10:45 +00:00
Ondřej Surý 2db5290579 Fix the sizeof() for array holding the pointers to clientmgr
The size of the array holding the pointers to clientmgr was created so
big it could hold the actual clientmgr objects, not just the pointer.
This commit fixes the size to be just the ncpus * sizeof(pointer).
2021-05-26 10:03:52 +02:00
Ondřej Surý da282bad6a Merge branch '2721-shutdown-race-in-interfacemgr-cleanup' into 'main'
Cleanup the struct isc_nmiface

Closes #2721

See merge request isc-projects/bind9!5096
2021-05-26 08:00:25 +00:00
Ondřej Surý a227562f13 Cleanup the struct isc_nmiface
In previous MR, I forgot to remove the `struct isc_nmiface`, this commit
rectifies that.
2021-05-26 09:55:10 +02:00
Ondřej Surý 5d325e952d Merge branch '2721-shutdown-race-in-interfacemgr' into 'main'
Make a local copy of interface address when creating new socket

Closes #2721

See merge request isc-projects/bind9!5094
2021-05-26 07:48:00 +00:00
Ondřej Surý 50270de8a0 Refactor the interface handling in the netmgr
The isc_nmiface_t type was holding just a single isc_sockaddr_t,
so we got rid of the datatype and use plain isc_sockaddr_t in place
where isc_nmiface_t was used before.  This means less type-casting and
shorter path to access isc_sockaddr_t members.

At the same time, instead of keeping the reference to the isc_sockaddr_t
that was passed to us when we start listening, we will keep a local
copy. This prevents the data race on destruction of the ns_interface_t
objects where pending nmsockets could reference the sockaddr of already
destroyed ns_interface_t object.
2021-05-26 09:43:12 +02:00
Mark Andrews bef3a9b01f Merge branch '2685-max-ixfr-ratio-appears-to-be-forcing-axfr-very-prematurely-on-bind-9-16-15' into 'main'
Resolve "max-ixfr-ratio appears to be forcing AXFR very prematurely on BIND 9.16.15"

Closes #2685

See merge request isc-projects/bind9!5011
2021-05-25 22:46:52 +00:00
Mark Andrews 80ca95a95c Add release note for [GL #2685] 2021-05-26 08:16:35 +10:00
Mark Andrews d99c312938 Add CHANGES note for [GL #2685] 2021-05-26 08:16:35 +10:00
Mark Andrews 0a45af2e2f Consolidate xhdr fixups 2021-05-26 08:16:35 +10:00
Mark Andrews 68d203ff1c Check that IXFR delta size is correct 2021-05-25 22:27:54 +10:00
Mark Andrews 00609f5094 Correct size calculation in dns_journal_iter_init()
* dns_journal_next() leaves the read point in the journal after the
transaction header so journal_seek() should be inside the loop.
* we need to recover from transaction header inconsistencies

Additionally when correcting for <size, serial0, serial1, 0> the
correct consistency check is isc_serial_gt() rather than
isc_serial_ge().  All instances updated.
2021-05-25 22:27:54 +10:00
Michal Nowak b6bdeb06be Merge branch '2629-man-pages-aren-t-installed-when-building-9-17-x' into 'main'
Install man pages when sphinx-build tool is missing

Closes #2629

See merge request isc-projects/bind9!4945
2021-05-25 09:34:11 +00:00
Michal Nowak 823bf3e79b Install BIND with "make DESTDIR=<PATH> install"
BIND installation should be done by setting DESTDIR during "make
install" not by setting prefix via ./configure.

Make sure that installation with DESTDIR=<PATH> works by checking that
named binary and it's respective man page were installed and that
well-known BIND9 directories - and only them - are present in DESTDIR.

Also rename install path variable from BIND_INSTALL_PATH to
INSTALL_PATH to avoid namespace clash in stress tests which use
BIND_INSTALL_PATH variable to configure path to BIND9 binaries.
2021-05-25 11:21:33 +02:00
Michal Nowak c0566dd8d7 Install man pages when sphinx-build tool is missing
The exclusion of doc/man/ when the sphinx-build tool is missing was
excessive as some targets in doc/man/ are necessary to install man
pages.
2021-05-25 11:21:32 +02:00
Ondřej Surý 9359e1a8c0 Merge branch 'ondrej/dont-set-mctx-name-in-resolver' into 'main'
Don't set memory context name in resolver.c

See merge request isc-projects/bind9!5090
2021-05-25 05:27:59 +00:00
Ondřej Surý d0d37aa6d1 Don't set memory context name in resolver.c
We now attach to existing memory context instead of creating a new
memory context, so we should not set its name.
2021-05-25 07:25:44 +02:00
Ondřej Surý a778db3b7d Merge branch 'ondrej/replace-ubuntu-xenial-with-ubuntu-bionic' into 'main'
Replace Ubuntu 16.04 LTS with Ubuntu 18.04 LTS in the GitLab CI

See merge request isc-projects/bind9!4800
2021-05-24 19:43:15 +00:00
Ondřej SurýandOndřej Surý 4402a90bb7 Replace Ubuntu 16.04 LTS with Ubuntu 18.04 LTS in the GitLab CI
Ubuntu 16.04 (Xenial Xerus) is reaching End of Standard Support in April
2021 thus we are removing it from the list of supported platforms and
replacing it with Ubuntu 18.04 LTS (Bionic Beaver).
2021-05-24 21:34:09 +02:00
Ondřej Surý 664d8c1d24 Merge branch '2433-reduce-clientmgr-memory-contexts-and-tasks' into 'main'
Reduce the number of clientmgr objects created

Closes #2433

See merge request isc-projects/bind9!5085
2021-05-24 19:20:15 +00:00
Ondřej Surý a7241bb5b3 Add CHANGES and release note for GL #2433 2021-05-24 20:45:19 +02:00
Ondřej Surý a1c6fd5ede Adjust the fillcount and freemax for dns_message mempools
According to the measurements (recorded on GL!5085), the fillcount of 2
for namepool and fillcount of 4 for rdspool can fit 99.99% of request
for tested scenarios.

This was discovered by perf recording the single second recursive test
using flamethrower where the initial malloc lit up like a flare.
2021-05-24 20:44:58 +02:00
Ondřej Surý 28b65d8256 Reduce the number of clientmgr objects created
Previously, as a way of reducing the contention between threads a
clientmgr object would be created for each interface/IP address.

We tasks being more strictly bound to netmgr workers, this is no longer
needed and we can just create clientmgr object per worker queue (ncpus).

Each clientmgr object than would have a single task and single memory
context.
2021-05-24 20:44:54 +02:00
Ondřej Surý aad7856b8e Don't create per bucket memory contexts in resolver
Similarly, the resolver code would create hundreds of memory contexts
just on the resolver setup.  The contention will be reduced directly in
the allocator, so for now just attach to the view memory instead of
creating separate memory context for each bucket.
2021-05-24 20:02:20 +02:00
Ondřej Surý 4db5e30177 Run shutdown events with the task's existing threadid
Previously, task->threadid was reassigned to 0 while shutting
down, which caused an assertion.
2021-05-24 20:02:20 +02:00
Ondřej Surý 0be7ea78be Reduce the number of client tasks and bind them to netmgr queues
Since a client object is bound to a netmgr handle, each client
will always be processed by the same netmgr worker, so we can
simplify the code by binding client->task to the same thread as
the client. Since ns__client_request() now runs in the same event
loop as client->task events, is no longer necessary to pause the
task manager before launching them.

Also removed some functions in isc_task that were not used.
2021-05-24 20:02:20 +02:00
Ondřej Surý c07f8c5a43 Reduce the number of tasks in the clientmgr
We now use one task per CPU per dispatchmgr (that's still a lot).
2021-05-24 20:02:20 +02:00
Ondřej Surý 0719f032e1 Reduce the number of mctx created in clientmgr
The number of memory contexts created in the clientmgr was enormous.  It
could easily create thousands of memory contexts because the formula was:

    nprotocols * ncpus * ninterfaces * CLIENT_NMCTXS_PERCPU (8)

The original goal was to reduce the contention when allocating the
memory, but after a while nobody noticed that the amount of memory
context allocated would not reduce contention at all.

This commit removes the whole mctxpool and just uses the mctx from
clientmgr as the contention will be reduced directly in the allocator.
2021-05-24 20:02:20 +02:00
Michal Nowak 9f5a7a2ca4 Merge branch 'mnowak/freebsd-13' into 'main'
Add FreeBSD 13.0

See merge request isc-projects/bind9!4814
2021-05-24 16:15:35 +00:00
Michal Nowak 83617cea9a Run gcc:tarball CI job for merge requests
Running gcc:tarball CI job for merge requests is consistent with how we
run gcc:out-of-tree CI job and should help identify problems with the
build system during the review process, not once merged during daily
runs. For the sake of time, unit and system tests associated with the
gcc:tarball CI job are excluded from merge requests.
2021-05-24 17:57:53 +02:00
Michal Nowak 70eccd2952 Do not spawn FreeBSD 11 CI jobs in merge requests 2021-05-24 17:57:53 +02:00
Michal Nowak e4f88c359c Create an anchor for schedules, tags, and web rules
It's a common pattern to spawn CI jobs only for pipelines triggered by
schedules, tags, and web. There should be an anchor so that the rules
are not repeated.
2021-05-24 17:57:53 +02:00
Michal Nowak 0714fe6f40 Add FreeBSD 13.0 2021-05-24 17:54:05 +02:00
Ondřej Surý fd0f3c0af4 Merge branch '2643-fix-rndc-timeout' into 'main'
extend rndc timeout to 60 seconds

Closes #2643

See merge request isc-projects/bind9!5082
2021-05-22 09:46:27 +00:00
Evan Hunt 3ed35b3035 extend rndc timeout to 60 seconds
the idle timeout for rndc connections was set to 10 seconds, but this
caused intermittent system failures of the 'rndc' system test on slow
platforms, since 'rndc reconfig' could time out before reconfiguration
was complete.

this commit restores the original timeout value of 60 seconds, which was
changed inadvertently after rndc was updated to use the network manager.

even with this change, however, the test can still time out under
TSAN because loading the huge zone can take a very long time (upwards
of two minutes). so the test is modified here to generate a smaller zone
file when running under TSAN.
2021-05-22 01:11:31 -07:00
Evan Hunt c819762dde Merge branch 'each-rename-copynf' into 'main'
rename dns_name_copynf() to dns_name_copy()

See merge request isc-projects/bind9!5081
2021-05-22 08:10:10 +00:00
Evan Hunt d06b1ed11f CHANGES 2021-05-22 00:37:27 -07:00
Evan Hunt 1fa6f8662e update dev.md with name copying information
revise the Developer Information document with updated information
about copying names.
2021-05-22 00:37:27 -07:00
Evan Hunt f3f1cab05e clean up coccinelle patches for dns_name_copy()
no need for semantic patches to use dns_name_copynf() any longer.
2021-05-22 00:37:27 -07:00
Evan Hunt b0aadaac8e rename dns_name_copynf() to dns_name_copy()
dns_name_copy() is now the standard name-copying function.
2021-05-22 00:37:27 -07:00
Evan Hunt ea7b28f101 remove dns_name_copy() implementation
Remove dns_name_copy() and refactor the underlying code since
it will only be called by dns_name_copynf() now, and can't fail.
2021-05-22 00:22:32 -07:00
Evan Hunt b1fe1b8ae3 remove the remaining uses of dns_name_copy()
dns_name_copy() has been replaced nearly everywhere with
dns_name_copynf().  this commit changes the last two uses of
the original function.  afterward, we can remove the old
dns_name_copy() implementation, and replace it with _copynf().
2021-05-22 00:22:32 -07:00
Evan Hunt 6803f394c5 Merge branch '2713-intermittent-crashes-in-the-tkey-system-test-caused-by-broken-dns_name_t-structures' into 'main'
Use dns_name_copy() to hold the copied name

Closes #2713

See merge request isc-projects/bind9!5079
2021-05-22 04:30:19 +00:00
Ondřej SurýandEvan Hunt ce3e1abc1d Use dns_name_copynf() with dns_message_gettempname() when needed
dns_message_gettempname() returns an initialized name with a dedicated
buffer, associated with a dns_fixedname object.  Using dns_name_copynf()
to write a name into this object will actually copy the name data
from a source name. dns_name_clone() merely points target->ndata to
source->ndata, so it is faster, but it can lead to a use-after-free if
the source is freed before the target object is released via
dns_message_puttempname().

In a few places, clone was being used where copynf should have been;
this is now fixed.

As a side note, no memory was lost, because the ndata buffer used in
the dns_fixedname_t is internal to the structure, and is freed when
the dns_fixedname_t is freed regardless of the .ndata contents.
2021-05-21 21:28:10 -07:00
Brian Conry 10ced46739 Merge branch '2662-fix-broken-SYSTEMTEST_NO_CLEAN' into 'main'
Preserve SYSTEMTEST_NO_CLEAN when run.sh calls make.

Closes #2662

See merge request isc-projects/bind9!5003
2021-05-21 13:38:25 +00:00
Brian Conry 44cadaf31b Preserve additional environment variables with run.sh
When executed in "legacy mode" (i.e. without the '-r' parameter)
run.sh invokes make with a modified environment.

SYSTEMTEST_FORCE_COLOR is now preserved for use by the individual test
scripts.

CYGWIN is now preserved for named, as it controls behavior relating to
crash reporting.
2021-05-21 13:07:28 +00:00
Brian Conry 516de44c9f Preserve SYSTEMTEST_NO_CLEAN when run.sh calls make
This restores legacy behavior in bin/tests/system where running:
  SYSTEMTEST_NO_CLEAN=1 ./run.sh <testname>
would run the test and preserve the output files.

This has been broken since the change that has run.sh invoke "make",
due to SYSTEMTEST_NO_CLEAN not being preserved in the environment
that's set up for "make".

Another option would be to completely remove SYSTEMTEST_NO_CLEAN.

This seems to be the only behavior-changing environment variable
not accounted for in the call to "make".

I don't think this needs a CHANGES entry.
2021-05-21 13:07:28 +00:00
Michał Kępień 97a821399b Merge branch 'michal/regenerate-man-pages-with-sphinx-4.0.2' into 'main'
Regenerate man pages with Sphinx 4.0.2

See merge request isc-projects/bind9!5077
2021-05-21 09:26:16 +00:00
Michał Kępień 9ec83d1f63 Explicitly set "man_make_section_directory"
The default value of the "man_make_section_directory" Sphinx option was
changed in Sphinx 4.0.1, which broke building man pages in maintainer
mode as the shell code in doc/man/Makefile.am expects man pages to be
built in doc/man/_build/man/, not doc/man/_build/man/<section_number>/.
The aforementioned change in defaults was reverted in Sphinx 4.0.2, but
this issue should still be prevented from reoccurring in the future.
Ensure that by explicitly setting the "man_make_section_directory"
option to False.
2021-05-21 10:29:02 +02:00
Michał Kępień bdb777b2a2 Regenerate man pages with Sphinx 4.0.2
The man pages produced by Sphinx 4.0.2 are slightly different than those
produced by Sphinx 3.5.4.  As Sphinx 4.0.2 is now used in GitLab CI,
update all doc/man/*in files so that they reflect what that version of
Sphinx produces, in order to prevent GitLab CI job failures.
2021-05-21 10:29:02 +02:00
Ondřej Surý 596a3442a3 Merge branch '2515-improve-glue-cache-performance' into 'main'
use a fixedname buffer in dns_message_gettempname()

Closes #2515

See merge request isc-projects/bind9!5071
2021-05-20 19:04:35 +00:00
Ondřej Surý 5ee9edc4ce Optimize rdataset_getownercase not to use bitshifts
The last rdataset_getownercase() left it in a state where the code was
mix of microoptimizations (manual loop unrolling, complicated bitshifts)
with a code that would always rewrite the character even if it stayed
the same after transformation.

This commit makes sure that we modify only the characters that actually
need to change, removes the manual loop unrolling, and replaces the
weird bit arithmetics with a simple shift and bit-and.
2021-05-20 20:41:29 +02:00
Evan HuntandOndřej Surý e31cc1eeb4 use a fixedname buffer in dns_message_gettempname()
dns_message_gettempname() now returns a pointer to an initialized
name associated with a dns_fixedname_t object. it is no longer
necessary to allocate a buffer for temporary names associated with
the message object.
2021-05-20 20:41:29 +02:00
Michał Kępień 869e0feec7 Merge branch 'v9_17_13-release' into 'main'
Merge 9.17.13 release branch

See merge request isc-projects/bind9!5068
2021-05-20 10:10:37 +00:00
Michał Kępień 5a71af44b1 Set up release notes for BIND 9.17.14 2021-05-20 12:03:47 +02:00
Michał Kępień f73d41d0a0 Update BIND version to 9.17.13 2021-05-20 12:03:47 +02:00
Michał Kępień 39b739b867 Add a CHANGES marker 2021-05-20 12:03:47 +02:00
Michał Kępień c14a91f06e Merge branch 'michal/prepare-documentation-for-bind-9.17.13' into 'v9_17_13-release'
Prepare documentation for BIND 9.17.13

See merge request isc-private/bind9!293
2021-05-20 12:03:47 +02:00
Michał Kępień 8113dbe5bb Prepare release notes for BIND 9.17.13 2021-05-20 12:03:47 +02:00
Michał Kępień e49bd0906e Add release note for GL #2626 2021-05-20 12:03:47 +02:00
Michał Kępień 620cccc3fc Reorder release notes 2021-05-20 12:03:47 +02:00
Michał Kępień ced6c9b23a Tweak and reword release notes 2021-05-20 12:03:47 +02:00
Michał Kępień 43cbc773a7 Tweak and reword recent CHANGES entries 2021-05-20 12:03:47 +02:00
Michal NowakandMichał Kępień ab6060c538 Drop duplicate release note for GL #2347 2021-05-20 12:03:47 +02:00
Michal NowakandMichał Kępień 15a345626a Fix typo in doc/dnssec-guide/recipes.rst 2021-05-20 12:03:47 +02:00
Matthijs Mekking 3ecd951da8 Merge branch '1875-kasp-views-keyfile-race' into 'main'
Lock key files when looking for zone keys

Closes #1875

See merge request isc-projects/bind9!4919
2021-05-20 07:55:26 +00:00
Matthijs Mekking fa1cd0a1f1 Release notes and changes for [#1875] 2021-05-20 09:23:46 +02:00
Matthijs Mekking 252a1ae0a1 Lock kasp when looking for zone keys
We should also lock kasp when reading key files, because at the same
time the zone in another view may be updating the key file.
2021-05-20 09:15:43 +02:00
Michal Nowak 8de2d8137c Merge branch 'mnowak/openbsd-6.9' into 'main'
Add OpenBSD 6.9

See merge request isc-projects/bind9!5031
2021-05-19 17:10:53 +00:00
Michal Nowak 315b8522ba Add OpenBSD 6.9 2021-05-19 17:21:23 +02:00
Michal Nowak 38bc6c8aa3 Merge branch '2694-drop-seq-command-from-views-tests-sh' into 'main'
Replace seq command with POSIX-compliant shell code

Closes #2694

See merge request isc-projects/bind9!5061
2021-05-19 13:55:53 +00:00
Michal Nowak a4b7eb7188 Make views system test ShellCheck-clean
Also, add "set -e" to all shell scripts of the views test to exit when
any command fails or is unknown, e.g., this on OpenBSD:

    tests.sh[174]: seq: not found
2021-05-19 14:04:48 +02:00
Michal Nowak a08487ec3d Replace seq command with POSIX-compliant shell code
The seq command is not defined in the POSIX standard and is missing on
OpenBSD. Given that the system test code is meant to be POSIX-compliant
replace it with a shell construct.
2021-05-19 14:04:48 +02:00
Michał Kępień 7d6bcef66e Merge branch '2709-placeholder' into 'main'
Add placeholder for GL #2709

See merge request isc-projects/bind9!5060
2021-05-19 12:00:02 +00:00
Michał Kępień 6962335678 Add placeholder for GL #2709 2021-05-19 13:57:21 +02:00
Artem Boldariev 1a298b28e2 Merge branch 'artem/doh-quota-tests' into 'main'
Add DoH quota tests

See merge request isc-projects/bind9!5024
2021-05-19 08:30:17 +00:00
Artem Boldariev 67c50abe5a Add DoH quota tests
This commit adds unit tests which ensure that DoH code is compatible
with quota functionality.
2021-05-19 10:28:47 +03:00
Mark Andrews c2c2b0da9a Merge branch '2688-cid331478-forwardnull' into 'main'
Fix possible null dereference (coverity issue 331478)

Closes #2688

See merge request isc-projects/bind9!5034
2021-05-19 01:55:53 +00:00
Matthijs MekkingandMark Andrews 19395fd168 Fix coverity issue 331478
Move the "cannot start rollover" warning into code block that checks
if 'active_key' is not NULL.
2021-05-19 00:45:54 +00:00
Mark Andrews 954eb15052 Merge branch '2550-remove-dns_zone_setflag' into 'main'
Resolve "Remove dns_zone_setflag"

Closes #2550

See merge request isc-projects/bind9!4762
2021-05-18 23:54:35 +00:00
Mark AndrewsandEvan Hunt 314b5362a8 Remove dns_zone_setflag()
This function has never been used since it was added to the source tree
by commit 686b27bfd3 back in 1999.  As
the dns_zoneflg_t type is only defined in lib/dns/zone.c, no function
external to that file would be able to use dns_zone_setflag() properly
anyway - the DNS_ZONE_SETFLAG() and DNS_ZONE_CLRFLAG() macros should be
used instead. Zone options that can be set from outside zone.c are set
using dns_zone_setoption().
2021-05-18 16:02:18 -07:00
Matthijs Mekking b6f806e023 Merge branch '2463-kasp-views-different-policy-same-keydirectory' into 'main'
Check key-directory duplicates for kasp zones

Closes #2463

See merge request isc-projects/bind9!4989
2021-05-18 14:40:26 +00:00
Matthijs Mekking a9f4b074c4 Release notes and changes for [GL #2463]
Mention the bugfix.
2021-05-18 15:47:02 +02:00
Matthijs Mekking df1aecd5ff Add checkconf tests for [#2463]
Add two tests to make sure named-checkconf catches key-directory issues
where a zone in multiple views uses the same directory but has
different dnssec-policies. One test sets the key-directory specifically,
the other inherits the default key-directory (NULL, aka the working
directory).

Also update the good.conf test to allow zones in different views
with the same key-directory if they use the same dnssec-policy.

Also allow zones in different views with different key-directories if
they use different dnssec-policies.

Also allow zones in different views with the same key-directories if
only one view uses a dnssec-policy (the other is set to "none").

Also allow zones in different views with the same key-directories if
no views uses a dnssec-policy (zone in both views has the dnssec-policy
set to "none").
2021-05-18 15:47:02 +02:00
Matthijs Mekking 494e8b2cbd Check key-directory duplicates for kasp zones
Don't allow the same zone with different dnssec-policies in separate
views have the same key-directory.

Track zones plus key-directory in a symtab and if there is a match,
check the offending zone's dnssec-policy name. If the name is "none"
(there is no kasp for the offending zone), or if the name is the same
(the zone shares keys), it is fine, otherwise it is an error (zones
in views using different policies cannot share the same key-directory).
2021-05-18 15:47:02 +02:00
Mark Andrews 8a90139c2c Merge branch '2696-misleading-diagnostic-in-update_soa_serial-indicates-bind-will-use-increment-but-it-doesn-t' into 'main'
Resolve "Misleading diagnostic in update_soa_serial indicates BIND will use increment but it doesn't"

Closes #2696

See merge request isc-projects/bind9!5029
2021-05-18 12:51:00 +00:00
Mark Andrews 5d21042ed8 Adjust returned method from dns_updatemethod_date
if dns_updatemethod_date is used do that the returned method is only
set to dns_updatemethod_increment if the new serial does not encode
the current day (YYYYMMDDXX).
2021-05-18 12:30:22 +00:00
Michał Kępień 3dc094c8e0 Merge branch 'michal/use-context-managers-as-suggested-by-pylint-2.8.2' into 'main'
Use context managers as suggested by PyLint 2.8.2

See merge request isc-projects/bind9!5041
2021-05-18 08:56:50 +00:00
Michał Kępień a8163551ed Use context managers as suggested by PyLint 2.8.2
PyLint 2.8.2 reports the following suggestions for two Python scripts
used in the system test suite:

    ************* Module tests_rndc_deadlock
    bin/tests/system/addzone/tests_rndc_deadlock.py:71:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
    ************* Module tests-shutdown
    bin/tests/system/shutdown/tests-shutdown.py:68:4: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
    bin/tests/system/shutdown/tests-shutdown.py:154:8: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)

Implement the above suggestions by using
concurrent.futures.ThreadPoolExecutor() and subprocess.Popen() as
context managers.
2021-05-18 10:53:17 +02:00
Mark Andrews 71284cb496 Merge branch '2706-worker-cond_prio-needs-to-be-initialised' into 'main'
Resolve "worker->cond_prio needs to be initialised"

Closes #2706

See merge request isc-projects/bind9!5048
2021-05-18 08:39:28 +00:00
Mark Andrews 7e83c6df94 initialise worker->cond_prio 2021-05-18 07:47:42 +00:00
Mark Andrews cdb8c9bd35 Merge branch '2701-gcc-10-fanalyzer-reports-dereference-of-null-label-in-lib-dns-name-c-1167' into 'main'
Resolve "gcc-10+ -fanalyzer reports: dereference of NULL ‘label’ in lib/dns/name.c:1167"

Closes #2701

See merge request isc-projects/bind9!5046
2021-05-18 06:41:56 +00:00
Mark Andrews 29f1c1e677 Silence gcc-10-fanalyzer false positive
If 'state == ft_ordinary' then 'label' can't be NULL. Add
INSIST to reflect this.
2021-05-18 15:51:51 +10:00
Mark Andrews ea305a4877 Merge branch '2702-gcc-10-fanalyzer-reports' into 'main'
Resolve "gcc-10+ -fanalyzer reports:"

Closes #2702

See merge request isc-projects/bind9!5043
2021-05-18 05:45:26 +00:00
Mark Andrews 683ad6e4bd Silence gcc-10-fanalyzer false positive
Add REQUIRE(type == dns_rdatatype_nsec3 || firstp != NULL); so
that dereferences of *firstp is not flagged as a NULL pointer
dereference.
2021-05-18 15:19:28 +10:00
Mark Andrews 3b0d6450db Merge branch '2689-cid-331477-resource-leaks-resource_leak' into 'main'
Resolve "CID 331477: Resource leaks (RESOURCE_LEAK)"

Closes #2689

See merge request isc-projects/bind9!5016
2021-05-18 00:53:38 +00:00
Mark Andrews d24ea068c8 Add CHANGES for [GL #2689] 2021-05-18 10:34:10 +10:00
Mark Andrews 8eed392add Address potential resource leak in dst_key_fromnamedfile 2021-05-18 10:33:43 +10:00
Evan Hunt 27386db7fe Merge branch 'each-bufsize-doc' into 'main'
clarify buffer size options

See merge request isc-projects/bind9!5037
2021-05-17 17:02:18 +00:00
Evan Hunt 05985f6889 clarify buffer size options
the documentation for {udp,tcp}-{send,receive}-buffer options
was not complete. also revised for grammar.
2021-05-17 09:34:08 -07:00
Michał Kępień e3b442e538 Merge branch 'michal/tweak-cve-handling-checklists' into 'main'
Tweak security incident handling checklists

See merge request isc-projects/bind9!5017
2021-05-17 12:09:44 +00:00
Michał Kępień ba1145c017 Tweak security incident handling checklists
Add an item to the CVE issue template which calls for drafting the
security advisory early in the security incident handling process.  The
intention is to ensure there is enough time to review and polish ISC
security advisories before they get published.

Tweak the release checklist to make sure we carefully consider all
confidential issues before opening them up to the public.  This change
is intended as a safeguard against accidentally disclosing too much
information about a security vulnerability before our users get a chance
to patch it.
2021-05-17 14:07:27 +02:00
Ondřej Surý f2b297a37d Merge branch 'ondrej/remove-netmgr-quantum' into 'main'
Replace netmgr quantum with loop-preventing barrier

See merge request isc-projects/bind9!5028
2021-05-17 10:05:11 +00:00
Ondřej Surý 9e3cb396b2 Replace netmgr quantum with loop-preventing barrier
Instead of using fixed quantum, this commit adds atomic counter for
number of items on each queue and uses the number of netievents
scheduled to run as the limit of maximum number of netievents for a
single process_queue() run.

This prevents the endless loops when the netievent would schedule more
netievents onto the same loop, but we don't have to pick "magic" number
for the quantum.
2021-05-17 11:59:19 +02:00
Michal Nowak 9e21b80cbd Merge branch '2693-add-py-test-to-the-list-of-tested-pytest-names' into 'main'
Add py.test to the list of tested pytest names

Closes #2693

See merge request isc-projects/bind9!5022
2021-05-17 09:23:25 +00:00
Michal Nowak 510b4b70e9 Add py.test to the list of tested pytest names
OpenBSD changed the name of the pytest script from py.test-3 in OpenBSD
6.8 to py.test in OpenBSD 6.9.

The py.test-3 name which was added in d5562a3e for the sake of OpenBSD
and CentOS is still required for CentOS.
2021-05-17 11:12:43 +02:00
Ondřej Surý d34672796c Merge branch '2313-set-RCVBUF-SNDBUF' into 'main'
Resolve "Set reasonable values to SO_RCVBUF and SO_SNDBUF"

Closes #2313

See merge request isc-projects/bind9!4460
2021-05-17 07:42:37 +00:00
Ondřej Surý 3733b4f101 Add CHANGES and release note for GL #2313 2021-05-17 08:47:09 +02:00
Ondřej Surý 4509089419 Add configuration option to set send/recv buffers on the nm sockets
This commit adds a new configuration option to set the receive and send
buffer sizes on the TCP and UDP netmgr sockets.  The default is `0`
which doesn't set any value and just uses the value set by the operating
system.

There's no magic value here - set it too small and the performance will
drop, set it too large, the buffers can fill-up with queries that have
already timeouted on the client side and nobody is interested for the
answer and this would just make the server clog up even more by making
it produce useless work.

The `netstat -su` can be used on POSIX systems to monitor the receive
and send buffer errors.
2021-05-17 08:47:09 +02:00
Michal Nowak 089bfe20f9 Merge branch '2386-check-correct-copyright-dates-in-man-pages' into 'main'
Set copyright year to the current year

Closes #2386

See merge request isc-projects/bind9!4869
2021-05-14 12:46:33 +00:00
Michal Nowak 7eb44b05c5 Set copyright year to the current year
To ensure that a release with outdated copyright year is not produced at
the beginning of a year, set copyright year to the current year.
2021-05-14 14:21:58 +02:00
Michal Nowak 6f9ac0e997 Merge branch 'mnowak/add-unit-gcc-out-of-tree-ci-job' into 'main'
Add unit:gcc:out-of-tree CI job

See merge request isc-projects/bind9!4740
2021-05-14 12:21:06 +00:00
Michal Nowak 741fdd4fe1 Add unit:gcc:out-of-tree CI job
Also extract the workspace save-and-retrieve logic to YAML anchors.
2021-05-14 13:22:09 +02:00
Michal Nowak c628f2c71b Make masterXX.data.in reachable by out-of-tree builds
Unit test run for out-of-tree builds used to fail to find
masterXX.data.in files:

    /usr/bin/perl -w /builds/mnowak/bind9/lib/dns/tests/mkraw.pl < testdata/master/master12.data.in > testdata/master/master12.data
    /bin/bash: testdata/master/master12.data.in: No such file or directory
    make[4]: *** [Makefile:1910: testdata/master/master12.data] Error 1
2021-05-14 13:22:09 +02:00
Ondřej Surý 1c5de1aa43 Merge branch 'ondrej/fix-outgoing-udp-socket-selection-on-windows' into 'main'
Fix the outgoing UDP socket selection on Windows

See merge request isc-projects/bind9!5021
2021-05-13 14:05:22 +00:00
Ondřej Surý cd413234f7 Fix the outgoing UDP socket selection on Windows
The outgoing UDP socket selection would pick unintialized children
socket on Windows, because we have more netmgr workers than we have
listening sockets.  This commit fixes the selection by keeping the
outgoing socket the same, so it's always run on existing socket.
2021-05-13 15:04:48 +02:00
Artem Boldariev d7689d8dbc Merge branch 'artem-flamethrower-fixes' into 'main'
DoH flamethrower fixes

See merge request isc-projects/bind9!5019
2021-05-13 10:01:26 +00:00
Artem Boldariev bab9309231 Fix DoH unit tests logic
This commit fixes logic bugs in DoH test suite revealed by making DoH
not to call nghttp2_session_terminate_session() in server-side code.
2021-05-13 10:42:25 +03:00
Artem Boldariev 6816a741ca Fix crash in TLS caused by improper handling of shutdown messages
The problem was found when flamethrower was accidentally run in DoT
mode against DoH port.
2021-05-13 10:42:25 +03:00
Artem Boldariev 1947f6372d Limit the number of active concurrent HTTP/2 streams
The initial intent was to limit the number of concurrent streams by
the value of 100 but due to the error when reading the documentation
it was set to the maximum possible number of streams per session.

This could lead to security issues, e.g. a remote attacker could have
taken down the BIND instance by creating lots of sessions via low
number of transport connections. This commit fixes that.
2021-05-13 10:42:25 +03:00
Artem Boldariev d80d1b0dd9 Do not allow empty DoH endpoints to be added
It was possible to specify empty DoH endpoint in BIND's configuration
file: that was an error, we should not allow doing so.
2021-05-13 10:42:25 +03:00
Artem Boldariev 9155a87528 Do not call nghttp2_session_terminate_session() in server-side code
We should not call nghttp2_session_terminate_session() in server-side
code after all of the active HTTP/2 streams are processed. The
underlying transport connection is expected to remain opened at least
for some time in this case for new HTTP/2 requests to arrive. That is
what flamethrower was expecting and it makes perfect sense from the
HTTP/2 perspective.
2021-05-13 10:42:25 +03:00
Mark Andrews 4d888458ab Merge branch '2528-check-soa-rdata' into 'main'
Check SOA rdata for consistency in AXFR.

Closes #2528

See merge request isc-projects/bind9!5014
2021-05-13 05:17:39 +00:00
Evan HuntandMark Andrews 4d94f82232 system test
Attempt a zone transfer with mismatched SOA records.
2021-05-13 03:36:50 +00:00
Mark Andrews 7e54d8d2cb Add CHANGES entry for [GL #2528] 2021-05-13 03:36:50 +00:00
Mark Andrews e86508708d Check that the first and last SOA of an AXFR are consistent 2021-05-13 03:36:50 +00:00
Mark Andrews 72da25f31f Merge branch '2656-resolver-system-test-fails-on-macos' into 'main'
Resolve "resolver system test fails on macOS"

Closes #2656

See merge request isc-projects/bind9!4947
2021-05-12 03:40:52 +00:00
Mark Andrews a83afc10f9 Add missing call to isc_app_ctxstart 2021-05-12 03:01:15 +00:00
Ondřej Surý 0860ed6f5b Merge branch 'marka/add-missing-isc_condition_init' into 'main'
initalise sock->cond

See merge request isc-projects/bind9!5013
2021-05-11 13:03:13 +00:00
Mark AndrewsandOndřej Surý 0f6ae9000a initalise sock->cond 2021-05-11 14:06:26 +02:00
Ondřej Surý 4efd1e2ac8 Merge branch 'ondrej/increase-netmgr-quantum' into 'main'
Bump the netmgr quantum to 1024

See merge request isc-projects/bind9!5009
2021-05-10 20:04:10 +00:00
Ondřej SurýandOndřej Surý 3713a38689 Bump the netmgr quantum to 1024
During the stress testing, it was discovered that the default netmgr
quantum of 128 is not enough and there was a performance drop for TCP on
FreeBSD.  Bumping the default quantum to 1024 solves the performance
issue and is still enough to prevent the endless loops.
2021-05-10 21:32:31 +02:00
Evan Hunt ee6e540004 Merge branch 'each-taskmgr-setmode' into 'main'
reset taskmgr immediately after loading zones

See merge request isc-projects/bind9!5010
2021-05-10 19:32:00 +00:00
Evan Hunt 220ada9422 reset taskmgr mode immediately after returning from zone load
all privileged tasks are complete by the time we return from
isc_task_endexclusive(), so it makes sense to reset the taskmgr
mode to non-privileged right then.
2021-05-10 12:26:27 -07:00
Ondřej Surý 1639bcb59e Merge branch 'ondrej/dereference-taskmgr-after-all-tasks-are-done' into 'main'
Destroy reference to taskmgr after all tasks are done

See merge request isc-projects/bind9!5008
2021-05-10 19:24:53 +00:00
Ondřej SurýandEvan Hunt e623c12757 Destroy reference to taskmgr after all tasks are done
We were clearing the pointer to taskmgr as soon as isc_taskmgr_destroy()
would be called and before all tasks were finished.  Unfortunately, some
tasks would use global named_g_taskmgr objects from inside the events
and this would cause either a data race or NULL pointer dereference.

This commit fixes the data race by moving the destruction of the
referenced pointer to the time after all tasks are finished.
2021-05-10 12:13:27 -07:00
Ondřej Surý d3ebd19e23 Merge branch 'ondrej/fix-missing-isc_taskmgr_detach-on-exiting' into 'main'
Add isc_taskmgr_detach when task is created while shutting down

See merge request isc-projects/bind9!5006
2021-05-10 11:33:46 +00:00
Ondřej Surý 6c57a6cc3d Add isc_taskmgr_detach when task is created while shutting down
When taskmgr is shutting down, the creating the task would attach
to the taskmgr, but don't detach on error condition.
2021-05-10 11:39:51 +02:00
Evan Hunt 0e92060833 Merge branch '2654-create-isc_managers-api' into 'main'
Destroy netmgr before destroying taskmgr

Closes #2654

See merge request isc-projects/bind9!4983
2021-05-07 21:37:01 +00:00
Evan Hunt 19431b1c83 CHANGES 2021-05-07 14:28:33 -07:00
Ondřej SurýandEvan Hunt 0133096c88 improvements to socket_test
- be more strict, but patient, waiting for event completion.
- use an atomic pointer for the socket to silence TSAN warnings.
2021-05-07 14:28:33 -07:00
Ondřej SurýandEvan Hunt 365c6a9851 ensure interlocked netmgr events run on worker[0]
Network manager events that require interlock (pause, resume, listen)
are now always executed in the same worker thread, mgr->workers[0],
to prevent races.

"stoplistening" events no longer require interlock.
2021-05-07 14:28:32 -07:00
Evan Hunt c44423127d fix shutdown deadlocks
- ensure isc_nm_pause() and isc_nm_resume() work the same whether
  run from inside or outside of the netmgr.
- promote 'stop' events to the priority event level so they can
  run while the netmgr is pausing or paused.
- when pausing, drain the priority queue before acquiring an
  interlock; this prevents a deadlock when another thread is waiting
  for us to complete a task.
- release interlock after pausing, reacquire it when resuming, so
  that stop events can happen.

some incidental changes:
- use a function to enqueue pause and resume events (this was part of a
  different change attempt that didn't work out; I kept it because I
  thought was more readable).
- make mgr->nworkers a signed int to remove some annoying integer casts.
2021-05-07 14:28:32 -07:00
Ondřej SurýandEvan Hunt 4c8f6ebeb1 Use barriers for netmgr synchronization
The netmgr listening, stoplistening, pausing and resuming functions
now use barriers for synchronization, which makes the code much simpler.

isc/barrier.h defines isc_barrier macros as a front-end for uv_barrier
on platforms where that works, and pthread_barrier where it doesn't
(including TSAN builds).
2021-05-07 14:28:32 -07:00
Ondřej SurýandEvan Hunt 2eae7813b6 Run isc__nm_http_stoplistening() synchronously in netmgr
When isc__nm_http_stoplistening() is run from inside the netmgr, we need
to make sure it's run synchronously.  This commit is just a band-aid
though, as the desired behvaior for isc_nm_stoplistening() is not always
the same:

  1. When run from outside user of the interface, the call must be
     synchronous, e.g. the calling code expects the call to really stop
     listening on the interfaces.

  2. But if there's a call from listen<proto> when listening fails,
     that needs to be scheduled to run asynchronously, because
     isc_nm_listen<proto> is being run in a paused (interlocked)
     netmgr thread and we could get stuck.

The proper solution would be to make isc_nm_stoplistening()
behave like uv_close(), i.e., to have a proper callback.
2021-05-07 14:28:32 -07:00
Evan Hunt 5c08f97791 only run tasks as privileged if taskmgr is in privileged mode
all zone loading tasks have the privileged flag, but we only want
them to run as privileged tasks when the server is being initialized;
if we privilege them the rest of the time, the server may hang for a
long time after a reload/reconfig. so now we call isc_taskmgr_setmode()
to turn privileged execution mode on or off in the task manager.

isc_task_privileged() returns true if the task's privilege flag is
set *and* the taskmgr is in privileged execution mode. this is used
to determine in which netmgr event queue the task should be run.
2021-05-07 14:28:30 -07:00
Ondřej SurýandEvan Hunt 29a208aaf7 Fix crash when allocating UDP socket fails on OpenBSD
When socket() call fails, the UDP connect code would call the connectcb
with empty req->handle.  This has been fixed.
2021-05-07 14:28:30 -07:00
Ondřej SurýandEvan Hunt 0b491913df Don't clear dig lookup if it was already cleared
This workarounds couple of races where the current_lookup would be
already detached during shutting down the dig, but still processing the
pending reads.
2021-05-07 14:28:30 -07:00
Ondřej SurýandEvan Hunt 2836bc1854 Fix wrong query accounting in the connect function in dighost.c
The start_udp() function didn't properly attach to the query and thus
a callback with ISC_R_CANCELED would end with wrong accounting on the
query object.

Usually, this doesn't happen because underlying libuv API
uv_udp_connect() is synchronous, but isc_nm_udpconnect() could return
ISC_R_CANCELED in case it's called while the netmgr is shutting down.
2021-05-07 14:28:30 -07:00
Ondřej SurýandEvan Hunt dacf586e18 Make the netmgr queue processing quantized
There was a theoretical possibility of clogging up the queue processing
with an endless loop where currently processing netievent would schedule
new netievent that would get processed immediately.  This wasn't such a
problem when only netmgr netievents were processed, but with the
addition of the tasks, there are at least two situation where this could
happen:

 1. In lib/dns/zone.c:setnsec3param() the task would get re-enqueued
    when the zone was not yet fully loaded.

 2. Tasks have internal quantum for maximum number of isc_events to be
    processed, when the task quantum is reached, the task would get
    rescheduled and then immediately processed by the netmgr queue
    processing.

As the isc_queue doesn't have a mechanism to atomically move the queue,
this commit adds a mechanism to quantize the queue, so enqueueing new
netievents will never stop processing other uv_loop_t events.
The default quantum size is 128.

Since the queue used in the network manager allows items to be enqueued
more than once, tasks are now reference-counted around task_ready()
and task_run(). task_ready() now has a public API wrapper,
isc_task_ready(), that the netmgr can use to reschedule processing
of a task if the quantum has been reached.

Incidental changes: Cleaned up some unused fields left in isc_task_t
and isc_taskmgr_t after the last refactoring, and changed atomic
flags to atomic_bools for easier manipulation.
2021-05-07 14:28:30 -07:00
Ondřej SurýandEvan Hunt b5bf58b419 Destroy netmgr before destroying taskmgr
With taskmgr running on top of netmgr, the ordering of how the tasks and
netmgr shutdown interacts was wrong as previously isc_taskmgr_destroy()
was waiting until all tasks were properly shutdown and detached.  This
responsibility was moved to netmgr, so we now need to do the following:

  1. shutdown all the tasks - this schedules all shutdown events onto
     the netmgr queue

  2. shutdown the netmgr - this also makes sure all the tasks and
     events are properly executed

  3. Shutdown the taskmgr - this now waits for all the tasks to finish
     running before returning

  4. Shutdown the netmgr - this call waits for all the netmgr netievents
     to finish before returning

This solves the race when the taskmgr object would be destroyed before
all the tasks were finished running in the netmgr loops.
2021-05-07 14:28:30 -07:00
Ondřej SurýandEvan Hunt a011d42211 Add new isc_managers API to simplify <*>mgr create/destroy
Previously, netmgr, taskmgr, timermgr and socketmgr all had their own
isc_<*>mgr_create() and isc_<*>mgr_destroy() functions.  The new
isc_managers_create() and isc_managers_destroy() fold all four into a
single function and makes sure the objects are created and destroy in
correct order.

Especially now, when taskmgr runs on top of netmgr, the correct order is
important and when the code was duplicated at many places it's easy to
make mistake.

The former isc_<*>mgr_create() and isc_<*>mgr_destroy() functions were
made private and a single call to isc_managers_create() and
isc_managers_destroy() is required at the program startup / shutdown.
2021-05-07 10:19:05 -07:00
Artem Boldariev f23afce683 Merge branch 'artem/doh-tests-fix' into 'main'
Fix flawed DoH unit tests logic and some corner cases in the DoH code. Fix doh_test failure on FreeBSD 13.0

Closes #2632

See merge request isc-projects/bind9!5005
2021-05-07 13:25:56 +00:00
Artem Boldariev 8c0ea01f34 DoH: close active server streams when finishing session
Under some circumstances a situation might occur when server-side
session gets finished while there are still active HTTP/2
streams. This would lead to isc_nm_httpsocket object leaks.

This commit fixes this behaviour as well as refactors failed_read_cb()
to allow better code reuse.
2021-05-07 15:47:24 +03:00
Artem Boldariev a9e97f28b7 Fix crash in client side DoH code
This commit fixes a situation when a cstream object could get unlinked
from the list as a result of a cstream->read_cb call. Thus, unlinking
it after the call could crash the program.
2021-05-07 15:47:24 +03:00
Artem Boldariev cd178043d9 Make some TLS tests actually use quota
A directive to check quota was missing from some of the TLS tests
which were supposed to test TLS code with quotas.
2021-05-07 15:47:24 +03:00
Artem Boldariev 22376fc69a TLS: cancel reading on the underlying TCP socket after (see below)
... the last handle has been detached after calling write
callback. That makes it possible to detach from the underlying socket
and not to keep the socket object alive for too long. This issue was
causing TLS tests with quota to fail because quota might not have been
detached on time (because it was still referenced by the underlying
TCP socket).

One could say that this commit is an ideological continuation of:

513cdb52ec.
2021-05-07 15:47:24 +03:00
Artem Boldariev 3bf331c453 Fix crashes in TLS when handling TLS shutdown messages
This commit fixes some situations which could appear in TLS code when
dealing with shutdown messages and lead to crashes.
2021-05-07 15:47:24 +03:00
Artem Boldariev 0d3f503dc9 Avoid creating connect netievents during low level failures in HTTP
This way we create less netievent objects, not bombarding NM with the
messages in case of numerous low-level errors (like too many open
files) in e.g. unit tests.
2021-05-07 15:47:24 +03:00
Artem Boldariev 0e8ac61d6e Avoid creating httpclose netievents in case of low level failures
This way we create less load on NM workers by avoiding netievent
creation.
2021-05-07 15:47:24 +03:00
Artem Boldariev 8510c5cd59 Always call TCP connect callback from within a worker context
This change ensures that a TCP connect callback is called from within
the context of a worker thread in case of a low-level error when
descriptors cannot be created (e.g. when there are too many open file
descriptors).
2021-05-07 15:47:24 +03:00
Artem Boldariev 1349142333 Got rid of tlsconnect event and corresponding code
We do not need it since we decided to not return values from connect
functions.
2021-05-07 15:47:24 +03:00
Artem Boldariev 39448c1581 Finish HTTP session on write failure
Not doing so caused client-side code to not free file descriptors as
soon as possible, that was causing unit tests to fail.
2021-05-07 15:47:24 +03:00
Artem Boldariev 4c5b36780b Fix flawed DoH unit tests logic
This commit fixes some logical mistakes in DoH unit tests logic,
causing them either to fail or not to do what they are intended to do.
2021-05-07 15:47:24 +03:00
Michal Nowak b31b29d166 Merge branch 'mnowak/add-placeholder-for-issue-2671' into 'main'
Add placeholder for #2671

See merge request isc-projects/bind9!5004
2021-05-07 11:15:42 +00:00
Michal Nowak 8cc6725280 Add placeholder for #2671
Issue #2671 was merged to 9.16 but a respective placeholder was not
added to "main".
2021-05-07 12:08:40 +02:00
Matthijs Mekking cf99c1dc85 Merge branch '2603-test-dnssec-policy-none' into 'main'
Check zonefile is untouched if dnssec-policy none

Closes #2603

See merge request isc-projects/bind9!4888
2021-05-05 17:15:58 +00:00
Matthijs Mekking 66f2cd228d Use isdigit instead of checking character range
When looking for key files, we could use isdigit rather than checking
if the character is within the range [0-9].

Use (unsigned char) cast to ensure the value is representable in the
unsigned char type (as suggested by the isdigit manpage).

Change " & 0xff" occurrences to the recommended (unsigned char) type
cast.
2021-05-05 19:15:33 +02:00
Matthijs Mekking 0c09867e96 Changes and release notes for [#2603] 2021-05-05 19:15:32 +02:00
Matthijs Mekking 511bc1b882 Check for filename clashes /w dnssec-policy zones
Just like with dynamic and/or inline-signing zones, check if no two
or more zone configurations set the same filename. In these cases,
the zone files are not read-only and named-checkconf should catch
a configuration where multiple zone statements write to the same file.

Add some bad configuration tests where KASP zones reference the same
zone file.

Update the good-kasp test to allow for two zones configure the same
file name, dnssec-policy none.
2021-05-05 19:13:55 +02:00
Matthijs Mekking 2d1b3a9899 Check zonefile is untouched if dnssec-policy none
Make sure no DNSSEC contents are added to the zonefile if dnssec-policy
is set to "none" (and no .state files exist for the zone).
2021-05-05 19:13:55 +02:00
Mark Andrews d8cc16a659 Merge branch '2670-always-set-rewrite-when-compacting-a-version-1-journal' into 'main'
Resolve "Always set 'rewrite' when compacting a version 1 journal."

Closes #2670

See merge request isc-projects/bind9!4985
2021-05-05 13:33:55 +00:00
Mark Andrews a60b54e1df Add release note for [GL #2670] 2021-05-05 23:13:55 +10:00
Mark Andrews 79da175a76 Add CHANGES note for [GL #2670] 2021-05-05 23:13:09 +10:00
Mark Andrews ae1ae07b03 Check journal compaction 2021-05-05 23:12:37 +10:00
Mark Andrews 4a8e33b9f0 Always perform a re-write when processing a version 1 journal
version 1 journals may have a mix of type 1 and type 2 transaction
headers so always use the recovery code.
2021-05-05 23:12:37 +10:00
Mark Andrews 71df4fb84c Allow named-journalprint to compact journals at a given serial 2021-05-05 23:12:37 +10:00
Matthijs Mekking cecc905b46 Merge branch 'matthijs-follow-up-2596' into 'main'
Remove double "insecure" check

See merge request isc-projects/bind9!4997
2021-05-05 10:48:38 +00:00
Matthijs Mekking 22243ac804 Remove double "insecure" check
This was a conflict between dba13d280a
and 636ff1e15c.
2021-05-05 12:45:47 +02:00
Matthijs Mekking 09ed248f60 Merge branch '2596-dnssec-policy-keys-inaccessible' into 'main'
Don't roll keys when the private key file is offline

Closes #2596

See merge request isc-projects/bind9!4885
2021-05-05 10:33:46 +00:00
Matthijs Mekking 636ff1e15c No longer need to strcmp for "none"
When we introduced "dnssec-policy insecure" we could have removed the
'strcmp' check for "none", because if it was set to "none", the 'kasp'
variable would have been set to NULL.
2021-05-05 11:23:53 +02:00
Matthijs Mekking 366ed047dd Changes and release notes for [#2596] 2021-05-05 11:14:35 +02:00
Matthijs Mekking 4a8ad0a77f Add kasp tests for offline keys
Add a test for default.kasp that if we remove the private key file,
no successor key is created for it. We need to update the kasp script
to deal with a missing private key. If this is the case, skip checks
for private key files.

Add a test with a zone for which the private key of the ZSK is missing.

Add a test with a zone for which the private key of the KSK is missing.
2021-05-05 11:14:02 +02:00
Matthijs Mekking 6a60bf637d Update smart signing when key is offline
BIND 9 is smart about when to sign with what key. If a key is offline,
BIND will delete the old signature anyway if there is another key to
sign the RRset with.

With KASP we don't want to fallback to the KSK if the ZSK is missing,
only for the SOA RRset. If the KSK is missing, but we do have a ZSK,
deleting the signature is fine. Otherwise it depends on if we use KASP
or not. Update the 'delsig_ok' function to reflect that.
2021-05-05 11:13:19 +02:00
Matthijs Mekking 3e6fc49c16 Don't roll offline keys
When checking the current DNSSEC state against the policy, consider
offline keys. If we didn't found an active key, check if the key is
offline by checking the public key list. If there is a match in the
public key list (the key data is retrieved from the .key and the
.state files), treat the key as offline and don't create a successor
key for it.
2021-05-05 11:13:19 +02:00
Matthijs Mekking b3a5859a9b rndc dnssec -status should include offline keys
The rndc command 'dnssec -status' only considered keys from
'dns_dnssec_findmatchingkeys' which only includes keys with accessible
private keys. Change it so that offline keys are also listed in the
status.
2021-05-05 11:13:19 +02:00
Matthijs Mekking 7ed089576f Try to read state when reading keylist from rdata
The function 'dns_dnssec_keylistfromrdataset()' creates a keylist from
the DNSKEY RRset. If we attempt to read the private key, we also store
the key state. However, if the private key is offline, the key state
will not be stored. To fix this, first attempt to read the public key
file. If then reading the private key file fails, and we do have a
public key, add that to the keylist, with appropriate state. If we
also failed to read the public key file, add the DNSKEY to the keylist,
as we did before.
2021-05-05 11:13:19 +02:00
Matthijs Mekking fa05c1b8da When reading public key from file, also read state
The 'dst_key_fromnamedfile()' function did not read and store the
key state from the .state file when reading a public key file.
2021-05-05 11:13:19 +02:00
Matthijs Mekking cf17698f87 Fix a kasp lock issue
The kasp lock would stay locked if 'dns_keymgr_run' failed.
2021-05-05 11:13:19 +02:00
Mark Andrews 2be319b759 Merge branch '2678-named-checkconf-doesn-t-catch-redefinition-of-dnssec-policy-insecure' into 'main'
Resolve "named-checkconf doesn't catch redefinition of dnssec-policy insecure"

Closes #2678

See merge request isc-projects/bind9!4994
2021-05-05 07:03:12 +00:00
Mark Andrews dba13d280a named-checkconf now detects redefinition of dnssec-policy 'insecure' 2021-05-05 16:23:19 +10:00
Mark Andrews 0f53872542 Merge branch '2536-inline-signing-documentation-doesn-t-match-reality' into 'main'
Resolve "inline-signing documentation doesn't match reality"

Closes #2536

See merge request isc-projects/bind9!4751
2021-05-05 00:17:40 +00:00
Matthijs MekkingandMark Andrews a548a450b3 checkconf tests for inline-signing at options/view 2021-05-04 23:35:59 +00:00
Mark Andrews 03978a7881 Add Release note for [GL #2536] 2021-05-04 23:35:59 +00:00
Mark Andrews 475a553e37 Add CHANGES note for [GL #2536] 2021-05-04 23:35:59 +00:00
Mark Andrews b3301da262 inline-signing should have been in zone_only_clauses 2021-05-04 23:35:59 +00:00
Ondřej Surý 74d9a917eb Merge branch '2675-wrong-rfc-reference-in-name-c' into 'main'
Fix RFC292 -> RFC952 typo

Closes #2675

See merge request isc-projects/bind9!4990
2021-05-04 15:22:49 +00:00
Ondřej Surý d2dba352cb Fix RFC292 -> RFC952 typo 2021-05-04 17:21:52 +02:00
Matthijs Mekking 38a422ed81 Merge branch '2624-kasp-test-failure-job-1630205' into 'main'
Fix intermittent kasp test failure

Closes #2624

See merge request isc-projects/bind9!4884
2021-05-04 08:24:43 +00:00
Matthijs MekkingandMark Andrews 572f421df4 Fix intermittent kasp test failure
The kasp system test performs for each zone a couple of checks to make
sure the zone is signed correctly. To avoid test failures caused by
timing issues, there is first a check to ensure the zone is done
signing, 'wait_for_done_signing'. This function waits with the DNSSEC
checks until a "zone_rekey done" log message is seen for a specific
key.

Unfortunately this is not sufficient to avoid test failures due to
timing issues, because there is a small amount of time in between this
log message and the newly signed zone actually being served.

Therefore, in 'check_apex', retry for three seconds the DNSKEY query
check. After that, additional checks should pass without retries,
because at that point we know for sure the zone has been resigned with
the expected keys.

Also reduce the number of redundant 'check_signatures'
2021-05-04 04:50:01 +00:00
Mark Andrews 33fd1a8437 Merge branch '2621-pull-request-to-fix-rdnc-addzone-doc' into 'main'
Resolve "Pull request to fix rdnc-addzone doc"

Closes #2621

See merge request isc-projects/bind9!4882
2021-05-04 02:37:51 +00:00
Mark Andrews 205d1bb762 Remove spurious $ and \ in addzone example 2021-05-04 02:18:34 +00:00
Ondřej Surý 44c6a69c9c Merge branch 'ondrej/add-backtrace-support-for-Windows' into 'main'
Add support for generating backtraces on Windows

See merge request isc-projects/bind9!4982
2021-05-03 18:40:30 +00:00
Ondřej Surý dfd56b84f5 Add support for generating backtraces on Windows
This commit adds support for generating backtraces on Windows and
refactors the isc_backtrace API to match the Linux/BSD API (without
the isc_ prefix)

 * isc_backtrace_gettrace() was renamed to isc_backtrace(), the third
   argument was removed and the return type was changed to int
 * isc_backtrace_symbols() was added
 * isc_backtrace_symbols_fd() was added and used as appropriate
2021-05-03 20:31:52 +02:00
Ondřej Surý c3ee539463 Merge branch 'ondrej/add-nanosleep-and-usleep-windows-shims' into 'main'
Add nanosleep and usleep Windows shims

See merge request isc-projects/bind9!4981
2021-05-03 18:25:55 +00:00
Ondřej Surý c58dc55c82 Merge branch 'ondrej/replace-CreateThreads-with-isc_thread_create' into 'main'
Add trampoline around iocompletionport_createthreads()

See merge request isc-projects/bind9!4980
2021-05-03 18:24:06 +00:00
Ondřej Surý 37c0d196e3 Use uv_sleep in the netmgr code
libuv added uv_sleep(unsigned int msec) to the API since 1.34.0.  Use that in
the netmgr code and define usleep based shim for libuv << 1.34.0.
2021-05-03 20:22:54 +02:00
Ondřej Surý c37ff5d188 Add nanosleep and usleep Windows shims
This commit adds POSIX nanosleep() and usleep() shim implementation for
Windows to help implementors use less #ifdef _WIN32 in the code.
2021-05-03 20:22:54 +02:00
Ondřej Surý cd54bbbd9a Add trampoline around iocompletionport_createthreads()
On Windows, the iocompletionport_createthreads() didn't use
isc_thread_create() to create new threads for processing IO, but just a
simple CreateThread() function that completely circumvent the
isc_trampoline mechanism to initialize global isc_tid_v.  This lead to
segmentation fault in isc_hp API because '-1' isn't valid index to the
hazard pointer array.

This commit changes the iocompletionport_createthreads() to use
isc_thread_create() instead of CreateThread() to properly initialize
isc_tid_v.
2021-05-03 20:21:15 +02:00
Diego dos Santos Fronza 9dedfcdda6 Merge branch '2627-tlsstream-c-warning-comparison-of-integer-expressions-of-different-signedness' into 'main'
Resolve "tlsstream.c: warning: comparison of integer expressions of different signedness"

Closes #2627

See merge request isc-projects/bind9!4906
2021-05-03 17:03:44 +00:00
Diego FronzaandMark Andrews 7729844150 Address comparison of integers with different signedess 2021-05-03 06:54:30 +00:00
Matthijs Mekking 7a3b6a7fb0 Merge branch 'matthijs-nsupdate-update_test' into 'main'
Update nsupdate test

See merge request isc-projects/bind9!4975
2021-04-30 12:26:12 +00:00
Matthijs Mekking 5b31811b5f Update nsupdate test
The nsupdate system test did not record failures from the
'update_test.pl' Perl script. This was because the 'ret' value was
not being saved outside the '{ $PERL ... || ret=1 } cat_i' scope.

Change this piece to store the output in a separate file and then
cat its contents. Now the 'ret' value is being saved.

Also record failures in 'update_test.pl' if sending the update
failed.

Add missing 'n' incrementals to 'nsupdate/test.sh' to keep track of
test numbers.
2021-04-30 12:25:25 +00:00
Petr Špaček 9d04a731ba Merge branch 'pspacek/rtd-sphinx-fix' into 'main'
Fix ARM build on readthedocs.org

See merge request isc-projects/bind9!4968
2021-04-30 10:57:30 +00:00
Petr Špaček 7df913aa3a Fix ARM build on readthedocs.org
By default readthedocs.org uses Sphinx 1.8.5, but MR !4563 has
introduced depedency on ReferenceRole class which is available only in
Sphinx 2.0.0.

Path to doc/arm/requirements.txt needs to be configured in
readthedocs.org.
2021-04-30 12:56:56 +02:00
Matthijs Mekking 968b9b5697 Merge branch '2645-dnssec-polic-insecure' into 'main'
Add built-in dnssec-policy "insecure"

Closes #2645

See merge request isc-projects/bind9!4929
2021-04-30 10:10:32 +00:00
Matthijs Mekking 287428e0aa Add kasp test policy goes straight to "none"
Add a test case when a dnssec-policy is reconfigured to "none",
without setting it to "insecure" first. This is unsupported behavior,
but we want to make sure the behavior is somewhat expected. The
zone should remain signed (but will go bogus once the signatures
expire).
2021-04-30 11:20:41 +02:00
Matthijs Mekking 75024736a4 Release notes and changes for [#2645]
The feature "going insecure gracefully" has been changed.
2021-04-30 11:20:40 +02:00
Matthijs Mekking fadc57d3d0 Update documentation with "insecure" policy
Update the ARM to mention the new built-in "insecure" policy.  Update
the DNSSEC guide recipe "Revert to unsigned" to add the additional
step of reconfiguring the zone to "insecure" (instead of immediately
set it to "none").
2021-04-30 11:18:38 +02:00
Matthijs Mekking 9c6ff463fd Add test for "insecure" policy
While it is meant to be used for transitioning a zone to insecure,
add a test case where a zone uses the "insecure" policy immediately.

The zone will go through DNSSEC maintenance, but the outcome should
be the same as 'dnssec-policy none;', that is the zone should be
unsigned.
2021-04-30 11:18:38 +02:00
Matthijs Mekking 17e3b056c8 Update kasp tests to "insecure" policy
The tests for going insecure should be changed to use the built-in
"insecure" policy.

The function that checks dnssec status output should again check
for the special case "none".
2021-04-30 11:18:38 +02:00
Matthijs Mekking 2710d9a11d Add built-in dnssec-policy "insecure"
Add a new built-in policy "insecure", to be used to gracefully unsign
a zone. Previously you could just remove the 'dnssec-policy'
configuration from your zone statement, or remove it.

The built-in policy "none" (or not configured) now actually means
no DNSSEC maintenance for the corresponding zone. So if you
immediately reconfigure your zone from whatever policy to "none",
your zone will temporarily be seen as bogus by validating resolvers.

This means we can remove the functions 'dns_zone_use_kasp()' and
'dns_zone_secure_to_insecure()' again. We also no longer have to
check for the existence of key state files to figure out if a zone
is transitioning to insecure.
2021-04-30 11:18:38 +02:00
Mark Andrews 1f4234ec89 Merge branch '2668-handle-net-dns-versions-that-don-t-support-nsec3param' into 'main'
Resolve "Handle Net::DNS versions that don't support NSEC3PARAM"

Closes #2668

See merge request isc-projects/bind9!4971
2021-04-30 06:25:39 +00:00
Mark Andrews 044933756a NSEC3PARAM support was added to Net::DNS in 1.00_06
Require 1.01 or later to when adding a NSEC3PARAM records.
2021-04-30 15:59:30 +10:00
Mark Andrews 7b62af4e0e Merge branch '2658-update-zonemd-now-that-rfc-8976-has-been-issued' into 'main'
Resolve "Update ZONEMD now that RFC 8976 has been issued."

Closes #2658

See merge request isc-projects/bind9!4946
2021-04-30 01:08:46 +00:00
Mark Andrews 8510ccaa54 Update ZONEMD to match RFC 8976
* The location of the digest type field has changed to where the
  reserved field was.
* The reserved field is now called scheme and is where the digest
  type field was.
* Digest type 2 has been defined (SHA256).
2021-04-30 10:43:37 +10:00
Michal Nowak c922608333 Merge branch 'mnowak/configure-with-enable-dnstap-by-default' into 'main'
Configure with --enable-dnstap by default

See merge request isc-projects/bind9!4618
2021-04-29 13:58:33 +00:00
Michal Nowak c97c6fbfea Suppress TSAN errors from libfstrm.so
dnstap_test produces TSAN errors which originate in libfstrm.so. Unless
libfstrm is TSAN clean or a workaround is placed in libfstrm sources,
suppressing TSAN coming from libfstrm is necessary to test DNSTAP under
TSAN.
2021-04-29 15:57:07 +02:00
Michal Nowak deff0ae317 Configure with --enable-dnstap by default
All platforms but OpenBSD have dnstap dependencies readily in their
respective repositories, and dnstap thus can be tested there. Given that
majority of images have dnstap dependencies available, it seems fitting
to make dnstap enabled by default.
2021-04-29 15:57:07 +02:00
Michal Nowak f11f7d0086 Merge branch 'mnowak/disable-pytest-cacheprovider-plugin' into 'main'
Disable pytest cacheprovider plugin in CI

See merge request isc-projects/bind9!4961
2021-04-29 13:43:10 +00:00
Michal Nowak e1c3034107 Disable pytest cacheprovider plugin in CI
The pytest "cacheprovider" plugin produces a .cache/v/cache/lastfailed
file, which holds a Python dictionary structure with failed tests.
However, on Ubuntu 16.04 (Xenial) the file is created even though the
test passed and the file contains just an empty dictionary ("{}").

Given that we are not interested in this feature, disabling the
"cacheprovider" plugin globally and removing per-test removals of the
.cache directory seems like the best course of action.
2021-04-29 15:29:18 +02:00
Matthijs Mekking c2f43e9516 Merge branch '2445-nsec3-iterations-resolver' into 'main'
Resolve "NSEC3 iterations"

Closes #2445

See merge request isc-projects/bind9!4957
2021-04-29 13:09:30 +00:00
Mark AndrewsandMatthijs Mekking ad236976fc Add release note for [GL #2445] 2021-04-29 13:43:40 +02:00
Mark AndrewsandMatthijs Mekking fd1f7b6480 Add CHANGES for [GL #2445] 2021-04-29 13:43:40 +02:00
Mark AndrewsandMatthijs Mekking e6e0e29fbb Check insecure responses returned with too many NSEC3 iterations 2021-04-29 13:43:40 +02:00
Mark AndrewsandMatthijs Mekking af02bbcdd6 Mark DNSSEC responses with NSEC3 records that exceed 150 as insecure 2021-04-29 13:43:40 +02:00
Michał Kępień b189defb6a Merge branch '2372-add-hyperlink-to-gl-xxxx-labels-in-documentation' into 'main'
Resolve "Add hyperlink to [GL XXXX] labels in documentation"

Closes #2372

See merge request isc-projects/bind9!4563
2021-04-29 11:35:33 +00:00
Michal NowakandMichał Kępień fe1dea6572 Update Danger check for GitLab references
Release notes now employ a custom :gl: Sphinx role for linking to GitLab
issues/MRs.  Tweak the relevant Danger checks to account for that.
2021-04-29 13:24:21 +02:00
Michał Kępień 2fadf29e6b Add a Sphinx role for linking GitLab issues/MRs
Define a :gl: Sphinx role that takes a GitLab issue/MR number as an
argument and creates a hyperlink to the relevant ISC GitLab URL.  This
makes it easy to reach ISC GitLab pages directly from the release notes.

Make all GitLab references in the release notes use the new Sphinx role.
2021-04-29 13:24:21 +02:00
Michal NowakandMichał Kępień aeb43a45ac Make use of the :rfc: role in the ARM consistent
Make sure all RFC references in the ARM use the stock :rfc: Sphinx role.
2021-04-29 13:24:21 +02:00
Ondřej Surý 9c3fac706e Merge branch 'ondrej/use-sigabrt-from-start.pl' into 'main'
Use SIGABRT instead of SIGKILL to produce cores on failed start

See merge request isc-projects/bind9!4928
2021-04-29 10:44:26 +00:00
Ondřej Surý 861a236937 Use SIGABRT instead of SIGKILL to produce cores on failed start
When the `named` would hang on startup it would be killed with SIGKILL
leaving us with no information about the state the process was in.
This commit changes the start.pl script to send SIGABRT instead, so we
can properly collect and process the coredump from the hung named
process.
2021-04-29 12:03:50 +02:00
Matthijs Mekking d8355d197d Merge branch 'matthijs-follow-up-2642-nsec3-iter-kasp' into 'main'
dnssec-policy: reduce NSEC3 iterations to 150

See merge request isc-projects/bind9!4952
2021-04-29 09:32:20 +00:00
Matthijs Mekking efa5d84dcf dnssec-policy: reduce NSEC3 iterations to 150
When reducing the number of NSEC3 iterations to 150, commit
aa26cde2ae added tests for dnssec-policy
to check that a too high iteration count is a configuration failure.

The test is not sufficient because 151 was always too high for
ECDSAP256SHA256. The test should check for a different algorithm.

There was an existing test case that checks for NSEC3 iterations.
Update the test with the new maximum values.

Update the code in 'kaspconf.c' to allow at most 150 iterations.
2021-04-29 10:41:16 +02:00
Michał Kępień 0fd3c8e48b Merge branch 'v9_17_12-release' into 'main'
Merge 9.17.12 release branch

See merge request isc-projects/bind9!4953
2021-04-29 08:37:11 +00:00
Michał Kępień 0c4694277f Set up release notes for BIND 9.17.13 2021-04-29 10:30:00 +02:00
Michał Kępień 3ea6421c49 Update BIND version to 9.17.12 2021-04-29 10:30:00 +02:00
Michał Kępień a0618507c4 Add a CHANGES marker 2021-04-29 10:30:00 +02:00
Michał Kępień 628ed23b7c Merge branch 'michal/prepare-documentation-for-bind-9.17.12' into 'security-main'
Prepare documentation for BIND 9.17.12

See merge request isc-private/bind9!280
2021-04-29 10:30:00 +02:00
Michał Kępień 9879d2a6b4 Merge branch '2540-confidential-issue-existing-dname' into 'security-main'
[CVE-2021-25215] Properly answer queries for DNAME records that require the DNAME to be processed to resolve itself

See merge request isc-private/bind9!253
2021-04-29 10:30:00 +02:00
Michał Kępień a051dd65e2 Prepare release notes for BIND 9.17.12 2021-04-29 10:30:00 +02:00
Michał Kępień df2edd67da Merge branch '2467-confidential-issue-ixfr-checks' into 'security-main'
[CVE-2021-25214] Prevent malformed incoming zone transfers from producing a zone without an SOA record

See merge request isc-private/bind9!239
2021-04-29 10:30:00 +02:00
Mark AndrewsandMichał Kępień f1d81d4e89 Add Release Notes entry for [GL #2540] 2021-04-29 10:30:00 +02:00
Michał Kępień e8d9de39ac Add release note for GL #2490 2021-04-29 10:30:00 +02:00
Mark AndrewsandMichał Kępień bd8a4a46df Add release note for [GL #2467] 2021-04-29 10:30:00 +02:00
Mark AndrewsandMichał Kępień a2954c3b57 Add CHANGES entry for [GL #2540] 2021-04-29 10:30:00 +02:00
Michał Kępień 4ac14c4a83 Reorder release notes 2021-04-29 10:30:00 +02:00
Mark AndrewsandMichał Kępień 83ab536a30 Add CHANGES entry for [GL #2467] 2021-04-29 10:30:00 +02:00
Mark AndrewsandMichał Kępień c1190a3fe0 Handle DNAME lookup via itself
When answering a query, named should never attempt to add the same RRset
to the ANSWER section more than once.  However, such a situation may
arise when chasing DNAME records: one of the DNAME records placed in the
ANSWER section may turn out to be the final answer to a client query,
but there is no way to know that in advance.  Tweak the relevant INSIST
assertion in query_respond() so that it handles this case properly.
qctx->rdataset is freed later anyway, so there is no need to clean it up
in query_respond().
2021-04-29 10:30:00 +02:00
Michał Kępień 3270ac7d9b Tweak and reword release notes 2021-04-29 10:30:00 +02:00
Mark AndrewsandMichał Kępień 5318627227 Unload a zone if a transfer breaks its SOA record
If a zone transfer results in a zone not having any NS records, named
stops serving it because such a zone is broken.  Do the same if an
incoming zone transfer results in a zone lacking an SOA record at the
apex or containing more than one SOA record.
2021-04-29 10:30:00 +02:00
Michał Kępień d9011c2a4d Tweak and reword recent CHANGES entries 2021-04-29 10:30:00 +02:00
Mark AndrewsandMichał Kępień 2ca0bd882d Address inconsistencies in checking added RRsets
loading_addrdataset() rejects SOA RRsets which are not at top of zone.
addrdataset() should similarly reject such RRsets.
2021-04-29 10:30:00 +02:00
Mark AndrewsandMichał Kępień 01209dfa49 Check SOA owner names in zone transfers
An IXFR containing SOA records with owner names different than the
transferred zone's origin can result in named serving a version of that
zone without an SOA record at the apex.  This causes a RUNTIME_CHECK
assertion failure the next time such a zone is refreshed.  Fix by
immediately rejecting a zone transfer (either an incremental or
non-incremental one) upon detecting an SOA record not placed at the apex
of the transferred zone.
2021-04-29 10:30:00 +02:00
Mark Andrews 0695a42adb Merge branch '2642-reduce-the-maximum-nsec3-iterations-that-can-be-configured' into 'main'
Resolve "Reduce the maximum NSEC3 iterations that can be configured"

Closes #2642

See merge request isc-projects/bind9!4925
2021-04-29 07:39:10 +00:00
Mark Andrews ca07b8e414 Add Release Note for [GL #2642] 2021-04-29 17:18:26 +10:00
Mark Andrews e04f06873f Add CHANGES for [GL #2642]
5625.   [func]          Reduce the supported maximum number of iterations
                        that can be configured in an NSEC3 zones to 150.
                        [GL #2642]
2021-04-29 17:18:26 +10:00
Mark Andrews 46eb21c546 Check that excessive iterations in logged by named when
loading an existing zone or transfering from the primary.
2021-04-29 17:18:26 +10:00
Mark Andrews 8ec16c378d Check NSEC3 iterations with dnssec-signzone 2021-04-29 17:18:26 +10:00
Mark Andrews 4ce8437a6e Check that named rejects excessive iterations via UPDATE 2021-04-29 17:18:26 +10:00
Mark Andrews 3fe75d9809 nsupdate: reject attempts to add NSEC3PARAM with excessive iterations 2021-04-29 17:18:26 +10:00
Mark Andrews c9f5f8a059 Warn if there is excessive NSEC3 iterations 2021-04-29 17:18:26 +10:00
Mark Andrews aa26cde2ae Check dnssec-policy nsec3param iterations limit 2021-04-29 17:18:26 +10:00
Mark Andrews 29126500d2 Reduce nsec3 max iterations to 150 2021-04-29 17:18:26 +10:00
Matthijs Mekking 51f94b8c7c Merge branch 'matthijs-nit-serve-stale-fixes' into 'main'
Serve-stale nit fixes

See merge request isc-projects/bind9!4940
2021-04-28 10:43:49 +00:00
Matthijs Mekking 104b676235 Serve-stale nit fixes
While working on the serve-stale backports, I noticed the following
oddities:

1. In the serve-stale system test, in one case we keep track of the
   time how long it took for dig to complete. In commit
   aaed7f9d8c, the code removed the
   exception to check for result == ISC_R_SUCCESS on stale found
   answers, and adjusted the test accordingly. This failed to update
   the time tracking accordingly. Move the t1/t2 time track variables
   back around the two dig commands to ensure the lookups resolved
   faster than the resolver-query-timeout.

2. We can remove the setting of NS_QUERYATTR_STALEOK and
   DNS_RDATASETATTR_STALE_ADDED on the "else if (stale_timeout)"
   code path, because they are added later when we know we have
   actually found a stale answer on a stale timeout lookup.

3. We should clear the NS_QUERYATTR_STALEOK flag from the client
   query attributes instead of DNS_RDATASETATTR_STALE_ADDED (that
   flag is set on the rdataset attributes).

4. In 'bin/named/config.c' we should set the configuration options
   in alpabetical order.

5. In the ARM, in the backports we have added "(stale)" between
   "cached" and "RRset" to make more clear a stale RRset may be
   returned in this scenario.
2021-04-28 12:24:24 +02:00
Michał Kępień 7c7b97b916 Merge branch 'michal/limit-logging-for-verbose-system-tests' into 'main'
Limit logging for verbose system tests

See merge request isc-projects/bind9!4812
2021-04-28 06:58:34 +00:00
Michał Kępień 241e85ef0c Warn when log files grow too big in system tests
Exerting excessive I/O load on the host running system tests should be
avoided in order to limit the number of false positives reported by the
system test suite.  In some cases, running named with "-d 99" (which is
the default for system tests) results in a massive amount of logs being
generated, most of which are useless.  Implement a log file size check
to draw developers' attention to overly verbose named instances used in
system tests.  The warning threshold of 200,000 lines was chosen
arbitrarily.
2021-04-28 07:56:47 +02:00
Michał Kępień 17e5c2a50e Prevent useless logging in the "tcp" system test
The regression test for CVE-2020-8620 causes a lot of useless messages
to be logged.  However, globally decreasing the log level for the
affected named instance would be a step too far as debugging information
may be useful for troubleshooting other checks in the "tcp" system test.
Starting a separate named instance for a single check should be avoided
when possible and thus is also not a good solution.  As a compromise,
run "rndc trace 1" for the affected named instance before starting the
regression test for CVE-2020-8620.
2021-04-28 07:56:47 +02:00
Michał Kępień 4a8d404876 Limit logging for verbose system tests
The system test framework starts all named instances with the "-d 99"
command line option (unless it is overridden by a named.args file in a
given instance's working directory).  This causes a lot of log messages
to be written to named.run files - currently over 5 million lines for a
single test suite run.  While debugging information preserved in the log
files is essential for troubleshooting intermittent test failures, some
system tests involve sending hundreds or even thousands of queries,
which causes the relevant log files to explode in size.  When multiple
tests (or even multiple test suites) are run in parallel, excessive
logging contributes considerably to the I/O load on the test host,
increasing the odds of intermittent test failures getting triggered.

Decrease the debug level for the seven most verbose named instances:

  - use "-d 3" for ns2 in the "cacheclean" system test (it is the lowest
    logging level at which the test still passes without the need to
    apply any changes to tests.sh),

  - use "-d 1" for the other six named instances.

This roughly halves the number of lines logged by each test suite run
while still leaving enough information in the logs to allow at least
basic troubleshooting in case of test failures.

This approach was chosen as it results in a greater decrease in the
number of lines logged than running all named instances with "-d 3",
without causing any test failures.
2021-04-28 07:56:47 +02:00
Diego dos Santos Fronza 99a4f6119a Merge branch '2529-add-__attribute__-malloc-for-isc_mempool_get' into 'main'
Resolve "Add __attribute__((malloc)) for isc_mempool_get"

Closes #2529

See merge request isc-projects/bind9!4858
2021-04-26 14:50:15 +00:00
Diego Fronza 54aa60eef8 Add malloc attribute to memory allocation functions
The malloc attribute allows compiler to do some optmizations on
functions that behave like malloc/calloc, like assuming that the
returned pointer do not alias other pointers.
2021-04-26 11:32:17 -03:00
Diego Fronza efb9c540cd Removed unnecessary check (mpctx->items == NULL)
There is no possibility for mpctx->items to be NULL at the point where
the code was removed, since we enforce that fillcount > 0, if
mpctx->items == NULL when isc_mempool_get is called, then we will
allocate fillcount more items and add to the mpctx->items list.
2021-04-26 11:32:17 -03:00
Diego dos Santos Fronza 19df09d225 Merge branch '2564-nslookup-segfaults-for-servfail' into 'main'
Add workaround for "nslookup segfaults for SERVFAIL"

See merge request isc-projects/bind9!4796
2021-04-26 14:30:46 +00:00
Mark AndrewsandDiego Fronza f2d00069c3 Add CHANGES note for [GL #2564] 2021-04-26 11:15:25 -03:00
Diego Fronza 4d6408b823 Fix following up lookup failure if more resolvers are available
_query_detach function was incorrectly unliking the query object from
the lookup->q query list, this made it impossible to follow a query
lookup failure with the next one in the list (possibly using a separate
resolver), as the link to the next query in the list was dissolved.

Fix by unliking the node only when the query object is about to be
destroyed, i.e. there is no more references to the object.
2021-04-26 11:14:14 -03:00
Michał Kępień 3793733704 Merge branch '2650-handle-soa-rrsigs-not-at-zone-apex' into 'main'
Handle RRSIG(SOA) RRsets not at zone apex

Closes #2650

See merge request isc-projects/bind9!4936
2021-04-26 11:06:00 +00:00
Matthijs Mekking a64dd511f4 Merge branch '2628-kasp-create-multiple-key-keyid-conflict' into 'main'
Check for keyid conflicts between new keys

Closes #2628

See merge request isc-projects/bind9!4886
2021-04-26 09:29:19 +00:00
Matthijs Mekking b99ec65745 Changes and release notes for [#2628] 2021-04-26 10:43:39 +02:00
Matthijs Mekking 668301f138 Check for keyid conflicts between new keys
When the keymgr needs to create new keys, it is possible it needs to
create multiple keys. The keymgr checks for keyid conflicts with
already existing keys, but it should also check against that it just
created.
2021-04-26 10:42:46 +02:00
Michał Kępień c84399df64 Merge branch '2634-test-tkey-gssapi-credential-conditionally' into 'main'
Test "tkey-gssapi-credential" conditionally

Closes #2634

See merge request isc-projects/bind9!4938
2021-04-26 07:17:12 +00:00
Michał Kępień a3957af864 Test "--without-gssapi" in GitLab CI
GitLab CI pipelines do not currently include a Linux job that would have
GSSAPI support disabled.  Add the "--without-gssapi" option to the
./configure invocation on Debian 9 to address that deficiency and also
to continuously test that build-time switch.
2021-04-26 07:16:38 +02:00
Michał Kępień 6feac68b50 Test "tkey-gssapi-credential" conditionally
If "tkey-gssapi-credential" is set in the configuration and GSSAPI
support is not available, named will refuse to start.  As the test
system framework does not support starting named instances
conditionally, ensure that "tkey-gssapi-credential" is only present in
named.conf if GSSAPI support is available.
2021-04-26 07:16:38 +02:00
Mark Andrews a26e29896a Merge branch 'marka-shutdown-sync' into 'main'
shutdown: wait for named to start

See merge request isc-projects/bind9!4921
2021-04-24 04:36:45 +00:00
Mark Andrews 8d5870f9df Wait for named to start
If we don't wait for named to finish starting, 'rndc stop' may
fail due to the listen limit being reached in named leading
to a false negative test
2021-04-24 01:19:47 +00:00
Evan Hunt f8275c30da Merge branch 'each-timeout-recovery' into 'main'
ensure read timeouts are recoverable

See merge request isc-projects/bind9!4930
2021-04-23 17:26:05 +00:00
Artem BoldarievandEvan Hunt 62033110b9 Use a constant for timeouts in soft-timeout tests
It makes it easier to change the value should the need arise.
2021-04-23 10:01:42 -07:00
Evan Hunt 7f367b0c7f use the correct handle when calling the read callback
when calling isc_nm_read() on an HTTP socket, the read callback
was being run with the incorrect handle. this has been corrected.
2021-04-23 10:01:42 -07:00
Evan Hunt f0d75ee7c3 fix DOH timeout recovery
as with TLS, the destruction of a client stream on failed read
needs to be conditional: if we reached failed_read_cb() as a
result of a timeout on a timer which has subsequently been
reset, the stream must not be closed.
2021-04-23 10:01:42 -07:00
Michał Kępień 47a7b042e5 Add CHANGES entry 2021-04-23 14:26:48 +02:00
Michał Kępień 24bf4b946a Test handling of non-apex RRSIG(SOA) RRsets
Add a check to the "dnssec" system test which ensures that RRSIG(SOA)
RRsets present anywhere else than at the zone apex are automatically
removed after a zone containing such RRsets is loaded.
2021-04-23 14:26:48 +02:00
Mark AndrewsandMichał Kępień b7cdc3583e Be more precise with the stopping conditions in zone_resigninc
If there happens to be a RRSIG(SOA) that is not at the zone apex
for any reason it should not be considered as a stopping condition
for incremental zone signing.
2021-04-23 14:26:48 +02:00
Evan Hunt b258df8562 add HTTP timeout recovery test
NOTE: this test currently fails
2021-04-22 12:40:04 -07:00
Evan Hunt 23ec011298 fix TLS timeout recovery
the destruction of the socket in tls_failed_read_cb() needs to be
conditional; if reached due to a timeout on a timer that has
subsequently been reset, the socket must not be destroyed.
2021-04-22 12:08:04 -07:00
Evan Hunt c90da99180 fix TCP timeout recovery
removed an unnecessary assert in the failed_read_cb() function.
also renamed to isc__nm_tcp_failed_read_cb() to match the practice
in other modules.
2021-04-22 12:08:04 -07:00
Evan Hunt 25ef0547a9 add TCP and TLS timeout recovery tests
NOTE: currently these tests fail
2021-04-22 12:08:04 -07:00
Evan Hunt 52f256f9ae add TCPDNS and TLSDNS timeout recovery tests
this is similar in structure to the UDP timeout recovery test.

this commit adds a new mechanism to the netmgr test allowing the
listen socket to accept incoming TCP connections but never send
a response. this forces the client to time out on read.
2021-04-22 12:08:04 -07:00
Evan Hunt bcf5b2a675 run read callbacks synchronously on timeout
when running read callbacks, if the event result is not ISC_R_SUCCESS,
the callback is always run asynchronously. this is a problem on timeout,
because there's no chance to reset the timer before the socket has
already been destroyed. this commit allows read callbacks to run
synchronously for both ISC_R_SUCCESS and ISC_R_TIMEDOUT result codes.
2021-04-22 12:08:04 -07:00
Evan Hunt 609975ad20 add a UDP timeout recovery test
this test sets up a server socket that listens for UDP connections
but never responds. the client will always time out; it should retry
five times before giving up.
2021-04-22 12:08:04 -07:00
Evan Hunt 1f41d59a5e allow client read callback to be assignable
allow netmgr client tests to choose the function that will be
used as a read callback, without having to write a different
connect callback handler.
2021-04-22 12:08:04 -07:00
Diego dos Santos Fronza 289d7c2acc Merge branch '2626-deadlock-with-concurrent-rndc-addzone-rndc-delzone-commands' into 'main'
Resolve "Deadlock with concurrent `rndc addzone`/`rndc delzone` commands"

Closes #2626

See merge request isc-projects/bind9!4904
2021-04-22 15:47:16 +00:00
Diego Fronza 6646655067 Add CHANGES note for GL #2626 2021-04-22 15:45:55 +00:00
Diego Fronza d6224035d8 Add system test for the deadlock fix
The test spawns 4 parallel workers that keep adding, modifying and
deleting zones, the main thread repeatedly checks wheter rndc
status responds within a reasonable period.

While environment and timing issues may affect the test, in most
test cases the deadlock that was taking place before the fix used to
trigger in less than 7 seconds in a machine with at least 2 cores.
2021-04-22 15:45:55 +00:00
Diego Fronza 9298dcebbd Fix deadlock between rndc addzone/delzone/modzone
It follows a description of the steps that were leading to the deadlock:

1. `do_addzone` calls `isc_task_beginexclusive`.

2. `isc_task_beginexclusive` waits for (N_WORKERS - 1) halted tasks,
   this blocks waiting for those (no. workers -1) workers to halt.
...
isc_task_beginexclusive(isc_task_t *task0) {
    ...
	while (manager->halted + 1 < manager->workers) {
		wake_all_queues(manager);
		WAIT(&manager->halt_cond, &manager->halt_lock);
	}
```

3. It is possible that in `task.c / dispatch()` a worker is running a
   task event, if that event blocks it will not allow this worker to
   halt.

4. `do_addzone` acquires `LOCK(&view->new_zone_lock);`,

5. `rmzone` event is called from some worker's `dispatch()`, `rmzone`
   blocks waiting for the same lock.

6. `do_addzone` calls `isc_task_beginexclusive`.

7. Deadlock triggered, since:
	- `rmzone` is wating for the lock.
	- `isc_task_beginexclusive` is waiting for (no. workers - 1) to
	   be halted
	- since `rmzone` event is blocked it won't allow the worker to halt.

To fix this, we updated do_addzone code to call isc_task_beginexclusive
before the lock is acquired, we postpone locking to the nearest required
place, same for isc_task_beginexclusive.

The same could happen with rndc modzone, so that was addressed as well.
2021-04-22 15:45:55 +00:00
Petr Špaček fa6b277b8d Merge branch '2634-test-tkey-gssapi-credential' into 'main'
Add tests for the "tkey-gssapi-credential" option

See merge request isc-projects/bind9!4905
2021-04-22 15:25:36 +00:00
Petr Špaček 1746d2e84a Add tests for the "tkey-gssapi-credential" option
Four named instances in the "nsupdate" system test have GSS-TSIG support
enabled.  All of them currently use "tkey-gssapi-keytab".  Configure two
of them with "tkey-gssapi-credential" to test that option.

As "tkey-gssapi-keytab" and "tkey-gssapi-credential" both provide the
same functionality, no test modifications are required.  The difference
between the two options is that the value of "tkey-gssapi-keytab" is an
explicit path to the keytab file to acquire credentials from, while the
value of "tkey-gssapi-credential" is the name of the principal whose
credentials should be used; those credentials are looked up in the
keytab file expected by the Kerberos library, i.e. /etc/krb5.keytab by
default.  The path to the default keytab file can be overridden using by
setting the KRB5_KTNAME environment variable.  Utilize that variable to
use existing keytab files with the "tkey-gssapi-credential" option.

The KRB5_KTNAME environment variable should not interfere with the
"tkey-gssapi-keytab" option.  Nevertheless, rename one of the keytab
files used with "tkey-gssapi-keytab" to something else than the contents
of the KRB5_KTNAME environment variable in order to make sure that both
"tkey-gssapi-keytab" and "tkey-gssapi-credential" are actually tested.
2021-04-22 16:15:22 +02:00
Ondřej Surý c38bcb6968 Merge branch 'ondrej/autoconf-2.71-fixes' into 'main'
Update the configure.ac for autoconf >= 2.71 compatibility

See merge request isc-projects/bind9!4899
2021-04-22 12:41:11 +00:00
Ondřej Surý f52872c3ed Update the configure.ac for autoconf >= 2.71 compatibility
This mostly removes stuff that's either deprecated, obsolete or not used
at all:

* Update the minimal autoconf version to 2.69
* AC_PROG_CC_C99 is deprecated, just use AC_PROG_CC as we require C11
  anyway
* AC_HEADER_TIME is deprecated, both <sys/time.h> and <time.h> can be
  included at the same time, and we don't use the macros that
  AC_HEADER_TIME defines anywhere
* AC_HEADER_STDC checks for ISO C90 and we require at least C11
* Replace AC_TRY_*([]) with AC_*_IFELSE([AC_LANG_PROGRAM()])
* Update m4/ax_check_openssl.m4 from serial 10 to serial 11
* Update m4/ax_gcc_func_attribute.m4 from serial 10 to serial 13
* Update m4/ax_pthread.m4 from serial 24 to serial 30
* Add early AC_CANONICAL_TARGET call to prevent warning from AX_PTHREAD
2021-04-22 13:52:40 +02:00
Mark Andrews fdf5184bf5 Merge branch '2625-the-shutdown-system-test-is-not-capturing-enough' into 'main'
Resolve "The shutdown system test is not capturing enough"

Closes #2625

See merge request isc-projects/bind9!4883
2021-04-22 06:47:21 +00:00
Mark Andrews c3c7f5849c Abort named if 'rndc stop' or 'kill TERM' has failed to shutdown 2021-04-22 05:43:00 +00:00
Ondřej Surý 60bf42b3e1 Merge branch '2638-run-internal-tasks-on-top-of-network-manager-worker-loops' into 'main'
Refactor taskmgr to run on top of netmgr

Closes #2638

See merge request isc-projects/bind9!4918
2021-04-20 22:16:42 +00:00
Ondřej SurýandOndřej Surý f022d2db8c Add CHANGES and release note for [GL #2638] 2021-04-20 23:22:28 +02:00
Ondřej SurýandOndřej Surý b540722bc3 Refactor taskmgr to run on top of netmgr
This commit changes the taskmgr to run the individual tasks on the
netmgr internal workers.  While an effort has been put into keeping the
taskmgr interface intact, couple of changes have been made:

 * The taskmgr has no concept of universal privileged mode - rather the
   tasks are either privileged or unprivileged (normal).  The privileged
   tasks are run as a first thing when the netmgr is unpaused.  There
   are now four different queues in in the netmgr:

   1. priority queue - netievent on the priority queue are run even when
      the taskmgr enter exclusive mode and netmgr is paused.  This is
      needed to properly start listening on the interfaces, free
      resources and resume.

   2. privileged task queue - only privileged tasks are queued here and
      this is the first queue that gets processed when network manager
      is unpaused using isc_nm_resume().  All netmgr workers need to
      clean the privileged task queue before they all proceed normal
      operation.  Both task queues are processed when the workers are
      finished.

   3. task queue - only (traditional) task are scheduled here and this
      queue along with privileged task queues are process when the
      netmgr workers are finishing.  This is needed to process the task
      shutdown events.

   4. normal queue - this is the queue with netmgr events, e.g. reading,
      sending, callbacks and pretty much everything is processed here.

 * The isc_taskmgr_create() now requires initialized netmgr (isc_nm_t)
   object.

 * The isc_nm_destroy() function now waits for indefinite time, but it
   will print out the active objects when in tracing mode
   (-DNETMGR_TRACE=1 and -DNETMGR_TRACE_VERBOSE=1), the netmgr has been
   made a little bit more asynchronous and it might take longer time to
   shutdown all the active networking connections.

 * Previously, the isc_nm_stoplistening() was a synchronous operation.
   This has been changed and the isc_nm_stoplistening() just schedules
   the child sockets to stop listening and exits.  This was needed to
   prevent a deadlock as the the (traditional) tasks are now executed on
   the netmgr threads.

 * The socket selection logic in isc__nm_udp_send() was flawed, but
   fortunatelly, it was broken, so we never hit the problem where we
   created uvreq_t on a socket from nmhandle_t, but then a different
   socket could be picked up and then we were trying to run the send
   callback on a socket that had different threadid than currently
   running.
2021-04-20 23:22:28 +02:00
Ondřej Surý ae9edb1861 Merge branch '2630-tsan-error-in-xfrin-c' into 'main'
Prevent the double xfrin_fail() call

Closes #2630

See merge request isc-projects/bind9!4898
2021-04-20 12:13:35 +00:00
Ondřej Surý 30252aed88 Add CHANGES note for [GL #2630] 2021-04-20 14:12:26 +02:00
Ondřej Surý 6cf6de55bc Prevent the double xfrin_fail() call
When we are reading from the xfrin socket, and the transfer would be
shutdown, the shutdown function would call `xfrin_fail()` which in turns
calls `xfrin_cancelio()` that causes the read callback to be invoked
with `ISC_R_CANCELED` status code and that caused yet another
`xfrin_fail()` call.

The fix here is to ensure the `xfrin_fail()` would be run only once
properly using better synchronization on xfr->shuttingdown flag.
2021-04-20 14:12:26 +02:00
Ondřej Surý 27960e4208 Merge branch '2637-threadsanitizer-lock-order-inversion-potential-deadlock-in-zone_refreshkeys' into 'main'
Fix lock-order-inversion (potential deadlock) in dns_resolver_createfetch

Closes #2637

See merge request isc-projects/bind9!4909
2021-04-19 20:29:56 +00:00
Ondřej Surý 25d27851d8 Fix lock-order-inversion (potential deadlock) in dns_resolver_createfetch
There's a lock-order-inversion when running `zone_maintenance()` from
the timer while shutting down the server `shutdown_server()`.  This only
happens when the taskmgr scheduling is more relaxed and paralellized,
but the issue is real nevertheless.

The associated ThreadSanitizer warning:

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
      Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000000) => M1

      Mutex M2 acquired here while holding mutex M1 in thread T1:
	#0 pthread_mutex_lock <null>
	#1 dns_view_findzonecut lib/dns/view.c:1326:2
	#2 fctx_create lib/dns/resolver.c:5144:13
	#3 dns_resolver_createfetch lib/dns/resolver.c:10977:12
	#4 zone_refreshkeys lib/dns/zone.c:10830:13
	#5 zone_maintenance lib/dns/zone.c:11065:5
	#6 zone_timer lib/dns/zone.c:14652:2
	#7 task_run lib/isc/task.c:857:5
	#8 isc_task_run lib/isc/task.c:944:10
	#9 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#10 process_netievent lib/isc/netmgr/netmgr.c
	#11 process_queue lib/isc/netmgr/netmgr.c:885:8
	#12 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#13 process_queues lib/isc/netmgr/netmgr.c:772:7
	#14 async_cb lib/isc/netmgr/netmgr.c:671:2
	#15 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#16 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#17 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#18 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#19 isc__trampoline_run lib/isc/trampoline.c:184:11

      Mutex M1 previously acquired by the same thread here:
	#0 pthread_mutex_lock <null>
	#1 zone_refreshkeys lib/dns/zone.c:10717:2
	#2 zone_maintenance lib/dns/zone.c:11065:5
	#3 zone_timer lib/dns/zone.c:14652:2
	#4 task_run lib/isc/task.c:857:5
	#5 isc_task_run lib/isc/task.c:944:10
	#6 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#7 process_netievent lib/isc/netmgr/netmgr.c
	#8 process_queue lib/isc/netmgr/netmgr.c:885:8
	#9 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#10 process_queues lib/isc/netmgr/netmgr.c:772:7
	#11 async_cb lib/isc/netmgr/netmgr.c:671:2
	#12 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#13 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#14 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#15 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#16 isc__trampoline_run lib/isc/trampoline.c:184:11

      Mutex M1 acquired here while holding mutex M2 in thread T2:
	#0 pthread_mutex_lock <null>
	#1 dns_zone_flush lib/dns/zone.c:11443:2
	#2 view_flushanddetach lib/dns/view.c:657:5
	#3 dns_view_flushanddetach lib/dns/view.c:690:2
	#4 shutdown_server bin/named/server.c:10056:4
	#5 task_run lib/isc/task.c:857:5
	#6 isc_task_run lib/isc/task.c:944:10
	#7 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#8 process_netievent lib/isc/netmgr/netmgr.c
	#9 process_queue lib/isc/netmgr/netmgr.c:885:8
	#10 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#11 process_queues lib/isc/netmgr/netmgr.c:772:7
	#12 async_cb lib/isc/netmgr/netmgr.c:671:2
	#13 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#14 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#15 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#16 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#17 isc__trampoline_run lib/isc/trampoline.c:184:11

      Mutex M2 previously acquired by the same thread here:
	#0 pthread_mutex_lock <null>
	#1 view_flushanddetach lib/dns/view.c:645:3
	#2 dns_view_flushanddetach lib/dns/view.c:690:2
	#3 shutdown_server bin/named/server.c:10056:4
	#4 task_run lib/isc/task.c:857:5
	#5 isc_task_run lib/isc/task.c:944:10
	#6 isc__nm_async_task lib/isc/netmgr/netmgr.c:730:24
	#7 process_netievent lib/isc/netmgr/netmgr.c
	#8 process_queue lib/isc/netmgr/netmgr.c:885:8
	#9 process_tasks_queue lib/isc/netmgr/netmgr.c:756:10
	#10 process_queues lib/isc/netmgr/netmgr.c:772:7
	#11 async_cb lib/isc/netmgr/netmgr.c:671:2
	#12 uv__async_io /home/ondrej/Projects/tsan/libuv/src/unix/async.c:163:5
	#13 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:462:11
	#14 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:392:5
	#15 nm_thread lib/isc/netmgr/netmgr.c:597:11
	#16 isc__trampoline_run lib/isc/trampoline.c:184:11

      Thread T2 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:79:8
	#2 isc_nm_start lib/isc/netmgr/netmgr.c:303:3
	#3 create_managers bin/named/main.c:957:15
	#4 setup bin/named/main.c:1267:11
	#5 main bin/named/main.c:1558:2

      Thread T2 (running) created by main thread at:
	#0 pthread_create <null>
	#1 isc_thread_create lib/isc/pthreads/thread.c:79:8
	#2 isc_nm_start lib/isc/netmgr/netmgr.c:303:3
	#3 create_managers bin/named/main.c:957:15
	#4 setup bin/named/main.c:1267:11
	#5 main bin/named/main.c:1558:2

    SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in __interceptor_pthread_mutex_lock
2021-04-19 22:29:14 +02:00
Ondřej Surý 3f0c8189e7 Merge branch 'ondrej/cleanup-ISCAPI-remnants' into 'main'
Cleanup the public vs private ISCAPI remnants

See merge request isc-projects/bind9!4911
2021-04-19 11:48:14 +00:00
Ondřej SurýandOndřej Surý 16fe0d1f41 Cleanup the public vs private ISCAPI remnants
Since all the libraries are internal now, just cleanup the ISCAPI remnants
in isc_socket, isc_task and isc_timer APIs.  This means, there's one less
layer as following changes have been done:

 * struct isc_socket and struct isc_socketmgr have been removed
 * struct isc__socket and struct isc__socketmgr have been renamed
   to struct isc_socket and struct isc_socketmgr
 * struct isc_task and struct isc_taskmgr have been removed
 * struct isc__task and struct isc__taskmgr have been renamed
   to struct isc_task and struct isc_taskmgr
 * struct isc_timer and struct isc_timermgr have been removed
 * struct isc__timer and struct isc__timermgr have been renamed
   to struct isc_timer and struct isc_timermgr
 * All the associated code that dealt with typing isc_<foo>
   to isc__<foo> and back has been removed.
2021-04-19 13:18:24 +02:00
Ondřej Surý 5937c1f787 Merge branch 'ondrej/fixup-bin/tests/system/resolve-win32-directories' into 'main'
Fixup win32 paths for moved bin/tests/system/resolve

See merge request isc-projects/bind9!4916
2021-04-19 11:15:12 +00:00
Ondřej Surý f14e678624 Fixup win32 paths for moved bin/tests/system/resolve
When resolve.c was moved from lib/samples to bin/tests/system, the
resolve.vcxproj.in would still contain old paths to the directory
root. This commit adds one more ..\ to match the directory depth.

Additionally, fixup the path in BINDInstall.vcxproj.in to be
bin/tests/system and not bin/tests/samples.
2021-04-19 12:51:33 +02:00
Ondřej Surý 11d3c475bd Merge branch '2636-timing-race-in-setnsec3param-task' into 'main'
Fix task timing race in setnsec3param()

Closes #2636

See merge request isc-projects/bind9!4908
2021-04-19 09:22:31 +00:00
Ondřej Surý 0127ba6472 Fix task timing race in setnsec3param()
When setnsec3param() is schedule from zone_postload() there's no
guarantee that `zone->db` is not `NULL` yet.  Thus when the
setnsec3param() is called, we need to check for `zone->db` existence and
reschedule the task, because calling `rss_post()` on a zone with empty
`.db` ends up with no-op (the function just returns).
2021-04-19 11:16:51 +02:00
Ondřej Surý c216ace42a Merge branch 'ondrej/cleanup-double-createinctx-constructors' into 'main'
Cleanup the isc_<*>mgr_createinc() constructors

See merge request isc-projects/bind9!4910
2021-04-19 08:26:32 +00:00
Ondřej Surý 3388ef36b3 Cleanup the isc_<*>mgr_createinc() constructors
Previously, the taskmgr, timermgr and socketmgr had a constructor
variant, that would create the mgr on top of existing appctx.  This was
no longer true and isc_<*>mgr was just calling isc_<*>mgr_create()
directly without any extra code.

This commit just cleans up the extra function.
2021-04-19 10:22:56 +02:00
Mark Andrews eb32677de5 Merge branch 'marka-initialise-resarg-lock' into 'main'
properly initialise resarg->lock

See merge request isc-projects/bind9!4907
2021-04-19 04:59:39 +00:00
Mark Andrews eadb829dac properly initialise resarg->lock 2021-04-19 14:32:40 +10:00
Ondřej Surý 48c703e3d6 Merge branch 'each-cleanup-dns_client' into 'main'
clean up dns_client and related samples

See merge request isc-projects/bind9!4835
2021-04-16 13:35:44 +00:00
Evan HuntandOndřej Surý 07e349de3c Add CHANGES note for [GL !4835] 2021-04-16 14:31:10 +02:00
Evan HuntandOndřej Surý d0ec7d1f33 move samples/resolve.c to bin/tests/system
"resolve" is used by the resolver system tests, and I'm not
certain whether delv exercises the same code, so rather than
remove it, I moved it to bin/tests/system.
2021-04-16 14:29:43 +02:00
Evan HuntandOndřej Surý 056afe7bdc remove sample-async
sample code for export libraries is no longer needed and
this code is not used for any internal tests. also, sample-gai.c
had already been removed but there were some dangling references.
2021-04-16 14:29:43 +02:00
Evan HuntandOndřej Surý 568d455c99 rename dns_client_createx() to dns_client_create()
there's no longer a need to use an alternate name.
2021-04-16 14:29:43 +02:00
Evan HuntandOndřej Surý 1beb05f3e2 remove dns_client_request() and related code
continues the cleanup of dns_client started in the previous commit.
2021-04-16 14:29:43 +02:00
Evan HuntandOndřej Surý fb2a352e7c remove dns_client_update() and related code
the libdns client API is no longer being maintained for
external use, we can remove the code that isn't being used
internally, as well as the related tests.
2021-04-16 14:29:43 +02:00
Michał Kępień 409883adbd Merge branch '2634-placeholder' into 'main'
Add placeholder for GL #2634

See merge request isc-projects/bind9!4901
2021-04-16 12:20:37 +00:00
Michał Kępień cd91f1c189 Add placeholder for GL #2634 2021-04-16 14:16:57 +02:00
Ondřej Surý 1ab099aa3b Merge branch '2623-9-16-13-overwrites-master-files-if-old-format-jnl-files-are-present' into 'main'
Resolve "9.16.13 overwrites master files if old format .jnl files are present"

Closes #2623

See merge request isc-projects/bind9!4880
2021-04-16 11:12:19 +00:00
Mark AndrewsandOndřej Surý 3df637fb83 Add CHANGES and release note for [GL #2623] 2021-04-16 12:04:06 +02:00
Ondřej Surý 55b942b4a0 Refactor dns_journal_rollforward() to work over opened journal
Too much logic was cramped inside the dns_journal_rollforward() that
made it harder to follow.  The dns_journal_rollforward() was refactored
to work over already opened journal and some of the previous logic was
moved to new static zone_journal_rollforward() that separates the
journal "rollforward" logic from the "zone" logic.
2021-04-16 12:04:06 +02:00
Mark AndrewsandOndřej Surý ec7a9af381 Fixing a recoverable journal should not result in the zone being written
when dns_journal_rollforward returned ISC_R_RECOVERABLE the distintion
between 'up to date' and 'success' was lost, as a consequence
zone_needdump() was called writing out the zone file when it shouldn't
have been.   This change restores that distintion.  Adjust system
test to reflect visible changes.
2021-04-16 11:15:46 +02:00
Artem Boldariev 10ba2a40e2 Merge branch 'artem/move-tls-tests-into-netmgr-tests' into 'main'
Merge the tls_test.c into netmgr_test.c and extend the tests suite

See merge request isc-projects/bind9!4893
2021-04-15 14:03:14 +00:00
Artem Boldariev 66432dcd65 Handle a situation when SSL shutdown messages were sent and received
It fixes a corner case which was causing dig to print annoying
messages like:

14-Apr-2021 18:48:37.099 SSL error in BIO: 1 TLS error (errno:
0). Arguments: received_data: (nil), send_data: (nil), finish: false

even when all the data was properly processed.
2021-04-15 15:49:36 +03:00
Artem Boldariev 513cdb52ec TLS: try to close TCP socket descriptor earlier when possible
Before this fix underlying TCP sockets could remain opened for longer
than it is actually required, causing unit tests to fail with lots of
ISC_R_TOOMANYOPENFILES errors.

The change also enables graceful SSL shutdown (before that it  would
happen only in the case when isc_nm_cancelread() were called).
2021-04-15 15:49:36 +03:00
Ondřej SurýandArtem Boldariev 202b1d372d Merge the tls_test.c into netmgr_test.c and extend the tests suite
This commit merges TLS tests into the common Network Manager unit
tests suite and extends the unit test framework to include support for
additional "ping-pong" style tests where all data could be sent via
lesser number of connections (the behaviour of the old test
suite). The tests for TCP and TLS were extended to make use of the new
mode, as this mode better translates to how the code is used in DoH.

Both TLS and TCP tests now share most of the unit tests' code, as they
are expected to function similarly from a users's perspective anyway.

Additionally to the above, the TLS test suite was extended to include
TLS tests using the connections quota facility.
2021-04-15 15:49:36 +03:00
Matthijs Mekking 2aad659550 Merge branch 'matthijs-keymgr2kasp-rework' into 'main'
Update keymgr2kasp system test

Closes #2631

See merge request isc-projects/bind9!4894
2021-04-15 12:45:25 +00:00
Matthijs Mekking 0de5a576c5 Fix view-related issues in the "keymgr2kasp" test
Due to the lack of "match-clients" clauses in ns4/named2.conf.in, the
same view is incorrectly chosen for all queries received by ns4 in the
"keymgr2kasp" system test.  This causes only one version of the
"view-rsasha256.kasp" zone to actually be checked.  Add "match-clients"
clauses to ns4/named2.conf.in to ensure the test really checks what it
claims to.

Use identical view names ("ext", "int") in ns4/named.conf.in and
ns4/named2.conf.in so that it is easier to quickly identify the
differences between these two files.

Update tests.sh to account for the above changes.  Also fix a copy-paste
error in a comment to prevent confusion.
2021-04-15 10:05:52 +02:00
Matthijs Mekking ee02453a2e Merge branch '1100-inline-signing-include' into 'main'
Resolve "Test inline-signing with $INCLUDE"

Closes #1100

See merge request isc-projects/bind9!4825
2021-04-14 09:35:35 +00:00
Matthijs Mekking bad5c3cf7c Document relative path of $INCLUDE
Add to the ARM from where relative paths are searched.
2021-04-14 10:04:40 +02:00
Matthijs Mekking 96583e7c40 Fix inline test with missing $INCLUDE
The test case for a zone with a missing include file was wrong for two
reasons:
1. It was loading the wrong file (master5 instead of master6)
2. It did actually not set the $ret variable to 1 if the test failed
   (it should default to ret=1 and clear the variable if the
   appropriate log is found).
2021-04-14 10:04:40 +02:00
Matthijs Mekking 6463ee0f40 Add inline-signing with $INCLUDE test
Add a test case for inline-signing for a zone with an $INCLUDE
statement. There is already a test for a missing include file, this
one adds a test for a zone with an include file that does exist.

Test if the record in the included file is loaded.
2021-04-14 10:04:40 +02:00
Matthijs Mekking bb01030252 Merge branch '2347-draft-vandijk-dnsop-nsec-ttl' into 'main'
Implement draft-vandijk-dnsop-nsec-ttl

Closes #2347

See merge request isc-projects/bind9!4506
2021-04-13 12:14:53 +00:00
Matthijs Mekking 8fcbef2423 Small refactor lib/dns/zone.c
Introduce some macros that can be reused in 'zone_load_soa_rr()' and
'zone_get_from_db()' to make those functions more readable.
2021-04-13 11:26:26 +02:00
Matthijs Mekking 032110bd2e Use designated initializer in dns_zone_create
Shorten the code and make it less prone to initialisation errors
(it is still easy to forget adding an initializer, but it now defaults
to 0).
2021-04-13 11:26:26 +02:00
Matthijs Mekking 3b68dd426f Add change entry and release note for [#2347] 2021-04-13 11:26:26 +02:00
Matthijs Mekking 9af8caa733 Implement draft-vandijk-dnsop-nsec-ttl
The draft says that the NSEC(3) TTL must have the same TTL value
as the minimum of the SOA MINIMUM field and the SOA TTL. This was
always the intended behaviour.

Update the zone structure to also track the SOA TTL. Whenever we
use the MINIMUM value to determine the NSEC(3) TTL, use the minimum
of MINIMUM and SOA TTL instead.

There is no specific test for this, however two tests need adjusting
because otherwise they failed: They were testing for NSEC3 records
including the TTL. Update these checks to use 600 (the SOA TTL),
rather than 3600 (the SOA MINIMUM).
2021-04-13 11:26:26 +02:00
Matthijs Mekking 8ffb4b0a13 Merge branch '2289-cache-dump-stale-ttl-weird-values' into 'main'
Fix nonsensical stale TTL values in cache dump

Closes #2289

See merge request isc-projects/bind9!4799
2021-04-13 08:54:49 +00:00
Matthijs Mekking a83c8cb0af Use stale TTL as RRset TTL in dumpdb
It is more intuitive to have the countdown 'max-stale-ttl' as the
RRset TTL, instead of 0 TTL. This information was already available
in a comment "; stale (will be retained for x more seconds", but
Support suggested to put it in the TTL field instead.
2021-04-13 09:48:20 +02:00
Matthijs Mekking debee6157b Check staleness in bind_rdataset
Before binding an RRset, check the time and see if this record is
stale (or perhaps even ancient). Marking a header stale or ancient
happens only when looking up an RRset in cache, but binding an RRset
can also happen on other occasions (for example when dumping the
database).

Check the time and compare it to the header. If according to the
time the entry is stale, but not ancient, set the STALE attribute.
If according to the time is ancient, set the ANCIENT attribute.

We could mark the header stale or ancient here, but that requires
locking, so that's why we only compare the current time against
the rdh_ttl.

Adjust the test to check the dump-db before querying for data. In the
dumped file the entry should be marked as stale, despite no cache
lookup happened since the initial query.
2021-04-13 09:48:20 +02:00
Matthijs Mekking 2a5e0232ed Fix nonsensical stale TTL values in cache dump
When introducing change 5149, "rndc dumpdb" started to print a line
above a stale RRset, indicating how long the data will be retained.

At that time, I thought it should also be possible to load
a cache from file. But if a TTL has a value of 0 (because it is stale),
stale entries wouldn't be loaded from file. So, I added the
'max-stale-ttl' to TTL values, and adjusted the $DATE accordingly.

Since we actually don't have a "load cache from file" feature, this
is premature and is causing confusion at operators. This commit
changes the 'max-stale-ttl' adjustments.

A check in the serve-stale system test is added for a non-stale
RRset (longttl.example) to make sure the TTL in cache is sensible.

Also, the comment above stale RRsets could have nonsensical
values. A possible reason why this may happen is when the RRset was
marked a stale but the 'max-stale-ttl' has passed (and is actually an
RRset awaiting cleanup). This would lead to the "will be retained"
value to be negative (but since it is stored in an uint32_t, you would
get a nonsensical value (e.g. 4294362497).

To mitigate against this, we now also check if the header is not
ancient. In addition we check if the stale_ttl would be negative, and
if so we set it to 0. Most likely this will not happen because the
header would already have been marked ancient, but there is a possible
race condition where the 'rdh_ttl + serve_stale_ttl' has passed,
but the header has not been checked for staleness.
2021-04-13 09:48:20 +02:00
Mark Andrews 1941ce99d4 Merge branch '2622-command-line-option-l-not-shown-with-usage-message' into 'main'
Resolve "Command-line option -L not shown with usage message"

Closes #2622

See merge request isc-projects/bind9!4881
2021-04-13 01:33:28 +00:00
Mark Andrews 38449de93b Update named's usage description 2021-04-12 12:07:44 +10:00
Michał Kępień b64af491bf Merge branch 'michal/add-placeholder-entries-to-CHANGES' into 'main'
Add placeholders for GL #2467, GL #2540, GL #2604

See merge request isc-projects/bind9!4878
2021-04-08 11:10:54 +00:00
Michał Kępień 0874242db6 Add placeholders for GL #2467, GL #2540, GL #2604 2021-04-08 13:06:57 +02:00
Michał Kępień b517108cbc Merge branch '2578-rework-get_ports.sh-to-make-it-not-use-a-lock-file' into 'main'
Rework get_ports.sh to make it not use a lock file

Closes #2578

See merge request isc-projects/bind9!4801
2021-04-08 09:37:51 +00:00
Michał Kępień c3718b926b Use the same port selection method on all systems
When system tests are run on Windows, they are assigned port ranges that
are 100 ports wide and start from port number 5000.  This is a different
port assignment method than the one used on Unix systems.  Drop the "-p"
command line option from bin/tests/system/run.sh invocations used for
starting system tests on Windows to unify the port assignment method
used across all operating systems.
2021-04-08 11:12:37 +02:00
Michał Kępień 31e5ca4bd9 Rework get_ports.sh to make it not use a lock file
The get_ports.sh script is used for determining the range of ports a
given system test should use.  It first determines the start of the port
range to return (the base port); it can either be specified explicitly
by the caller or chosen randomly.  Subsequent ports are picked
sequentially, starting from the base port.  To ensure no single port is
used by multiple tests, a state file (get_ports.state) containing the
last assigned port is maintained by the script.  Concurrent access to
the state file is protected by a lock file (get_ports.lock); if one
instance of the script holds the lock file while another instance tries
to acquire it, the latter retries its attempt to acquire the lock file
after sleeping for 1 second; this retry process can be repeated up to 10
times before the script returns an error.

There are some problems with this approach:

  - the sleep period in case of failure to acquire the lock file is
    fixed, which leads to a "thundering herd" type of problem, where
    (depending on how processes are scheduled by the operating system)
    multiple system tests try to acquire the lock file at the same time
    and subsequently sleep for 1 second, only for the same situation to
    likely happen the next time around,

  - the lock file is being locked and then unlocked for every single
    port assignment made, not just once for the entire range of ports a
    system test should use; in other words, the lock file is currently
    locked and unlocked 13 times per system test; this increases the
    odds of the "thundering herd" problem described above preventing a
    system test from getting one or more ports assigned before the
    maximum retry count is reached (assuming multiple system tests are
    run in parallel); it also enables the range of ports used by a given
    system test to be non-sequential (which is a rather cosmetic issue,
    but one that can make log interpretation harder than necessary when
    test failures are diagnosed),

  - both issues described above cause unnecessary delays when multiple
    system tests are started in parallel (due to high lock file
    contention among the system tests being started),

  - maintaining a state file requires ensuring proper locking, which
    complicates the script's source code.

Rework the get_ports.sh script so that it assigns non-overlapping port
ranges to its callers without using a state file or a lock file:

  - add a new command line switch, "-t", which takes the name of the
    system test to assign ports for,

  - ensure every instance of get_ports.sh knows how many ports all
    system tests which form the test suite are going to need in total
    (based on the number of subdirectories found in bin/tests/system/),

  - in order to ensure all instances of get_ports.sh work on the same
    global port range (so that no port range collisions happen), a
    stable (throughout the expected run time of a single system test
    suite) base port selection method is used instead of the random one;
    specifically, the base port, unless specified explicitly using the
    "-p" command line switch, is derived from the number of hours which
    passed since the Unix Epoch time,

  - use the name of the system test to assign ports for (passed via the
    new "-t" command line switch) as a unique index into the global
    system test range, to ensure all system tests use disjoint port
    ranges.
2021-04-08 11:12:37 +02:00
Michal Nowak a2484f2673 Merge branch 'mnowak/fix-missing-fromhex.pl-in-out-of-tree' into 'main'
Move fromhex.pl script to bin/tests/system/

See merge request isc-projects/bind9!4875
2021-04-08 09:07:07 +00:00
Michal Nowak cd0a34df1b Move fromhex.pl script to bin/tests/system/
The fromhex.pl script needs to be copied from the source directory to
the build directory before any test is run, otherwise the out-of-tree
fails to find it. Given that the script is used only in system test,
move it to bin/tests/system/.
2021-04-08 11:04:26 +02:00
Michał Kępień e01b3ccfaa Merge branch '2620-free-resources-when-gss_accept_sec_context-fails' into 'main'
Free resources when gss_accept_sec_context() fails

Closes #2620

See merge request isc-projects/bind9!4873
2021-04-08 08:40:27 +00:00
Michał Kępień 7eb87270a4 Add CHANGES entry 2021-04-08 10:33:44 +02:00
Michał Kępień d954e152d9 Free resources when gss_accept_sec_context() fails
Even if a call to gss_accept_sec_context() fails, it might still cause a
GSS-API response token to be allocated and left for the caller to
release.  Make sure the token is released before an early return from
dst_gssapi_acceptctx().
2021-04-08 10:33:44 +02:00
Ondřej Surý 3c5267cc5c Merge branch '2600-general-error-managed-keys-zone-dns_journal_compact-failed-no-more' into 'main'
Resolve "general: error: managed-keys-zone: dns_journal_compact failed: no more"

Closes #2600

See merge request isc-projects/bind9!4849
2021-04-07 19:28:39 +00:00
Mark AndrewsandOndřej Surý 0174098aca Add CHANGES and release note for [GL #2600] 2021-04-07 21:02:10 +02:00
Mark AndrewsandOndřej Surý bb6f0faeed Check that upgrade of managed-keys.bind.jnl succeeded
Update the system to include a recoverable managed.keys journal created
with <size,serial0,serial1,0> transactions and test that it has been
updated as part of the start up process.
2021-04-07 20:27:22 +02:00
Mark AndrewsandOndřej Surý 0fbdf189c7 Rewrite managed-key journal immediately
Both managed keys and regular zone journals need to be updated
immediately when a recoverable error is discovered.
2021-04-07 20:23:46 +02:00
Mark AndrewsandOndřej Surý 83310ffd92 Update dns_journal_compact() to handle bad transaction headers
Previously, dns_journal_begin_transaction() could reserve the wrong
amount of space.  We now check that the transaction is internally
consistent when upgrading / downgrading a journal and we also handle the
bad transaction headers.
2021-04-07 20:23:46 +02:00
Mark AndrewsandOndřej Surý 520509ac7e Compute transaction size based on journal/transaction type
previously the code assumed that it was a new transaction.
2021-04-07 20:20:57 +02:00
Mark AndrewsandOndřej Surý 5a6112ec8f Use journal_write_xhdr() to write the dummy transaction header
Instead of journal_write(), use correct format call journal_write_xhdr()
to write the dummy transaction header which looks at j->header_ver1 to
determine which transaction header to write instead of always writing a
zero filled journal_rawxhdr_t header.
2021-04-07 20:18:44 +02:00
Ondřej Surý 81c5f5e6a8 Merge branch '2401-ISC_R_TIMEDOUT-is-recoverable' into 'main'
netmgr: Make it possible to recover from ISC_R_TIMEDOUT

Closes #2401

See merge request isc-projects/bind9!4845
2021-04-07 14:34:46 +00:00
Evan HuntandOndřej Surý 5496e51a80 Add CHANGES note for GL #2401 2021-04-07 15:38:16 +02:00
Artem BoldarievandOndřej Surý 8da12738f1 Use T_CONNECT timeout constant for TCP tests (instead of 1 ms)
The netmgr_test would be failing on heavily loaded systems because the
connection timeout was set to 1 ms.  Use the global constant instead.
2021-04-07 15:37:10 +02:00
Evan HuntandOndřej Surý d2ea8f4245 Ensure dig lookup is detached on UDP connect failure
dig could hang when UDP connect failed due to a dangling lookup object.
2021-04-07 15:36:59 +02:00
Ondřej Surý 72ef5f465d Refactor async callbacks and fix the double tlsdnsconnect callback
The isc_nm_tlsdnsconnect() call could end up with two connect callbacks
called when the timeout fired and the TCP connection was aborted,
but the TLS handshake was not complete yet.  isc__nm_connecttimeout_cb()
forgot to clean up sock->tls.pending_req when the connect callback was
called with ISC_R_TIMEDOUT, leading to a second callback running later.

A new argument has been added to the isc__nm_*_failed_connect_cb and
isc__nm_*_failed_read_cb functions, to indicate whether the callback
needs to run asynchronously or not.
2021-04-07 15:36:59 +02:00
Ondřej Surý 58e75e3ce5 Skip long tls_tests in the CI
We already skip most of the recv_send tests in CI because they are
too timing-related to be run in overloaded environment.  This commit
adds a similar change to tls_test before we merge tls_test into
netmgr_test.
2021-04-07 15:36:59 +02:00
Artem BoldarievandOndřej Surý 340235c855 Prevent short TLS tests from hanging in case of errors
The tests in tls_test.c could hang in the event of a connect
error.  This commit allows the tests to bail out when such an
error occurs.
2021-04-07 15:36:59 +02:00
Evan HuntandOndřej Surý 426c40c96d rearrange nm_teardown() to check correctness after shutting down
if a test failed at the beginning of nm_teardown(), the function
would abort before isc_nm_destroy() or isc_tlsctx_free() were reached;
we would then abort when nm_setup() was run for the next test case.
rearranging the teardown function prevents this problem.
2021-04-07 15:36:59 +02:00
Ondřej Surý 86f4872dd6 isc_nm_*connect() always return via callback
The isc_nm_*connect() functions were refactored to always return the
connection status via the connect callback instead of sometimes returning
the hard failure directly (for example, when the socket could not be
created, or when the network manager was shutting down).

This commit changes the connect functions in all the network manager
modules, and also makes the necessary refactoring changes in places
where the connect functions are called.
2021-04-07 15:36:59 +02:00
Evan HuntandOndřej Surý a70cd026df move UDP connect retries from dig into isc_nm_udpconnect()
dig previously ran isc_nm_udpconnect() three times before giving
up, to work around a freebsd bug that caused connect() to return
a spurious transient EADDRINUSE. this commit moves the retry code
into the network manager itself, so that isc_nm_udpconnect() no
longer needs to return a result code.
2021-04-07 15:36:59 +02:00
Ondřej Surý ca12e25bb0 Use generic functions for reading and timers in TCP
The TCP module has been updated to use the generic functions from
netmgr.c instead of its own local copies.  This brings the module
mostly up to par with the TCPDNS and TLSDNS modules.
2021-04-07 15:36:59 +02:00
Ondřej Surý 7df8c7061c Fix and clean up handling of connect callbacks
Serveral problems were discovered and fixed after the change in
the connection timeout in the previous commits:

  * In TLSDNS, the connection callback was not called at all under some
    circumstances when the TCP connection had been established, but the
    TLS handshake hadn't been completed yet.  Additional checks have
    been put in place so that tls_cycle() will end early when the
    nmsocket is invalidated by the isc__nm_tlsdns_shutdown() call.

  * In TCP, TCPDNS and TLSDNS, new connections would be established
    even when the network manager was shutting down.  The new
    call isc__nm_closing() has been added and is used to bail out
    early even before uv_tcp_connect() is attempted.
2021-04-07 15:36:59 +02:00
Ondřej Surý 5a87c7372c Make it possible to recover from connect timeouts
Similarly to the read timeout, it's now possible to recover from
ISC_R_TIMEDOUT event by restarting the timer from the connect callback.

The change here also fixes platforms that missing the socket() options
to set the TCP connection timeout, by moving the timeout code into user
space.  On platforms that support setting the connect timeout via a
socket option, the timeout has been hardcoded to 2 minutes (the maximum
value of tcp-initial-timeout).
2021-04-07 15:36:58 +02:00
Ondřej SurýandOndřej Surý 33c00c281f Make it possible to recover from read timeouts
Previously, when the client timed out on read, the client socket would
be automatically closed and destroyed when the nmhandle was detached.
This commit changes the logic so that it's possible for the callback to
recover from the ISC_R_TIMEDOUT event by restarting the timer. This is
done by calling isc_nmhandle_settimeout(), which prevents the timeout
handling code from destroying the socket; instead, it continues to wait
for data.

One specific use case for multiple timeouts is serve-stale - the client
socket could be created with shorter timeout (as specified with
stale-answer-client-timeout), so we can serve the requestor with stale
answer, but keep the original query running for a longer time.
2021-04-07 15:36:58 +02:00
Ondřej Surý 0aad979175 Disable netmgr tests only when running under CI
The full netmgr test suite is unstable when run in CI due to various
timing issues.  Previously, we enabled the full test suite only when
CI_ENABLE_ALL_TESTS environment variable was set, but that went against
original intent of running the full suite when an individual developer
would run it locally.

This change disables the full test suite only when running in the CI and
the CI_ENABLE_ALL_TESTS is not set.
2021-04-07 15:36:58 +02:00
Matthijs Mekking ad25ca8bc6 Merge branch '2608-stale-answer-client-timeout-default-off' into 'main'
Change default stale-answer-client-timeout to off

Closes #2608

See merge request isc-projects/bind9!4862
2021-04-07 12:45:48 +00:00
Matthijs Mekking e443279bbf Change default stale-answer-client-timeout to off
Using "stale-answer-client-timeout" turns out to have unforeseen
negative consequences, and thus it is better to disable the feature
by default for the time being.
2021-04-07 14:10:31 +02:00
Diego dos Santos Fronza e8313d91ea Merge branch '2582-threadsanitizer-data-race-lib-dns-zone-c-10272-7-in-zone_maintenance' into 'main'
Resolve "ThreadSanitizer: data race lib/dns/zone.c:10272:7 in zone_maintenance"

Closes #2582

See merge request isc-projects/bind9!4864
2021-04-07 12:05:05 +00:00
Diego Fronza 6e08307bc8 Resolve TSAN data race in zone_maintenance
Fix race between zone_maintenance and dns_zone_notifyreceive functions,
zone_maintenance was attempting to read a zone flag calling
DNS_ZONE_FLAG(zone, flag) while dns_zone_notifyreceive was updating
a flag in the same zone calling DNS_ZONE_SETFLAG(zone, ...).

The code reading the flag in zone_maintenance was not protected by the
zone's lock, to avoid a race the zone's lock is now being acquired
before an attempt to read the zone flag is made.
2021-04-07 12:04:01 +00:00
Michał Kępień 2e5a6ab7fc Merge branch '2579-enforce-a-run-time-limit-on-unit-test-binaries' into 'main'
Enforce a run time limit on unit test binaries

Closes #2579

See merge request isc-projects/bind9!4802
2021-04-07 09:46:40 +00:00
Michał Kępień 6bdd55a9b3 Enforce a run time limit on unit test binaries
When a unit test binary hangs, the GitLab CI job in which it is run is
stuck until its run time limit is exceeded.  Furthermore, it is not
trivial to determine which test(s) hung in a given GitLab CI job based
on its log.  To prevent these issues, enforce a run time limit on every
binary executed by the lib/unit-test-driver.sh script.  Use a timeout of
5 minutes for consistency with older BIND 9 branches, which employed
Kyua for running unit tests.  Report an exit code of 124 when the run
time limit is exceeded for a unit test binary, for consistency with the
"timeout" tool included in GNU coreutils.
2021-04-07 11:41:45 +02:00
Artem Boldariev d1bb1b01b9 Merge branch '2611-doth-failure' into 'main'
Fix "doth" system test failure with SSL_ERROR_SYSCALL (5)

See merge request isc-projects/bind9!4863
2021-04-07 08:44:38 +00:00
Artem Boldariev ee10948e2d Remove dead code which was supposed to handle TLS shutdowns nicely
Fixes Coverity issue CID 330954 (See #2612).
2021-04-07 11:21:08 +03:00
Artem Boldariev e6062210c7 Handle buggy situations with SSL_ERROR_SYSCALL
See "BUGS" section at:

https://www.openssl.org/docs/man1.1.1/man3/SSL_get_error.html

It is mentioned there that when TLS status equals SSL_ERROR_SYSCALL
AND errno == 0 it means that underlying transport layer returned EOF
prematurely.  However, we are managing the transport ourselves, so we
should just resume reading from the TCP socket.

It seems that this case has been handled properly on modern versions
of OpenSSL. That being said, the situation goes in line with the
manual: it is briefly mentioned there that SSL_ERROR_SYSCALL might be
returned not only in a case of low-level errors (like system call
failures).
2021-04-07 11:21:08 +03:00
Mark Andrews 6b121171a5 Merge branch '2613-lib-dns-gen-is-not-deleted-on-make-clean' into 'main'
Resolve "lib/dns/gen is not deleted on make clean"

Closes #2613

See merge request isc-projects/bind9!4865
2021-04-07 07:18:53 +00:00
Mark Andrews 9c28df2204 remove lib/dns/gen when running 'make clean' 2021-04-07 08:06:49 +10:00
Matthijs Mekking 8556c7f854 Merge branch '2594-servestale-staleonly-recursion-race' into 'main'
Serve-stale "staleonly" recursion race condition

See merge request isc-projects/bind9!4859
2021-04-02 11:26:57 +00:00
Matthijs Mekking 3d3a6415f7 If RPZ config'd, bail stale-answer-client-timeout
When we are recursing, RPZ processing is not allowed. But when we are
performing a lookup due to "stale-answer-client-timeout", we are still
recursing. This effectively means that RPZ processing is disabled on
such a lookup.

In this case, bail the "stale-answer-client-timeout" lookup and wait
for recursion to complete, as we we can't perform the RPZ rewrite
rules reliably.
2021-04-02 10:02:40 +02:00
Matthijs Mekking 839df94190 Rename "staleonly"
The dboption DNS_DBFIND_STALEONLY caused confusion because it implies
we are looking for stale data **only** and ignore any active RRsets in
the cache. Rename it to DNS_DBFIND_STALETIMEOUT as it is more clear
the option is related to a lookup due to "stale-answer-client-timeout".

Rename other usages of "staleonly", instead use "lookup due to...".
Also rename related function and variable names.
2021-04-02 10:02:40 +02:00
Matthijs Mekking 3f81d79ffb Restore the RECURSIONOK attribute after staleonly
When doing a staleonly lookup we don't want to fallback to recursion.
After all, there are obviously problems with recursion, otherwise we
wouldn't do a staleonly lookup.

When resuming from recursion however, we should restore the
RECURSIONOK flag, allowing future required lookups for this client
to recurse.
2021-04-02 10:02:40 +02:00
Matthijs Mekking aaed7f9d8c Remove result exception on staleonly lookup
When implementing "stale-answer-client-timeout", we decided that
we should only return positive answers prematurely to clients. A
negative response is not useful, and in that case it is better to
wait for the recursion to complete.

To do so, we check the result and if it is not ISC_R_SUCCESS, we
decide that it is not good enough. However, there are more return
codes that could lead to a positive answer (e.g. CNAME chains).

This commit removes the exception and now uses the same logic that
other stale lookups use to determine if we found a useful stale
answer (stale_found == true).

This means we can simplify two test cases in the serve-stale system
test: nodata.example is no longer treated differently than data.example.
2021-04-02 10:02:40 +02:00
Matthijs Mekking e44bcc6f53 Add notes and changes for [#2594]
Pretty newsworthy.
2021-04-02 10:02:40 +02:00
Matthijs Mekking 3d5429f61f Remove INSIST on NS_QUERYATTR_ANSWERED
The NS_QUERYATTR_ANSWERED attribute is to prevent sending a response
twice. Without the attribute, this may happen if a staleonly lookup
found a useful answer and sends a response to the client, and later
recursion ends and also tries to send a response.

The attribute was also used to mask adding a duplicate RRset. This is
considered harmful. When we created a response to the client with a
stale only lookup (regardless if we actually have send the response),
we should clear the rdatasets that were added during that lookup.

Mark such rdatasets with the a new attribute,
DNS_RDATASETATTR_STALE_ADDED. Set a query attribute
NS_QUERYATTR_STALEOK if we may have added rdatasets during a stale
only lookup. Before creating a response on a normal lookup, check if
we can expect rdatasets to have been added during a staleonly lookup.
If so, clear the rdatasets from the message with the attribute
DNS_RDATASETATTR_STALE_ADDED set.
2021-04-02 09:15:07 +02:00
Matthijs Mekking 48b0dc159b Simplify when to detach the client
With stale-answer-client-timeout, we may send a response to the client,
but we may want to hold on to the network manager handle, because
recursion is going on in the background, or we need to refresh a
stale RRset.

Simplify the setting of 'nodetach':
* During a staleonly lookup we should not detach the nmhandle, so just
  set it prior to 'query_lookup()'.
* During a staleonly "stalefirst" lookup set the 'nodetach' to true
  if we are going to refresh the RRset.

Now there is no longer the need to clear the 'nodetach' if we go
through the "dbfind_stale", "stale_refresh_window", or "stale_only"
paths.
2021-04-02 09:14:09 +02:00
Matthijs Mekking 92f7a67892 Refactor stale lookups, ignore active RRsets
When doing a staleonly lookup, ignore active RRsets from cache. If we
don't, we may add a duplicate RRset to the message, and hit an
assertion failure in query.c because adding the duplicate RRset to the
ANSWER section failed.

This can happen on a race condition. When a client query is received,
the recursion is started. When 'stale-answer-client-timeout' triggers
around the same time the recursion completes, the following sequence
of events may happen:
1. Queue the "try stale" fetch_callback() event to the client task.
2. Add the RRsets from the authoritative response to the cache.
3. Queue the "fetch complete" fetch_callback() event to the client task.
4. Execute the "try stale" fetch_callback(), which retrieves the
   just-inserted RRset from the database.
5. In "ns_query_done()" we are still recursing, but the "staleonly"
   query attribute has already been cleared. In other words, the
   query will resume when recursion ends (it already has ended but is
   still on the task queue).
6. Execute the "fetch complete" fetch_callback(). It finds the answer
   from recursion in the cache again and tries to add the duplicate to
   the answer section.

This commit changes the logic for finding stale answers in the cache,
such that on "stale_only" lookups actually only stale RRsets are
considered. It refactors the code so that code paths for "dbfind_stale",
"stale_refresh_window", and "stale_only" are more clear.

First we call some generic code that applies in all three cases,
formatting the domain name for logging purposes, increment the
trystale stats, and check if we actually found stale data that we can
use.

The "dbfind_stale" lookup will return SERVFAIL if we didn't found a
usable answer, otherwise we will continue with the lookup
(query_gotanswer()). This is no different as before the introduction of
"stale-answer-client-timeout" and "stale-refresh-time".

The "stale_refresh_window" lookup is similar to the "dbfind_stale"
lookup: return SERVFAIL if we didn't found a usable answer, otherwise
continue with the lookup (query_gotanswer()).

Finally the "stale_only" lookup.

If the "stale_only" lookup was triggered because of an actual client
timeout (stale-answer-client-timeout > 0), and if database lookup
returned a stale usable RRset, trigger a response to the client.
Otherwise return and wait until the recursion completes (or the
resolver query times out).

If the "stale_only" lookup is a "stale-anwer-client-timeout 0" lookup,
preferring stale data over a lookup. In this case if there was no stale
data, or the data was not a positive answer, retry the lookup with the
stale options cleared, a.k.a. a normal lookup. Otherwise, continue
with the lookup (query_gotanswer()) and refresh the stale RRset. This
will trigger a response to the client, but will not detach the handle
because a fetch will be created to refresh the RRset.
2021-04-02 09:14:09 +02:00
Matthijs Mekking fee164243f Keep track of allow client detach
The stale-answer-client-timeout feature introduced a dependancy on
when a client may be detached from the handle. The dboption
DNS_DBFIND_STALEONLY was reused to track this attribute. This overloads
the meaning of this database option, and actually introduced a bug
because the option was checked in other places. In particular, in
'ns_query_done()' there is a check for 'RECURSING(qctx->client) &&
(!QUERY_STALEONLY(&qctx->client->query) || ...' and the condition is
satisfied because recursion has not completed yet and
DNS_DBFIND_STALEONLY is already cleared by that time (in
query_lookup()), because we found a useful answer and we should detach
the client from the handle after sending the response.

Add a new boolean to the client structure to keep track of client
detach from handle is allowed or not. It is only disallowed if we are
in a staleonly lookup and we didn't found a useful answer.
2021-04-02 09:14:09 +02:00
Artem Boldariev e7fe606020 Merge branch 'artem/tls-tests-and-fixes' into 'main'
TLS transport code refactoring and unit tests

See merge request isc-projects/bind9!4851
2021-04-01 15:41:52 +00:00
Artem Boldariev fa062162a7 Fix crash (regression) in DIG when handling non-DoH responses
This commit fixes crash in dig when it encounters non-expected header
value. The bug was introduced at some point late in the last DoH
development cycle. Also, refactors the relevant code a little bit to
ensure better incoming data validation for client-side DoH
connections.
2021-04-01 17:31:29 +03:00
Artem Boldariev 11ed7aac5d TLS code refactoring, fixes and unit-tests
This commit fixes numerous stability issues with TLS transport code as
well as adds unit tests for it.
2021-04-01 17:31:29 +03:00
Ondřej Surý 01cd310407 Merge branch '2607-remove-custom-spnego' into 'main'
Remove custom ISC SPNEGO implementation

Closes #2607

See merge request isc-projects/bind9!4856
2021-04-01 14:14:00 +00:00
Ondřej Surý 66bd47a129 Add CHANGES and release note for GL #2607 2021-04-01 16:08:19 +02:00
Mark Andrews 1febea6d7c Merge branch '2538-bind-9-17-build-process-leaving-files-in-unexpected-locations' into 'main'
Resolve "BIND 9.17 build process leaving files in unexpected locations?"

Closes #2538

See merge request isc-projects/bind9!4757
2021-04-01 09:34:17 +00:00
Mark Andrews 35e8f56b49 Test dynamic libraries should not be installed
Tag the libraries with check_ to prevent them being installed
by "make install".  Additionally make check requires .so to be
create which requires .lai files to be constructed which, in
turn, requires -rpath <dir> as part of "linking" the .la file.
2021-04-01 19:11:54 +11:00
Michal Nowak b34fd6d4f2 Merge branch 'mnowak/web-run-gcc-tarball-ci-job' into 'main'
Run gcc:tarball CI job in web-triggered pipelines

See merge request isc-projects/bind9!4850
2021-03-31 14:37:15 +00:00
Michal Nowak 4d5d3b75da Run gcc:tarball CI job in web-triggered pipelines
The gcc:tarball CI job may identify problems with tarballs created by
"make dist" of the tarball-create CI job. Enabling the gcc:tarball CI
job in web-triggered pipelines provides developers with a test vector.
2021-03-31 16:35:59 +02:00
Michał Kępień aaac9345eb Merge branch 'michal/include-all-pre-generated-man-pages-in-make-dist' into 'main'
Include all pre-generated man pages in "make dist"

See merge request isc-projects/bind9!4838
2021-03-29 11:08:00 +00:00
Michał Kępień 490e5cb1f1 Include all pre-generated man pages in "make dist"
Some man pages (e.g. dnstap-read.1, named-nzd2nzf.1) should only be
installed conditionally (when the relevant features are enabled in a
given BIND 9 build).  This is achieved using Automake conditionals.
However, while all source reStructuredText files are included in
tarballs produced by "make dist" (distribution tarballs) as they should
be, the list of pre-generated man pages included in distribution
tarballs incorrectly depends on the ./configure switches used for the
build for which "make dist" is run.  Meanwhile, distribution tarballs
should always contain all the files necessary to build any flavor of
BIND 9.

Here is an example scenario which fails to work as intended:

    autoreconf -i
    ./configure --disable-maintainer-mode
    make dist
    tar --extract --file bind-9.17.11.tar.xz
    cd bind-9.17.11
    ./configure --disable-maintainer-mode --enable-dnstap
    make

Fix by always including pre-generated versions of all conditionally
installed man pages in EXTRA_DIST.  While this may cause some of them to
appear in EXTRA_DIST more than once (depending on the ./configure
switches used for the build for which "make dist" is run), it seems to
not be a problem for Automake.
2021-03-29 13:06:39 +02:00
Mark Andrews 99ff8f285c Merge branch '2597-make-calling-generic-rdata-methods-consistent' into 'main'
Resolve "Make calling generic rdata methods consistent"

Closes #2597

See merge request isc-projects/bind9!4834
2021-03-26 22:27:51 +00:00
Mark Andrews a88d3963e2 Make calling generic rdata methods consistent
add matching macros to pass arguments from called methods
to generic methods.  This will reduce the amount of work
required when extending methods.

Also cleanup unnecessary UNUSED declarations.
2021-03-26 22:04:42 +00:00
Ondřej Surý 19b69e9a3b Merge branch 'bind-dyndb-ldap-v9.16.13' into 'main'
Do not require config.h to use isc/util.h

See merge request isc-projects/bind9!4840
2021-03-26 18:43:18 +00:00
Petr Mensik 81eb3396bf Do not require config.h to use isc/util.h
util.h requires ISC_CONSTRUCTOR definition, which depends on config.h
inclusion. It does not include it from isc/util.h (or any other header).
Using isc/util.h fails hard when isc/util.h is used without including
bind's config.h.

Move the check to c file, where ISC_CONSTRUCTOR is used. Ensure config.h
is included there.
2021-03-26 11:41:22 +01:00
Diego dos Santos Fronza f38069cdf8 Merge branch '2490-dig-tcp-does-not-honor-tries-1-nor-retry-0' into 'main'
Resolve "dig +tcp does not honor +tries=1 nor +retry=0"

Closes #2490

See merge request isc-projects/bind9!4682
2021-03-25 17:30:24 +00:00
Diego Fronza 04537633a7 Add CHANGES note for [GL #2490] 2021-03-25 14:12:16 -03:00
Diego Fronza 3b98c4d311 Update dig's man page
Adjusted man page entries for +tries and +retry options to reflect the
fact that now those options apply to TCP as well.
2021-03-25 14:08:40 -03:00
Diego Fronza 4f82cc41cc Added tests for tries=1 and retry=0 on TCP EOF
Added tests to ensure that dig won't retry sending a query over tcp
(+tcp) when a TCP connection is closed prematurely (EOF is read) if
either +tries=1 or retry=0 is specified on the command line.
2021-03-25 14:08:40 -03:00
Diego Fronza e680896003 Adjusted dig system tests
Now that premature EOF on tcp connections take +tries and +retry into
account, the dig system tests handling TCP EOF with +tries=1 were
expecting dig to do a second attempt in handling the tcp query, which
doesn't happen anymore.

To make the test work as expected +tries value was adjusted to 2, to
make it behave as before after the new update on dig.
2021-03-25 14:08:40 -03:00
Diego Fronza 78f6ead480 Don't retry +tcp queries on failure if tries=1 or retries=0
Before this commit, a premature EOF (connection closed) on tcp queries
was causing dig to automatically attempt to send the query again, even
if +tries=1 or +retries=0 was provided on command line.

This commit fix the problem by taking into account the no. of retries
specified by the user when processing a premature EOF on tcp
connections.
2021-03-25 14:08:39 -03:00
389 changed files with 13764 additions and 14352 deletions
+141 -65
View File
@@ -34,11 +34,15 @@ variables:
WITH_READLINE_LIBEDIT: "--with-readline=libedit"
WITH_READLINE_READLINE: "--with-readline=readline"
BIND_INSTALL_PATH: "${CI_PROJECT_DIR}/.local"
INSTALL_PATH: "${CI_PROJECT_DIR}/.local"
# In multithreaded unit tests, abort on the first failure
CMOCKA_TEST_ABORT: 1
# Disable pytest's "cacheprovider" plugin to prevent it from creating
# cross-testrun files as there is no need to use that feature in CI.
PYTEST_ADDOPTS: "-p no:cacheprovider"
# Default platforms to run "stress" tests on
BIND_STRESS_TEST_OS: linux
BIND_STRESS_TEST_ARCH: amd64
@@ -133,16 +137,20 @@ stages:
# Fedora
.fedora-33-amd64: &fedora_33_amd64_image
image: "$CI_REGISTRY_IMAGE:fedora-33-amd64"
.fedora-34-amd64: &fedora_34_amd64_image
image: "$CI_REGISTRY_IMAGE:fedora-34-amd64"
<<: *linux_amd64
.fedora-33-arm64: &fedora_33_arm64_image
image: "$CI_REGISTRY_IMAGE:fedora-33-arm64"
.fedora-34-arm64: &fedora_34_arm64_image
image: "$CI_REGISTRY_IMAGE:fedora-34-arm64"
<<: *linux_stress_arm64
# Ubuntu
.ubuntu-bionic-amd64: &ubuntu_bionic_amd64_image
image: "$CI_REGISTRY_IMAGE:ubuntu-bionic-amd64"
<<: *linux_amd64
.ubuntu-focal-amd64: &ubuntu_focal_amd64_image
image: "$CI_REGISTRY_IMAGE:ubuntu-focal-amd64"
<<: *linux_amd64
@@ -169,8 +177,12 @@ stages:
image: "freebsd-12.2-x86_64"
<<: *libvirt_amd64
.freebsd-13-amd64: &freebsd_13_amd64_image
image: "freebsd-13.0-x86_64"
<<: *libvirt_amd64
.openbsd-amd64: &openbsd_amd64_image
image: "openbsd-6.8-x86_64"
image: "openbsd-6.9-x86_64"
<<: *libvirt_amd64
### Job Templates
@@ -191,6 +203,12 @@ stages:
- main@isc-projects/bind9
- /^v9_[1-9][0-9]$/@isc-projects/bind9
.schedules-tags-web-triggering-rules: &schedules_tags_web_triggering_rules
only:
- schedules
- tags
- web
.precheck: &precheck_job
<<: *default_triggering_rules
<<: *base_image
@@ -211,10 +229,10 @@ stages:
--disable-maintainer-mode \
--enable-developer \
--enable-option-checking=fatal \
--enable-dnstap \
--with-cmocka \
--with-libxml2 \
--with-json-c \
--prefix="${BIND_INSTALL_PATH}" \
$EXTRA_CONFIGURE \
|| (test -s config.log && cat config.log; exit 1)
@@ -233,6 +251,18 @@ stages:
grep "^#define HAVE_READLINE_READLINE" config.h; \
fi
# Move the out-of-tree workspace to CI project dir to save it for use in
# dependent jobs.
.save_out_of_tree_workspace: &save_out_of_tree_workspace
- test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
# Move the artifacts from the out-of-tree build job to their original
# location (the out-of-tree workspace) and then continue work in the
# out-of-tree workspace.
.retrieve_out_of_tree_workspace: &retrieve_out_of_tree_workspace
- test -n "${OUT_OF_TREE_WORKSPACE}" && mv "$(basename "${OUT_OF_TREE_WORKSPACE}")" "${OUT_OF_TREE_WORKSPACE}"
- test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
.build: &build_job
<<: *default_triggering_rules
stage: build
@@ -243,12 +273,12 @@ stages:
- *configure
- *check_readline_setup
- make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1
- test -z "${RUN_MAKE_INSTALL}" || make install
- test -z "${RUN_MAKE_INSTALL}" || sh util/check-make-install
- test -z "${RUN_MAKE_INSTALL}" || make DESTDIR="${INSTALL_PATH}" install
- test -z "${RUN_MAKE_INSTALL}" || DESTDIR="${INSTALL_PATH}" sh util/check-make-install
- if [[ "${CFLAGS}" == *"-fsanitize=address"* ]]; then ( ! grep -F AddressSanitizer config.log ); fi
- if test -z "${OUT_OF_TREE_WORKSPACE}" && test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
after_script:
- test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
- *save_out_of_tree_workspace
needs:
- job: autoreconf
artifacts: true
@@ -299,10 +329,7 @@ stages:
stage: system
before_script:
- *setup_softhsm
# Move the artifacts from the out-of-tree build job to their original location (the out-of-tree workspace).
- test -n "${OUT_OF_TREE_WORKSPACE}" && mv "$(basename "${OUT_OF_TREE_WORKSPACE}")" "${OUT_OF_TREE_WORKSPACE}"
# Continue work in the out-of-tree workspace.
- test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
- *retrieve_out_of_tree_workspace
- *setup_interfaces
script:
- cd bin/tests/system
@@ -312,7 +339,7 @@ stages:
- test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
- test -d bind-* && cd bind-*
- cat bin/tests/system/test-suite.log
- test -n "${OUT_OF_TREE_WORKSPACE}" && mv "${OUT_OF_TREE_WORKSPACE}" "${CI_PROJECT_DIR}"
- *save_out_of_tree_workspace
.system_test: &system_test_job
<<: *system_test_common
@@ -339,6 +366,7 @@ stages:
when: on_failure
.windows_system_test: &windows_system_test_job
<<: *schedules_tags_web_triggering_rules
stage: system
script:
- 'Push-Location bin/tests/system'
@@ -354,19 +382,17 @@ stages:
untracked: true
expire_in: "1 day"
when: on_failure
only:
- schedules
- tags
- web
.unit_test_common: &unit_test_common
<<: *default_triggering_rules
stage: unit
before_script:
- if [ -n "$TCP_CONNECTIONTIMEOUT" ]; then sudo sysctl 'net.inet.tcp.keepinittime=1'; fi
- *setup_softhsm
- *retrieve_out_of_tree_workspace
script:
- make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1
after_script:
- *save_out_of_tree_workspace
.unit_test: &unit_test_job
<<: *unit_test_common
@@ -568,7 +594,7 @@ gcc:alpine3.13:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--enable-dnstap ${WITHOUT_READLINE}"
EXTRA_CONFIGURE: "${WITHOUT_READLINE}"
<<: *alpine_3_13_amd64_image
<<: *build_job
@@ -592,7 +618,7 @@ gcc:centos7:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *centos_centos7_amd64_image
<<: *build_job
@@ -640,7 +666,7 @@ gcc:stretch:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -O2"
EXTRA_CONFIGURE: "--without-cmocka"
EXTRA_CONFIGURE: "--without-cmocka --without-gssapi"
<<: *debian_stretch_amd64_image
<<: *build_job
@@ -664,7 +690,7 @@ gcc:buster:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} --coverage -O0"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 ${WITH_READLINE_LIBEDIT}"
EXTRA_CONFIGURE: "--with-libidn2 ${WITH_READLINE_LIBEDIT}"
<<: *debian_buster_amd64_image
<<: *build_job
@@ -700,7 +726,7 @@ scan-build:
CC: "${CLANG}"
CFLAGS: "${CFLAGS_COMMON}"
CONFIGURE: "${SCAN_BUILD} ./configure"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
EXTRA_CONFIGURE: "--with-libidn2"
script:
- *configure
- *scan_build
@@ -720,7 +746,7 @@ gcc:sid:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -O3"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 --without-lmdb"
EXTRA_CONFIGURE: "--with-libidn2 --without-lmdb"
RUN_MAKE_INSTALL: 1
<<: *debian_sid_amd64_image
<<: *build_job
@@ -751,7 +777,7 @@ gcc:out-of-tree:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
CONFIGURE: "${CI_PROJECT_DIR}/configure"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 --with-lmdb"
EXTRA_CONFIGURE: "--with-libidn2 --with-lmdb"
RUN_MAKE_INSTALL: 1
OUT_OF_TREE_WORKSPACE: /tmp/out_of_tree_workspace
<<: *base_image
@@ -765,17 +791,24 @@ system:gcc:out-of-tree:
artifacts: true
<<: *base_image
<<: *system_test_job
only:
- schedules
- tags
- web
<<: *schedules_tags_web_triggering_rules
unit:gcc:out-of-tree:
variables:
OUT_OF_TREE_WORKSPACE: /tmp/out_of_tree_workspace
needs:
- job: gcc:out-of-tree
artifacts: true
<<: *base_image
<<: *unit_test_job
<<: *schedules_tags_web_triggering_rules
# Jobs for tarball GCC builds on Debian 10 "buster" (amd64)
gcc:tarball:
variables:
CC: gcc
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
EXTRA_CONFIGURE: "--with-libidn2"
RUN_MAKE_INSTALL: 1
<<: *base_image
<<: *build_job
@@ -786,34 +819,27 @@ gcc:tarball:
needs:
- job: tarball-create
artifacts: true
only:
- schedules
- tags
system:gcc:tarball:
<<: *base_image
<<: *system_test_job
<<: *schedules_tags_web_triggering_rules
before_script:
- cd bind-*
- *setup_interfaces
needs:
- job: gcc:tarball
artifacts: true
only:
- schedules
- tags
unit:gcc:tarball:
<<: *base_image
<<: *unit_test_job
<<: *schedules_tags_web_triggering_rules
before_script:
- cd bind-*
needs:
- job: gcc:tarball
artifacts: true
only:
- schedules
- tags
# Jobs for debug GCC builds on openSUSE Tumbleweed (amd64)
@@ -839,6 +865,30 @@ unit:gcc:tumbleweed:amd64:
- job: gcc:tumbleweed:amd64
artifacts: true
# Jobs for regular GCC builds on Ubuntu 18.04 Bionic Beaver (amd64)
gcc:bionic:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -O2"
EXTRA_CONFIGURE: "--disable-dnstap --disable-geoip"
<<: *ubuntu_bionic_amd64_image
<<: *build_job
system:gcc:bionic:amd64:
<<: *ubuntu_bionic_amd64_image
<<: *system_test_job
needs:
- job: gcc:bionic:amd64
artifacts: true
unit:gcc:bionic:amd64:
<<: *ubuntu_bionic_amd64_image
<<: *unit_test_job
needs:
- job: gcc:bionic:amd64
artifacts: true
# Jobs for regular GCC builds on Ubuntu 20.04 Focal Fossa (amd64)
gcc:focal:amd64:
@@ -941,7 +991,7 @@ system:gcc:tsan:
unit:gcc:tsan:
variables:
TSAN_OPTIONS: ${TSAN_OPTIONS_COMMON}
TSAN_OPTIONS: ${TSAN_OPTIONS_COMMON} suppressions=$CI_PROJECT_DIR/tsan-suppressions.txt
<<: *base_image
<<: *unit_test_tsan_job
needs:
@@ -968,7 +1018,7 @@ system:clang:tsan:
unit:clang:tsan:
variables:
TSAN_OPTIONS: ${TSAN_OPTIONS_COMMON}
TSAN_OPTIONS: ${TSAN_OPTIONS_COMMON} suppressions=$CI_PROJECT_DIR/tsan-suppressions.txt
<<: *base_image
<<: *unit_test_tsan_job
needs:
@@ -1046,25 +1096,25 @@ unit:gcc:softhsm2.4:
- job: gcc:softhsm2.4
artifacts: true
# Jobs for PKCS#11-enabled GCC builds on Fedora 33 (amd64)
# Jobs for PKCS#11-enabled GCC builds on Fedora 34 (amd64)
gcc:softhsm2.6:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -O1"
EXTRA_CONFIGURE: "--with-libidn2 --enable-native-pkcs11 --with-pkcs11=/usr/lib64/pkcs11/libsofthsm2.so"
<<: *fedora_33_amd64_image
<<: *fedora_34_amd64_image
<<: *build_job
system:gcc:softhsm2.6:
<<: *fedora_33_amd64_image
<<: *fedora_34_amd64_image
<<: *system_test_job
needs:
- job: gcc:softhsm2.6
artifacts: true
unit:gcc:softhsm2.6:
<<: *fedora_33_amd64_image
<<: *fedora_34_amd64_image
<<: *unit_test_job
needs:
- job: gcc:softhsm2.6
@@ -1079,10 +1129,12 @@ clang:freebsd11:amd64:
USER: gitlab-runner
<<: *freebsd_11_amd64_image
<<: *build_job
<<: *schedules_tags_web_triggering_rules
system:clang:freebsd11:amd64:
<<: *freebsd_11_amd64_image
<<: *system_test_job
<<: *schedules_tags_web_triggering_rules
variables:
USER: gitlab-runner
TEST_PARALLEL_JOBS: 4
@@ -1093,6 +1145,7 @@ system:clang:freebsd11:amd64:
unit:clang:freebsd11:amd64:
<<: *freebsd_11_amd64_image
<<: *unit_test_job
<<: *schedules_tags_web_triggering_rules
needs:
- job: clang:freebsd11:amd64
artifacts: true
@@ -1102,7 +1155,7 @@ unit:clang:freebsd11:amd64:
clang:freebsd12:amd64:
variables:
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--enable-dnstap ${WITH_READLINE_EDITLINE}"
EXTRA_CONFIGURE: "${WITH_READLINE_EDITLINE}"
USER: gitlab-runner
<<: *freebsd_12_amd64_image
<<: *build_job
@@ -1124,12 +1177,40 @@ unit:clang:freebsd12:amd64:
- job: clang:freebsd12:amd64
artifacts: true
# Jobs for Clang builds on FreeBSD 13 (amd64)
clang:freebsd13:amd64:
variables:
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "${WITH_READLINE_LIBEDIT}"
USER: gitlab-runner
<<: *freebsd_13_amd64_image
<<: *build_job
system:clang:freebsd13:amd64:
<<: *freebsd_13_amd64_image
<<: *system_test_job
variables:
USER: gitlab-runner
TEST_PARALLEL_JOBS: 4
needs:
- job: clang:freebsd13:amd64
artifacts: true
unit:clang:freebsd13:amd64:
<<: *freebsd_13_amd64_image
<<: *unit_test_job
needs:
- job: clang:freebsd13:amd64
artifacts: true
# Jobs for Clang builds on OpenBSD (amd64)
clang:openbsd:amd64:
variables:
CC: clang
USER: gitlab-runner
EXTRA_CONFIGURE: "--disable-dnstap"
<<: *openbsd_amd64_image
<<: *build_job
@@ -1150,8 +1231,6 @@ unit:clang:openbsd:amd64:
<<: *unit_test_job
variables:
USER: gitlab-runner
# There's no socket option on OpenBSD, so we need to set this globally
TCP_CONNECTIONTIMEOUT: 1
needs:
- job: clang:openbsd:amd64
artifacts: true
@@ -1177,12 +1256,9 @@ system:msvc:windows:amd64:
msvc-debug:windows:amd64:
<<: *windows_server_2016_amd64_image
<<: *windows_build_job
<<: *schedules_tags_web_triggering_rules
variables:
VSCONF: Debug
only:
- schedules
- tags
- web
system:msvc-debug:windows:amd64:
<<: *windows_server_2016_amd64_image
@@ -1274,7 +1350,7 @@ coverity:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
EXTRA_CONFIGURE: "--with-libidn2"
script:
- *coverity_cache_prep
- *configure
@@ -1340,10 +1416,10 @@ respdiff:
- *setup_interfaces
- *setup_softhsm
- make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1
- make install
- make DESTDIR="${INSTALL_PATH}" install
- git clone --depth 1 https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.isc.org/isc-private/bind-qa.git
- cd bind-qa/bind9/stress
- DIG="${BIND_INSTALL_PATH}/bin/dig" WORKSPACE="${CI_PROJECT_DIR}" bash stress.sh
- LD_LIBRARY_PATH="${INSTALL_PATH}/usr/local/lib" BIND_INSTALL_PATH="${INSTALL_PATH}/usr/local" WORKSPACE="${CI_PROJECT_DIR}" bash stress.sh
needs:
- job: autoreconf
artifacts: true
@@ -1353,8 +1429,8 @@ respdiff:
when: always
timeout: 2h
stress:authoritative:fedora:33:amd64:
<<: *fedora_33_amd64_image
stress:authoritative:fedora:34:amd64:
<<: *fedora_34_amd64_image
<<: *linux_stress_amd64
<<: *stress_job
variables:
@@ -1367,8 +1443,8 @@ stress:authoritative:fedora:33:amd64:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /authoritative/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
stress:recursive:fedora:33:amd64:
<<: *fedora_33_amd64_image
stress:recursive:fedora:34:amd64:
<<: *fedora_34_amd64_image
<<: *linux_stress_amd64
<<: *stress_job
variables:
@@ -1381,8 +1457,8 @@ stress:recursive:fedora:33:amd64:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /recursive/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
stress:authoritative:fedora:33:arm64:
<<: *fedora_33_arm64_image
stress:authoritative:fedora:34:arm64:
<<: *fedora_34_arm64_image
<<: *linux_stress_arm64
<<: *stress_job
variables:
@@ -1395,8 +1471,8 @@ stress:authoritative:fedora:33:arm64:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /authoritative/i && $BIND_STRESS_TEST_ARCH =~ /arm64/i)
stress:recursive:fedora:33:arm64:
<<: *fedora_33_arm64_image
stress:recursive:fedora:34:arm64:
<<: *fedora_34_arm64_image
<<: *linux_stress_arm64
<<: *stress_job
variables:
+1
View File
@@ -13,6 +13,7 @@ email to [security-officer@isc.org](security-officer@isc.org).
- [ ] Determine CVSS score
- [ ] Determine the range of BIND versions affected (including the Subscription Edition)
- [ ] Determine whether workarounds for the problem exists
- [ ] Create a draft of the security advisory and put the information above in there
- [ ] Prepare a detailed description of the problem which should include the following by default:
- instructions for reproducing the problem (a system test is good enough)
- explanation of code flow which triggers the problem (a system test is *not* good enough)
+3 -1
View File
@@ -85,7 +85,9 @@
- [ ] ***(QA)*** Merge the automatically prepared `prep 9.x.y` commit which updates `version` and documentation on the release branch into the relevant maintenance branch (`v9_x`).
- [ ] ***(QA)*** For each maintained branch, update the `BIND_BASELINE_VERSION` variable for the `abi-check` job in `.gitlab-ci.yml` to the latest published BIND version tag for a given branch.
- [ ] ***(QA)*** Prepare empty release notes for the next set of releases.
- [ ] ***(QA)*** Sanitize all confidential issues assigned to the release milestone and make them public.
- [ ] ***(QA)*** Sanitize confidential issues which are assigned to the current release milestone and do not describe a security vulnerability, then make them public.
- [ ] ***(QA)*** Sanitize confidential issues which are assigned to older release milestones and describe security vulnerabilities, then make them public if appropriate[^2].
- [ ] ***(QA)*** Update QA tools used in GitLab CI (e.g. Flake8, PyLint) by modifying the relevant `Dockerfile`.
[^1]: If not, use the time remaining until the tagging deadline to ensure all outstanding issues are either resolved or moved to a different milestone.
[^2]: As a rule of thumb, security vulnerabilities which have reproducers merged to the public repository are considered okay for full disclosure.
+1
View File
@@ -13,6 +13,7 @@ extraction:
- "libidn2-dev"
- "libmaxminddb-dev"
- "libuv1-dev"
- "libnghttp2-dev"
configure:
command:
- "autoreconf -fi"
+229 -23
View File
@@ -1,39 +1,245 @@
5607. [bug] Rekey after 'rndc dnssec -checkds' or 'rndc dnssec
-rollover' command is received, because such a command
may influence the next key event. [GL #2488]
5652. [bug] Copy and paste error caused the socket option to
be enabled instead of disabled. [GL #2746]
5606. [bug] CDS/CDNSKEY DELETE records were not removed when a zone
transitioned from secure to insecure. "named-checkzone"
should not complain if such records exist in an
unsigned zone. [GL #2517]
5651. [func] Refactor zone dumping to be processed asynchronously
via the uv_work_t thread pool API. [GL #2732]
5605. [bug] "dig -u" now uses CLOCK_REALTIME for more accurate
time reporting. [GL #2592]
5650. [bug] Prevent a crash that could occur if serve-stale
was enabled and a prefetch was triggered during a
query restart. [GL #2733]
5649. [bug] If a query was answered with stale data on a server
with DNS64 enabled, an assertion could occur if a
non-stale answer arrived afterward. [GL #2731]
5648. [bug] The calculation of the estimated IXFR transaction
size by dns_journal_iter_init() was invalid. [GL #2685]
5647. [func] The interfacemgr has been refactored to use fewer
clientmgr objects, which in turn use fewer memory
contexts and tasks. This should result in less
fragmented memory and better startup performance.
[GL #2433]
5646. [bug] The default TCP timeout for rndc has been increased
to 60 seconds. This was its original value, but it
had been inadvertently lowered to 10. [GL #2643]
5645. [cleanup] Remove the rarely-used dns_name_copy() function
and rename dns_name_copynf() to dns_name_copy().
[GL !5081]
5644. [bug] Fix a race condition in reading and writing key files
for KASP zones in multiple views. [GL #1875]
5643. [placeholder]
5642. [bug] Check "key-directory" conflicts in "named.conf" for
zones in multiple views with different "dnssec-policy".
[GL #2463].
5641. [bug] Address potential memory leak in dst_key_fromnamedfile.
[GL #2689]
5640. [func] Add new configuration option to set the operating system
receive and send buffers. [GL #2313]
5639. [bug] Check that the first and last SOA record of an AXFR
are consistent. [GL #2528]
--- 9.17.13 released ---
5638. [bug] Improvements related to network manager/task manager
integration:
- isc_managers_create() and isc_managers_destroy()
functions were added to handle setup and teardown of
netmgr, taskmgr, timermgr, and socketmgr, since these
require a precise order of operations now.
- Event queue processing is now quantized to prevent
infinite looping.
- The netmgr can now be paused from within a netmgr
thread.
- Deadlocks due to a conflict between netmgr's
pause/resume and listen/stoplistening operations were
fixed.
[GL #2654]
5637. [placeholder]
5636. [bug] named and named-checkconf did not report an error when
multiple zones with the "dnssec-policy" option set were
using the same zone file. This has been fixed.
[GL #2603]
5635. [bug] Journal compaction could fail when a journal with
invalid transaction headers was not detected at startup.
This has been fixed. [GL #2670]
5634. [bug] If "dnssec-policy" was active and a private key file was
temporarily offline during a rekey event, named could
incorrectly introduce replacement keys and break a
signed zone. This has been fixed. [GL #2596]
5633. [doc] The "inline-signing" option was incorrectly described as
being inherited from the "options"/"view" levels and was
incorrectly accepted at those levels without effect.
This has been fixed. [GL #2536]
5632. [func] Add a new built-in KASP, "insecure", which is used to
transition a zone from a signed to an unsigned state.
The existing built-in KASP "none" should no longer be
used to unsign a zone. [GL #2645]
5631. [protocol] Update the implementation of the ZONEMD RR type to match
RFC 8976. [GL #2658]
5630. [func] Treat DNSSEC responses containing NSEC3 records with
iteration counts greater than 150 as insecure.
[GL #2445]
5629. [func] Reduce the maximum supported number of NSEC3 iterations
that can be configured for a zone to 150. [GL #2642]
5628. [bug] Host and nslookup could crash upon receiving a SERVFAIL
response. This has been fixed. [GL #2564]
5627. [bug] RRSIG(SOA) RRsets placed anywhere other than at the zone
apex were triggering infinite resigning loops. This has
been fixed. [GL #2650]
5626. [bug] When generating zone signing keys, KASP now also checks
for key ID conflicts among newly created keys, rather
than just between new and existing ones. [GL #2628]
5625. [bug] A deadlock could occur when multiple "rndc addzone",
"rndc delzone", and/or "rndc modzone" commands were
invoked simultaneously for different zones. This has
been fixed. [GL #2626]
5624. [func] Task manager events are now processed inside network
manager loops. The task manager no longer needs its own
set of worker threads, which improves resolver
performance. [GL #2638]
5623. [bug] When named was shut down during an ongoing zone
transfer, xfrin_fail() could incorrectly be called
twice. This has been fixed. [GL #2630]
5622. [cleanup] The lib/samples/ directory has been removed, as export
versions of libraries are no longer maintained.
[GL !4835]
5621. [placeholder]
5620. [bug] If zone journal files written by BIND 9.16.11 or earlier
were present when BIND was upgraded, the zone file for
that zone could have been inadvertently rewritten with
the current zone contents. This caused the original zone
file structure (e.g. comments, $INCLUDE directives) to
be lost, although the zone data itself was preserved.
This has been fixed. [GL #2623]
5619. [protocol] Implement draft-vandijk-dnsop-nsec-ttl, updating the
protocol such that NSEC(3) TTL values are set to the
minimum of the SOA MINIMUM value or the SOA TTL.
[GL #2347]
5618. [bug] Change 5149 introduced some inconsistencies in the way
record TTLs were presented in cache dumps. These
inconsistencies have been eliminated. [GL #389]
[GL #2289]
--- 9.17.12 released ---
5617. [placeholder]
5616. [security] named crashed when a DNAME record placed in the ANSWER
section during DNAME chasing turned out to be the final
answer to a client query. (CVE-2021-25215) [GL #2540]
5615. [security] Insufficient IXFR checks could result in named serving a
zone without an SOA record at the apex, leading to a
RUNTIME_CHECK assertion failure when the zone was
subsequently refreshed. This has been fixed by adding an
owner name check for all SOA records which are included
in a zone transfer. (CVE-2021-25214) [GL #2467]
5614. [bug] Ensure all resources are properly cleaned up when a call
to gss_accept_sec_context() fails. [GL #2620]
5613. [bug] It was possible to write an invalid transaction header
in the journal file for a managed-keys database after
upgrading. This has been fixed. Invalid headers in
existing journal files are detected and named is able
to recover from them. [GL #2600]
5612. [bug] Continued refactoring of the network manager:
- allow recovery from read and connect timeout events,
- ensure that calls to isc_nm_*connect() always
return the connection status via a callback
function.
[GL #2401]
5611. [func] Set "stale-answer-client-timeout" to "off" by default.
[GL #2608]
5610. [bug] Prevent a crash which could happen when a lookup
triggered by "stale-answer-client-timeout" was attempted
right after recursion for a client query finished.
[GL #2594]
5609. [func] The ISC implementation of SPNEGO was removed from BIND 9
source code. It was no longer necessary as all major
contemporary Kerberos/GSSAPI libraries include support
for SPNEGO. [GL #2607]
5608. [bug] When sending queries over TCP, dig now properly handles
"+tries=1 +retry=0" by not retrying the connection when
the remote server closes the connection prematurely.
[GL #2490]
5607. [bug] As "rndc dnssec -checkds" and "rndc dnssec -rollover"
commands may affect the next scheduled key event,
reconfiguration of zone keys is now triggered after
receiving either of these commands to prevent
unnecessary key rollover delays. [GL #2488]
5606. [bug] CDS/CDNSKEY DELETE records are now removed when a zone
transitions from a secure to an insecure state.
named-checkzone also no longer reports an error when
such records are found in an unsigned zone. [GL #2517]
5605. [bug] "dig -u" now uses the CLOCK_REALTIME clock source for
more accurate time reporting. [GL #2592]
5604. [experimental] A "filter-a.so" plugin, which is similar to the
"filter-aaaa.so" plugin but which omits A records
instead of AAAA records, has been added. Thanks to
'@treysis' (GitLab). [GL #2585]
GitLab user @treysis. [GL #2585]
5603. [placeholder]
5602. [bug] Fix the TCPDNS and TLSDNS timers, so TCP initial
and idle timers work correctly. [GL #2573]
5602. [bug] Fix TCPDNS and TLSDNS timers in Network Manager. This
makes the "tcp-initial-timeout" and "tcp-idle-timeout"
options work correctly again. [GL #2583]
5601. [bug] Dynamic zones with dnssec-policy could not be thawed
because KASP zones were always considered dynamic;
previously, dynamic KASP zones did not check whether
updates were disabled. This has been fixed. [GL #2523]
5601. [bug] Zones using KASP could not be thawed after they were
frozen using "rndc freeze". This has been fixed.
[GL #2523]
5600. [bug] Load a certificate chain file so that the full chain is
sent to DNS-over-TLS (DoT) and DNS-over-HTTPS (DoH)
clients that require full chain verification. [GL #2514]
5600. [bug] Send a full certificate chain instead of just the leaf
certificate to DNS-over-TLS (DoT) and DNS-over-HTTPS
(DoH) clients. This makes BIND 9 DoT/DoH servers
compatible with a broader set of clients. [GL #2514]
5599. [bug] Fix a crash when transferring a zone over TLS,
after "named" previously skipped a master. [GL #2562]
5599. [bug] Fix a named crash which occurred after skipping a
primary server while transferring a zone over TLS.
[GL #2562]
5598. [port] Cast (char) to (unsigned char) when calling ctype
tests. [GL #2567]
5598. [port] Silence -Wchar-subscripts compiler warnings triggered on
some platforms due to calling character classification
functions declared in the <ctype.h> header with
arguments of type char. [GL #2567]
--- 9.17.11 released ---
+6 -6
View File
@@ -46,11 +46,11 @@ As of Nov 2020, BIND 9.17 is fully supported and regularly tested on the
following systems:
* Debian 9, 10
* Ubuntu LTS 16.04, 20.04
* Fedora 33
* Ubuntu LTS 18.04, 20.04
* Fedora 34
* Red Hat Enterprise Linux / CentOS 7, 8
* FreeBSD 11.4, 12.2
* OpenBSD 6.8
* FreeBSD 11.4, 12.2, 13.0
* OpenBSD 6.9
* Alpine Linux 3.13
The amd64, i386, armhf and arm64 CPU architectures are all fully supported.
@@ -69,7 +69,7 @@ Server 2016, none of these are tested regularly by ISC.
* Solaris 11
* NetBSD
* Other Linux distributions still supported by their vendors, such as:
* Ubuntu 19.04+
* Ubuntu 20.10+
* Gentoo
* Arch Linux
* OpenWRT/LEDE 17.01+
@@ -86,7 +86,7 @@ assessed against the risk of adverse effect on officially supported
platforms.
* Platforms past or close to their respective EOL dates, such as:
* Ubuntu 14.04, 18.10
* Ubuntu 14.04, 16.04 (Ubuntu ESM releases are not supported)
* CentOS 6
* Debian Jessie
* FreeBSD 10.x
+9 -15
View File
@@ -34,8 +34,10 @@
#include <isc/hex.h>
#include <isc/lib.h>
#include <isc/log.h>
#include <isc/managers.h>
#include <isc/md.h>
#include <isc/mem.h>
#include <isc/netmgr.h>
#ifdef WIN32
#include <isc/ntpaths.h>
#endif /* ifdef WIN32 */
@@ -1736,6 +1738,7 @@ main(int argc, char *argv[]) {
dns_namelist_t namelist;
unsigned int resopt;
isc_appctx_t *actx = NULL;
isc_nm_t *netmgr = NULL;
isc_taskmgr_t *taskmgr = NULL;
isc_socketmgr_t *socketmgr = NULL;
isc_timermgr_t *timermgr = NULL;
@@ -1759,9 +1762,8 @@ main(int argc, char *argv[]) {
isc_mem_create(&mctx);
CHECK(isc_appctx_create(mctx, &actx));
CHECK(isc_taskmgr_createinctx(mctx, 1, 0, &taskmgr));
CHECK(isc_socketmgr_createinctx(mctx, &socketmgr));
CHECK(isc_timermgr_createinctx(mctx, &timermgr));
isc_managers_create(mctx, 1, 0, 0, &netmgr, &taskmgr, &timermgr,
&socketmgr);
parse_args(argc, argv);
@@ -1781,8 +1783,8 @@ main(int argc, char *argv[]) {
#endif /* ifndef WIN32 */
/* Create client */
result = dns_client_createx(mctx, actx, taskmgr, socketmgr, timermgr, 0,
&client, srcaddr4, srcaddr6);
result = dns_client_create(mctx, actx, taskmgr, socketmgr, timermgr, 0,
&client, srcaddr4, srcaddr6);
if (result != ISC_R_SUCCESS) {
delv_log(ISC_LOG_ERROR, "dns_client_create: %s",
isc_result_totext(result));
@@ -1802,7 +1804,7 @@ main(int argc, char *argv[]) {
CHECK(convert_name(&qfn, &query_name, qname));
/* Set up resolution options */
resopt = DNS_CLIENTRESOPT_ALLOWRUN | DNS_CLIENTRESOPT_NOCDFLAG;
resopt = DNS_CLIENTRESOPT_NOCDFLAG;
if (no_sigs) {
resopt |= DNS_CLIENTRESOPT_NODNSSEC;
}
@@ -1864,15 +1866,7 @@ cleanup:
if (client != NULL) {
dns_client_destroy(&client);
}
if (taskmgr != NULL) {
isc_taskmgr_destroy(&taskmgr);
}
if (timermgr != NULL) {
isc_timermgr_destroy(&timermgr);
}
if (socketmgr != NULL) {
isc_socketmgr_destroy(&socketmgr);
}
isc_managers_destroy(&netmgr, &taskmgr, &timermgr, &socketmgr);
if (actx != NULL) {
isc_appctx_destroy(&actx);
}
+3 -3
View File
@@ -480,8 +480,8 @@ abbreviation is unambiguous; for example, ``+cd`` is equivalent to
``+nssearch`` or ``+trace`` query option is used.
``+retry=T``
This option sets the number of times to retry UDP queries to server to ``T``
instead of the default, 2. Unlike ``+tries``, this does not include
This option sets the number of times to retry UDP and TCP queries to server to ``T``
instead of the default, 2. Unlike ``+tries``, this does not include
the initial query.
``+[no]rrcomments``
@@ -569,7 +569,7 @@ abbreviation is unambiguous; for example, ``+cd`` is equivalent to
default queries from a name server.
``+tries=T``
This option sets the number of times to try UDP queries to server to ``T``
This option sets the number of times to try UDP and TCP queries to server to ``T``
instead of the default, 3. If ``T`` is less than or equal to zero,
the number of tries is silently rounded up to 1.
+66 -83
View File
@@ -41,6 +41,7 @@
#include <isc/hex.h>
#include <isc/lang.h>
#include <isc/log.h>
#include <isc/managers.h>
#include <isc/netaddr.h>
#include <isc/netdb.h>
#include <isc/nonce.h>
@@ -106,9 +107,9 @@ unsigned int timeout = 0;
unsigned int extrabytes;
isc_mem_t *mctx = NULL;
isc_log_t *lctx = NULL;
isc_nm_t *netmgr = NULL;
isc_taskmgr_t *taskmgr = NULL;
isc_task_t *global_task = NULL;
isc_nm_t *netmgr = NULL;
isc_sockaddr_t localaddr;
isc_refcount_t sendcount = ATOMIC_VAR_INIT(0);
isc_refcount_t recvcount = ATOMIC_VAR_INIT(0);
@@ -226,8 +227,9 @@ void (*dighost_shutdown)(void);
/* forward declarations */
#define cancel_lookup(l) _cancel_lookup(l, __FILE__, __LINE__)
static void
cancel_lookup(dig_lookup_t *lookup);
_cancel_lookup(dig_lookup_t *lookup, const char *file, unsigned int line);
static void
recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
@@ -795,8 +797,8 @@ clone_lookup(dig_lookup_t *lookold, bool servers) {
memmove(looknew->ecs_addr, lookold->ecs_addr, len);
}
dns_name_copynf(dns_fixedname_name(&lookold->fdomain),
dns_fixedname_name(&looknew->fdomain));
dns_name_copy(dns_fixedname_name(&lookold->fdomain),
dns_fixedname_name(&looknew->fdomain));
if (servers) {
clone_server_list(lookold->my_server_list,
@@ -1360,10 +1362,7 @@ setup_libs(void) {
isc_log_setdebuglevel(lctx, 0);
netmgr = isc_nm_start(mctx, 1);
result = isc_taskmgr_create(mctx, 1, 0, netmgr, &taskmgr);
check_result(result, "isc_taskmgr_create");
isc_managers_create(mctx, 1, 0, 0, &netmgr, &taskmgr, NULL, NULL);
result = isc_task_create(taskmgr, 0, &global_task);
check_result(result, "isc_task_create");
@@ -1541,12 +1540,13 @@ _destroy_lookup(dig_lookup_t *lookup) {
dig_server_t *s;
void *ptr;
REQUIRE(lookup != NULL);
REQUIRE(ISC_LIST_EMPTY(lookup->q));
debug("destroy_lookup");
isc_refcount_destroy(&lookup->references);
REQUIRE(ISC_LIST_EMPTY(lookup->q));
s = ISC_LIST_HEAD(lookup->my_server_list);
while (s != NULL) {
debug("freeing server %p belonging to %p", s, lookup);
@@ -1691,14 +1691,16 @@ _query_detach(dig_query_t **queryp, const char *file, unsigned int line) {
query_detach(&lookup->current_query);
}
if (ISC_LINK_LINKED(query, link)) {
ISC_LIST_UNLINK(lookup->q, query, link);
}
debug("%s:%u:query_detach(%p) = %" PRIuFAST32, file, line, query,
isc_refcount_current(&query->references) - 1);
if (isc_refcount_decrement(&query->references) == 1) {
INSIST(query->readhandle == NULL);
INSIST(query->sendhandle == NULL);
if (ISC_LINK_LINKED(query, link)) {
ISC_LIST_UNLINK(lookup->q, query, link);
}
destroy_query(query, file, line);
}
}
@@ -1752,13 +1754,18 @@ start_lookup(void) {
* decremented, current_lookup will not be set to NULL.)
*/
static void
clear_current_lookup() {
clear_current_lookup(void) {
dig_lookup_t *lookup = current_lookup;
INSIST(!free_now);
debug("clear_current_lookup()");
if (lookup == NULL) {
debug("current_lookup is already detached");
return;
}
if (ISC_LIST_HEAD(lookup->q) != NULL) {
debug("still have a worker");
return;
@@ -1883,7 +1890,7 @@ followup_lookup(dns_message_t *msg, dig_query_t *query, dns_section_t section) {
lookup->recurse = false;
}
domain = dns_fixedname_name(&lookup->fdomain);
dns_name_copynf(name, domain);
dns_name_copy(name, domain);
}
debug("adding server %s", namestr);
num = getaddresses(lookup, namestr, &lresult);
@@ -2058,7 +2065,6 @@ insert_soa(dig_lookup_t *lookup) {
result = dns_message_gettempname(lookup->sendmsg, &soaname);
check_result(result, "dns_message_gettempname");
dns_name_init(soaname, NULL);
dns_name_clone(lookup->name, soaname);
ISC_LIST_INIT(soaname->list);
ISC_LIST_APPEND(soaname->list, rdataset, link);
@@ -2156,7 +2162,6 @@ setup_lookup(dig_lookup_t *lookup) {
}
result = dns_message_gettempname(lookup->sendmsg, &lookup->name);
check_result(result, "dns_message_gettempname");
dns_name_init(lookup->name, NULL);
isc_buffer_init(&lookup->namebuf, lookup->name_space,
sizeof(lookup->name_space));
@@ -2200,7 +2205,6 @@ setup_lookup(dig_lookup_t *lookup) {
result = dns_message_gettempname(lookup->sendmsg,
&lookup->oname);
check_result(result, "dns_message_gettempname");
dns_name_init(lookup->oname, NULL);
/* XXX Helper funct to conv char* to name? */
origin = lookup->origin->origin;
#ifdef HAVE_LIBIDN2
@@ -2240,9 +2244,7 @@ setup_lookup(dig_lookup_t *lookup) {
name, lookup->oname,
lookup->name, &lookup->namebuf);
} else {
result = dns_name_copy(
name, lookup->name,
&lookup->namebuf);
dns_name_copy(name, lookup->name);
}
}
if (result != ISC_R_SUCCESS) {
@@ -2671,11 +2673,12 @@ send_done(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
/*%
* Cancel a lookup, sending canceling reads on all existing sockets.
*/
static void
cancel_lookup(dig_lookup_t *lookup) {
_cancel_lookup(dig_lookup_t *lookup, const char *file, unsigned int line) {
dig_query_t *query, *next;
debug("cancel_lookup()");
debug("%s:%u:%s()", file, line, __func__);
query = ISC_LIST_HEAD(lookup->q);
while (query != NULL) {
REQUIRE(DIG_VALID_QUERY(query));
@@ -2794,12 +2797,10 @@ start_tcp(dig_query_t *query) {
if (query->lookup->tls_mode) {
result = isc_tlsctx_createclient(&query->tlsctx);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
result = isc_nm_tlsdnsconnect(
netmgr, (isc_nmiface_t *)&localaddr,
(isc_nmiface_t *)&query->sockaddr,
tcp_connected, query, local_timeout, 0,
query->tlsctx);
check_result(result, "isc_nm_tlsdnsconnect");
isc_nm_tlsdnsconnect(netmgr, &localaddr,
&query->sockaddr, tcp_connected,
query, local_timeout, 0,
query->tlsctx);
} else if (query->lookup->https_mode) {
char uri[4096] = { 0 };
snprintf(uri, sizeof(uri), "https://%s:%u%s",
@@ -2814,18 +2815,14 @@ start_tcp(dig_query_t *query) {
query->tlsctx);
}
result = isc_nm_httpconnect(
netmgr, (isc_nmiface_t *)&localaddr,
(isc_nmiface_t *)&query->sockaddr, uri,
!query->lookup->https_get, tcp_connected, query,
query->tlsctx, local_timeout, 0);
check_result(result, "isc_nm_httpconnect");
isc_nm_httpconnect(netmgr, &localaddr, &query->sockaddr,
uri, !query->lookup->https_get,
tcp_connected, query, query->tlsctx,
local_timeout, 0);
} else {
result = isc_nm_tcpdnsconnect(
netmgr, (isc_nmiface_t *)&localaddr,
(isc_nmiface_t *)&query->sockaddr,
tcp_connected, query, local_timeout, 0);
check_result(result, "isc_nm_tcpdnsconnect");
isc_nm_tcpdnsconnect(netmgr, &localaddr,
&query->sockaddr, tcp_connected,
query, local_timeout, 0);
}
/* XXX: set DSCP */
@@ -2900,13 +2897,16 @@ udp_ready(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
query_detach(&query);
return;
} else if (eresult != ISC_R_SUCCESS) {
dig_lookup_t *l = query->lookup;
if (eresult != ISC_R_CANCELED) {
debug("udp setup failed: %s",
isc_result_totext(eresult));
}
if (query->tries == 0) {
query_detach(&query);
}
cancel_lookup(l);
lookup_detach(&l);
query_detach(&query);
return;
}
@@ -2942,6 +2942,7 @@ static void
start_udp(dig_query_t *query) {
isc_result_t result;
dig_query_t *next = NULL;
dig_query_t *connectquery = NULL;
REQUIRE(DIG_VALID_QUERY(query));
@@ -2993,24 +2994,10 @@ start_udp(dig_query_t *query) {
}
}
query->tries = 3;
do {
int local_timeout = timeout * 1000;
if (local_timeout == 0) {
local_timeout = UDP_TIMEOUT * 1000;
}
/*
* On FreeBSD the UDP connect() call sometimes results
* in a spurious transient EADDRINUSE. Try a few more times
* before giving up.
*/
debug("isc_nm_udpconnect(): %d tries left", --query->tries);
result = isc_nm_udpconnect(netmgr, (isc_nmiface_t *)&localaddr,
(isc_nmiface_t *)&query->sockaddr,
udp_ready, query, local_timeout, 0);
} while (result != ISC_R_SUCCESS && query->tries > 0);
check_result(result, "isc_nm_udpconnect");
query_attach(query, &connectquery);
isc_nm_udpconnect(netmgr, &localaddr, &query->sockaddr, udp_ready,
connectquery,
(timeout ? timeout : UDP_TIMEOUT) * 1000, 0);
}
/*%
@@ -3117,7 +3104,8 @@ force_next(dig_query_t *query) {
*/
static void
requeue_or_update_exitcode(dig_lookup_t *lookup) {
if (lookup->eoferr == 0U) {
if (lookup->eoferr == 0U && lookup->retries > 1) {
--lookup->retries;
/*
* Peer closed the connection prematurely for the first time
* for this lookup. Try again, keeping track of this failure.
@@ -3583,16 +3571,19 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
region, arg);
LOCK_LOOKUP;
lookup_attach(query->lookup, &l);
isc_refcount_decrement0(&recvcount);
debug("recvcount=%" PRIuFAST32, isc_refcount_current(&recvcount));
if (eresult == ISC_R_CANCELED) {
debug("recv_done: cancel");
goto detach_query;
isc_nmhandle_detach(&query->readhandle);
query_detach(&query);
return;
}
lookup_attach(query->lookup, &l);
if (query->lookup->use_usec) {
TIME_NOW_HIRES(&query->time_recv);
} else {
@@ -4203,19 +4194,23 @@ cancel_all(void) {
return;
}
atomic_store(&cancel_now, true);
if (current_lookup != NULL) {
while (current_lookup != NULL) {
for (q = ISC_LIST_HEAD(current_lookup->q); q != NULL; q = nq) {
nq = ISC_LIST_NEXT(q, link);
debug("canceling pending query %p, belonging to %p", q,
current_lookup);
if (q->readhandle != NULL) {
isc_refcount_decrement0(&recvcount);
debug("recvcount=%" PRIuFAST32,
isc_refcount_current(&recvcount));
isc_nm_cancelread(q->readhandle);
}
query_detach(&q);
}
lookup_detach(&current_lookup);
/*
* current_lookup could have been detached via query_detach().
*/
if (current_lookup != NULL) {
lookup_detach(&current_lookup);
}
}
l = ISC_LIST_HEAD(lookup_list);
while (l != NULL) {
@@ -4241,20 +4236,8 @@ destroy_libs(void) {
debug("freeing task");
isc_task_detach(&global_task);
}
/*
* The taskmgr_destroy() and isc_nm_destroy() calls block until
* all events are cleared.
*/
if (taskmgr != NULL) {
debug("freeing taskmgr");
isc_taskmgr_destroy(&taskmgr);
}
debug("closing down netmgr");
isc_nm_closedown(netmgr);
debug("destroy netmgr");
isc_nm_destroy(&netmgr);
isc_managers_destroy(&netmgr, &taskmgr, NULL, NULL);
LOCK_LOOKUP;
isc_refcount_destroy(&recvcount);
-1
View File
@@ -208,7 +208,6 @@ struct dig_query {
isc_time_t time_recv;
uint64_t byte_count;
isc_timer_t *timer;
uint8_t tries;
isc_tlsctx_t *tlsctx;
};
+2 -2
View File
@@ -379,7 +379,7 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
dns_rdataset_current(rdataset, &rdata);
result = dns_rdata_tostruct(&rdata, &cname, NULL);
check_result(result, "dns_rdata_tostruct");
dns_name_copynf(&cname.cname, qname);
dns_name_copy(&cname.cname, qname);
dns_rdata_freestruct(&cname);
}
}
@@ -442,7 +442,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
/* Add AAAA and MX lookups. */
name = dns_fixedname_initname(&fixed);
dns_name_copynf(query->lookup->name, name);
dns_name_copy(query->lookup->name, name);
chase_cnamechain(msg, name);
dns_name_format(name, namestr, sizeof(namestr));
lookup = clone_lookup(query->lookup, false);
+2 -2
View File
@@ -391,7 +391,7 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
dns_rdataset_current(rdataset, &rdata);
result = dns_rdata_tostruct(&rdata, &cname, NULL);
check_result(result, "dns_rdata_tostruct");
dns_name_copynf(&cname.cname, qname);
dns_name_copy(&cname.cname, qname);
dns_rdata_freestruct(&cname);
}
}
@@ -448,7 +448,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
/* Add AAAA lookup. */
name = dns_fixedname_initname(&fixed);
dns_name_copynf(query->lookup->name, name);
dns_name_copy(query->lookup->name, name);
chase_cnamechain(msg, name);
dns_name_format(name, namestr, sizeof(namestr));
lookup = clone_lookup(query->lookup, false);
+1 -1
View File
@@ -215,7 +215,7 @@ loadkey(char *filename, unsigned char *key_buf, unsigned int key_buf_size,
rdclass = dst_key_class(key);
name = dns_fixedname_initname(&fixed);
dns_name_copynf(dst_key_name(key), name);
dns_name_copy(dst_key_name(key), name);
dst_key_free(&key);
}
+1 -1
View File
@@ -185,7 +185,7 @@ loadkey(char *filename, unsigned char *key_buf, unsigned int key_buf_size,
rdclass = dst_key_class(key);
name = dns_fixedname_initname(&fixed);
dns_name_copynf(dst_key_name(key), name);
dns_name_copy(dst_key_name(key), name);
dst_key_free(&key);
}
+25 -18
View File
@@ -40,6 +40,7 @@
#include <isc/file.h>
#include <isc/hash.h>
#include <isc/hex.h>
#include <isc/managers.h>
#include <isc/md.h>
#include <isc/mem.h>
#include <isc/mutex.h>
@@ -144,6 +145,7 @@ static unsigned int nsigned = 0, nretained = 0, ndropped = 0;
static unsigned int nverified = 0, nverifyfailed = 0;
static const char *directory = NULL, *dsdir = NULL;
static isc_mutex_t namelock, statslock;
static isc_nm_t *netmgr = NULL;
static isc_taskmgr_t *taskmgr = NULL;
static dns_db_t *gdb; /* The database */
static dns_dbversion_t *gversion; /* The database version */
@@ -177,8 +179,9 @@ static bool remove_orphansigs = false;
static bool remove_inactkeysigs = false;
static bool output_dnssec_only = false;
static bool output_stdout = false;
bool set_maxttl = false;
static bool set_maxttl = false;
static dns_ttl_t maxttl = 0;
static bool no_max_check = false;
#define INCSTAT(counter) \
if (printstats) { \
@@ -198,7 +201,7 @@ savezonecut(dns_fixedname_t *fzonecut, dns_name_t *name) {
dns_name_t *result;
result = dns_fixedname_initname(fzonecut);
dns_name_copynf(name, result);
dns_name_copy(name, result);
return (result);
}
@@ -1334,8 +1337,8 @@ get_soa_ttls(void) {
result = dns_rdataset_first(&soaset);
check_result(result, "dns_rdataset_first");
dns_rdataset_current(&soaset, &rdata);
zone_soa_min_ttl = dns_soa_getminimum(&rdata);
soa_ttl = soaset.ttl;
zone_soa_min_ttl = ISC_MIN(dns_soa_getminimum(&rdata), soa_ttl);
if (set_maxttl) {
zone_soa_min_ttl = ISC_MIN(zone_soa_min_ttl, maxttl);
soa_ttl = ISC_MIN(soa_ttl, maxttl);
@@ -2394,7 +2397,7 @@ nsec3ify(unsigned int hashalg, dns_iterations_t iterations,
break;
}
if (result == ISC_R_NOMORE) {
dns_name_copynf(gorigin, nextname);
dns_name_copy(gorigin, nextname);
done = true;
} else if (result != ISC_R_SUCCESS) {
fatal("iterating through the database failed: %s",
@@ -2531,7 +2534,7 @@ nsec3ify(unsigned int hashalg, dns_iterations_t iterations,
break;
}
if (result == ISC_R_NOMORE) {
dns_name_copynf(gorigin, nextname);
dns_name_copy(gorigin, nextname);
done = true;
} else if (result != ISC_R_SUCCESS) {
fatal("iterating through the database failed: %s",
@@ -3438,6 +3441,12 @@ main(int argc, char *argv[]) {
case 'H':
set_iter = true;
/* too-many is NOT DOCUMENTED */
if (strcmp(isc_commandline_argument, "too-many") == 0) {
nsec3iter = 151;
no_max_check = true;
break;
}
nsec3iter = strtoul(isc_commandline_argument, &endp, 0);
if (*endp != '\0') {
fatal("iterations must be numeric");
@@ -3856,7 +3865,6 @@ main(int argc, char *argv[]) {
warnifallksk(gdb);
if (IS_NSEC3) {
unsigned int max;
bool answer;
hash_length = dns_nsec3_hashlength(dns_hash_sha1);
@@ -3875,12 +3883,15 @@ main(int argc, char *argv[]) {
"NSEC-only DNSKEY");
}
result = dns_nsec3_maxiterations(gdb, NULL, mctx, &max);
check_result(result, "dns_nsec3_maxiterations()");
if (nsec3iter > max) {
fatal("NSEC3 iterations too big for weakest DNSKEY "
"strength. Maximum iterations allowed %u.",
max);
if (nsec3iter > dns_nsec3_maxiterations()) {
if (no_max_check) {
fprintf(stderr,
"Ignoring max iterations check.\n");
} else {
fatal("NSEC3 iterations too big. Maximum "
"iterations allowed %u.",
dns_nsec3_maxiterations());
}
}
} else {
hashlist_init(&hashlist, 0, 0); /* silence clang */
@@ -3953,11 +3964,7 @@ main(int argc, char *argv[]) {
print_time(outfp);
print_version(outfp);
result = isc_taskmgr_create(mctx, ntasks, 0, NULL, &taskmgr);
if (result != ISC_R_SUCCESS) {
fatal("failed to create task manager: %s",
isc_result_totext(result));
}
isc_managers_create(mctx, ntasks, 0, 0, &netmgr, &taskmgr, NULL, NULL);
master = NULL;
result = isc_task_create(taskmgr, 0, &master);
@@ -4008,7 +4015,7 @@ main(int argc, char *argv[]) {
for (i = 0; i < (int)ntasks; i++) {
isc_task_detach(&tasks[i]);
}
isc_taskmgr_destroy(&taskmgr);
isc_managers_destroy(&netmgr, &taskmgr, NULL, NULL);
isc_mem_put(mctx, tasks, ntasks * sizeof(isc_task_t *));
postsign();
TIME_NOW(&sign_finish);
+6 -2
View File
@@ -123,6 +123,8 @@ options {\n\
tcp-initial-timeout 300;\n\
tcp-keepalive-timeout 300;\n\
tcp-listen-queue 10;\n\
tcp-receive-buffer 0;\n\
tcp-send-buffer 0;\n\
# tkey-dhkey <none>\n\
# tkey-domain <none>\n\
# tkey-gssapi-credential <none>\n\
@@ -133,6 +135,8 @@ options {\n\
# treat-cr-as-space <obsolete>;\n\
trust-anchor-telemetry yes;\n\
# use-id-pool <obsolete>;\n\
udp-receive-buffer 0;\n\
udp-send-buffer 0;\n\
\n\
/* view */\n\
allow-new-zones no;\n\
@@ -195,8 +199,8 @@ options {\n\
root-key-sentinel yes;\n\
servfail-ttl 1;\n\
# sortlist <none>\n\
stale-answer-client-timeout off;\n\
stale-answer-enable false;\n\
stale-answer-client-timeout 1800; /* in milliseconds */\n\
stale-answer-ttl 30; /* 30 seconds */\n\
stale-cache-enable false;\n\
stale-refresh-time 30; /* 30 seconds */\n\
@@ -225,7 +229,7 @@ options {\n\
dnssec-update-mode maintain;\n\
# forward <none>\n\
# forwarders <none>\n\
inline-signing no;\n\
# inline-signing no;\n\
ixfr-from-differences false;\n\
# maintain-ixfr-base <obsolete>;\n\
# max-ixfr-log-size <obsolete>\n\
+4 -4
View File
@@ -1164,10 +1164,9 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
}
#endif
CHECK(isc_nm_listentcp(named_g_nm, (isc_nmiface_t *)&listener->address,
control_newconn, listener,
sizeof(controlconnection_t), 5, NULL,
&listener->sock));
CHECK(isc_nm_listentcp(
named_g_netmgr, &listener->address, control_newconn, listener,
sizeof(controlconnection_t), 5, NULL, &listener->sock));
#if 0
/* XXX: no unix socket support yet */
if (type == isc_socktype_unix) {
@@ -1467,6 +1466,7 @@ named_controls_create(named_server_t *server, named_controls_t **ctrlsp) {
ISC_LIST_INIT(controls->listeners);
atomic_init(&controls->shuttingdown, false);
isc_mutex_init(&controls->symtab_lock);
LOCK(&controls->symtab_lock);
result = isccc_cc_createsymtab(&controls->symtab);
+1 -1
View File
@@ -62,7 +62,7 @@ EXTERN bool named_g_run_done INIT(false);
*/
EXTERN isc_timermgr_t *named_g_timermgr INIT(NULL);
EXTERN isc_socketmgr_t *named_g_socketmgr INIT(NULL);
EXTERN isc_nm_t *named_g_nm INIT(NULL);
EXTERN isc_nm_t *named_g_netmgr INIT(NULL);
EXTERN cfg_parser_t *named_g_parser INIT(NULL);
EXTERN cfg_parser_t *named_g_addparser INIT(NULL);
EXTERN const char *named_g_version INIT(PACKAGE_VERSION);
+32 -84
View File
@@ -31,6 +31,7 @@
#include <isc/hash.h>
#include <isc/hp.h>
#include <isc/httpd.h>
#include <isc/managers.h>
#include <isc/netmgr.h>
#include <isc/os.h>
#include <isc/platform.h>
@@ -205,8 +206,6 @@ assertion_failed(const char *file, int line, isc_assertiontype_t type,
const char *cond) {
void *tracebuf[BACKTRACE_MAXFRAME];
int nframes;
isc_result_t result;
const char *logsuffix = "";
/*
* Handle assertion failures.
@@ -219,32 +218,23 @@ assertion_failed(const char *file, int line, isc_assertiontype_t type,
*/
isc_assertion_setcallback(NULL);
result = isc_backtrace_gettrace(tracebuf, BACKTRACE_MAXFRAME,
&nframes);
if (result == ISC_R_SUCCESS && nframes > 0) {
logsuffix = ", back trace";
}
nframes = isc_backtrace(tracebuf, BACKTRACE_MAXFRAME);
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL,
"%s:%d: %s(%s) failed%s", file, line,
isc_assertion_typetotext(type), cond, logsuffix);
if (result == ISC_R_SUCCESS) {
#if HAVE_BACKTRACE_SYMBOLS
char **strs = backtrace_symbols(tracebuf, nframes);
for (int i = 0; i < nframes; i++) {
isc_log_write(named_g_lctx,
NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN,
ISC_LOG_CRITICAL, "%s", strs[i]);
isc_assertion_typetotext(type), cond,
(nframes > 0) ? ", back trace" : "");
if (nframes > 0) {
char **strs = isc_backtrace_symbols(tracebuf, nframes);
if (strs != NULL) {
for (int i = 0; i < nframes; i++) {
isc_log_write(named_g_lctx,
NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN,
ISC_LOG_CRITICAL, "%s",
strs[i]);
}
}
#else /* HAVE_BACKTRACE_SYMBOLS */
for (int i = 0; i < nframes; i++) {
isc_log_write(
named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL,
"#%d %p in ??", i, tracebuf[i]);
}
#endif /* HAVE_BACKTRACE_SYMBOLS */
}
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL,
@@ -330,11 +320,14 @@ library_unexpected_error(const char *file, int line, const char *format,
static void
usage(void) {
fprintf(stderr, "usage: named [-4|-6] [-c conffile] [-d debuglevel] "
"[-E engine] [-f|-g]\n"
" [-n number_of_cpus] [-p port] [-s] "
"[-S sockets] [-t chrootdir]\n"
" [-u username] [-U listeners] "
"[-m {usage|trace|record|size|mctx}]\n"
"[-D comment] [-E engine]\n"
" [-f|-g] [-L logfile] [-n number_of_cpus] "
"[-p port] [-s]\n"
" [-S sockets] [-t chrootdir] [-u "
"username] [-U listeners]\n"
" [-X lockfile] [-m "
"{usage|trace|record|size|mctx}]\n"
" [-M fill|nofill]\n"
"usage: named [-v|-V]\n");
}
@@ -945,45 +938,17 @@ create_managers(void) {
"using %u UDP listener%s per interface", named_g_udpdisp,
named_g_udpdisp == 1 ? "" : "s");
/*
* We have ncpus network threads, ncpus worker threads, ncpus
* old network threads - make it 4x just to be safe. The memory
* impact is negligible.
*/
isc_hp_init(4 * named_g_cpus);
named_g_nm = isc_nm_start(named_g_mctx, named_g_cpus);
if (named_g_nm == NULL) {
UNEXPECTED_ERROR(__FILE__, __LINE__, "isc_nm_start() failed");
return (ISC_R_UNEXPECTED);
result = isc_managers_create(named_g_mctx, named_g_cpus,
0 /* quantum */, maxsocks, &named_g_netmgr,
&named_g_taskmgr, &named_g_timermgr,
&named_g_socketmgr);
if (result != ISC_R_SUCCESS) {
return (result);
}
result = isc_taskmgr_create(named_g_mctx, named_g_cpus, 0, named_g_nm,
&named_g_taskmgr);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_taskmgr_create() failed: %s",
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
}
result = isc_timermgr_create(named_g_mctx, &named_g_timermgr);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_timermgr_create() failed: %s",
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
}
result = isc_socketmgr_create2(named_g_mctx, &named_g_socketmgr,
maxsocks, named_g_cpus);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_socketmgr_create() failed: %s",
isc_result_totext(result));
return (ISC_R_UNEXPECTED);
}
isc_socketmgr_maxudp(named_g_socketmgr, maxudp);
isc_nm_maxudp(named_g_nm, maxudp);
isc_nm_maxudp(named_g_netmgr, maxudp);
result = isc_socketmgr_getmaxsockets(named_g_socketmgr, &socks);
if (result == ISC_R_SUCCESS) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
@@ -996,25 +961,8 @@ create_managers(void) {
static void
destroy_managers(void) {
/*
* isc_nm_closedown() closes all active connections, freeing
* attached clients and other resources and preventing new
* connections from being established, but it not does not
* stop all processing or destroy the netmgr yet.
*/
isc_nm_closedown(named_g_nm);
/*
* isc_taskmgr_destroy() will block until all tasks have exited.
*/
isc_taskmgr_destroy(&named_g_taskmgr);
isc_timermgr_destroy(&named_g_timermgr);
isc_socketmgr_destroy(&named_g_socketmgr);
/*
* At this point is safe to destroy the netmgr.
*/
isc_nm_destroy(&named_g_nm);
isc_managers_destroy(&named_g_netmgr, &named_g_taskmgr,
&named_g_timermgr, &named_g_socketmgr);
}
static void
+4 -2
View File
@@ -276,7 +276,6 @@ OPTIONS
hostname ( quoted_string | none );
http-port integer;
https-port integer;
inline-signing boolean;
interface-interval duration;
ipv4only-contact string;
ipv4only-enable boolean;
@@ -433,6 +432,8 @@ OPTIONS
tcp-initial-timeout integer;
tcp-keepalive-timeout integer;
tcp-listen-queue integer;
tcp-receive-buffer integer;
tcp-send-buffer integer;
tkey-dhkey quoted_string integer;
tkey-domain quoted_string;
tkey-gssapi-credential quoted_string;
@@ -449,6 +450,8 @@ OPTIONS
transfers-per-ns integer;
trust-anchor-telemetry boolean; // experimental
try-tcp-refresh boolean;
udp-receive-buffer integer;
udp-send-buffer integer;
update-check-ksk boolean;
use-alt-transfer-source boolean;
use-v4-udp-ports { portrange; ... };
@@ -666,7 +669,6 @@ VIEW
forwarders [ port integer ] [ dscp integer ] { ( ipv4_address
| ipv6_address ) [ port integer ] [ dscp integer ]; ... };
glue-cache boolean;// deprecated
inline-signing boolean;
ipv4only-contact string;
ipv4only-enable boolean;
ipv4only-server string;
+167 -42
View File
@@ -5081,8 +5081,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
/*
* Copy the aclenv object.
*/
dns_aclenv_copy(&view->aclenv, ns_interfacemgr_getaclenv(
named_g_server->interfacemgr));
dns_aclenv_copy(view->aclenv, ns_interfacemgr_getaclenv(
named_g_server->interfacemgr));
/*
* Configure the "match-clients" and "match-destinations" ACL.
@@ -7330,7 +7330,7 @@ dotat(dns_keytable_t *keytable, dns_keynode_t *keynode, dns_name_t *keyname,
tat->view = NULL;
dns_rdataset_init(&tat->rdataset);
dns_rdataset_init(&tat->sigrdataset);
dns_name_copynf(keyname, dns_fixedname_initname(&tat->keyname));
dns_name_copy(keyname, dns_fixedname_initname(&tat->keyname));
result = get_tat_qname(dns_fixedname_initname(&tat->tatname), keyname,
keynode);
if (result != ISC_R_SUCCESS) {
@@ -8503,6 +8503,10 @@ load_configuration(const char *filename, named_server_t *server,
uint32_t reserved;
uint32_t udpsize;
uint32_t transfer_message_size;
uint32_t recv_tcp_buffer_size;
uint32_t send_tcp_buffer_size;
uint32_t recv_udp_buffer_size;
uint32_t send_udp_buffer_size;
named_cache_t *nsc;
named_cachelist_t cachelist, tmpcachelist;
ns_altsecret_t *altsecret;
@@ -8774,6 +8778,9 @@ load_configuration(const char *filename, named_server_t *server,
named_g_aclconfctx),
"configuring statistics server(s)");
/*
* Configure the network manager
*/
obj = NULL;
result = named_config_get(maps, "tcp-initial-timeout", &obj);
INSIST(result == ISC_R_SUCCESS);
@@ -8840,7 +8847,46 @@ load_configuration(const char *filename, named_server_t *server,
advertised = MAX_ADVERTISED_TIMEOUT;
}
isc_nm_settimeouts(named_g_nm, initial, idle, keepalive, advertised);
isc_nm_settimeouts(named_g_netmgr, initial, idle, keepalive,
advertised);
#define CAP_IF_NOT_ZERO(v, min, max) \
if (v > 0 && v < min) { \
recv_tcp_buffer_size = min; \
} else if (v > max) { \
recv_tcp_buffer_size = max; \
}
/* Set the kernel send and receive buffer sizes */
obj = NULL;
result = named_config_get(maps, "tcp-receive-buffer", &obj);
INSIST(result == ISC_R_SUCCESS);
recv_tcp_buffer_size = cfg_obj_asuint32(obj);
CAP_IF_NOT_ZERO(recv_tcp_buffer_size, 4096, INT32_MAX);
obj = NULL;
result = named_config_get(maps, "tcp-send-buffer", &obj);
INSIST(result == ISC_R_SUCCESS);
send_tcp_buffer_size = cfg_obj_asuint32(obj);
CAP_IF_NOT_ZERO(send_tcp_buffer_size, 4096, INT32_MAX);
obj = NULL;
result = named_config_get(maps, "udp-receive-buffer", &obj);
INSIST(result == ISC_R_SUCCESS);
recv_udp_buffer_size = cfg_obj_asuint32(obj);
CAP_IF_NOT_ZERO(recv_udp_buffer_size, 4096, INT32_MAX);
obj = NULL;
result = named_config_get(maps, "udp-send-buffer", &obj);
INSIST(result == ISC_R_SUCCESS);
send_udp_buffer_size = cfg_obj_asuint32(obj);
CAP_IF_NOT_ZERO(send_udp_buffer_size, 4096, INT32_MAX);
isc_nm_setnetbuffers(named_g_netmgr, recv_tcp_buffer_size,
send_tcp_buffer_size, recv_udp_buffer_size,
send_udp_buffer_size);
#undef CAP_IF_NOT_ZERO
/*
* Configure sets of UDP query source ports.
@@ -9174,7 +9220,7 @@ load_configuration(const char *filename, named_server_t *server,
dns_kasp_detach(&kasp);
}
/*
* Create the built-in kasp policies ("default", "none").
* Create the built-in kasp policies ("default", "insecure").
*/
kasp = NULL;
CHECK(cfg_kasp_fromconfig(NULL, "default", named_g_mctx, named_g_lctx,
@@ -9184,7 +9230,7 @@ load_configuration(const char *filename, named_server_t *server,
dns_kasp_detach(&kasp);
kasp = NULL;
CHECK(cfg_kasp_fromconfig(NULL, "none", named_g_mctx, named_g_lctx,
CHECK(cfg_kasp_fromconfig(NULL, "insecure", named_g_mctx, named_g_lctx,
&kasplist, &kasp));
INSIST(kasp != NULL);
dns_kasp_freeze(kasp);
@@ -9868,8 +9914,9 @@ view_loaded(void *arg) {
static isc_result_t
load_zones(named_server_t *server, bool init, bool reconfig) {
isc_result_t result;
dns_view_t *view;
ns_zoneload_t *zl;
isc_taskmgr_t *taskmgr = dns_zonemgr_gettaskmgr(server->zonemgr);
ns_zoneload_t *zl = NULL;
dns_view_t *view = NULL;
zl = isc_mem_get(server->mctx, sizeof(*zl));
zl->server = server;
@@ -9921,19 +9968,28 @@ cleanup:
if (isc_refcount_decrement(&zl->refs) == 1) {
isc_refcount_destroy(&zl->refs);
isc_mem_put(server->mctx, zl, sizeof(*zl));
} else if (init) {
/*
* Place the task manager into privileged mode. This
* ensures that after we leave task-exclusive mode, no
* other tasks will be able to run except for the ones
* that are loading zones. (This should only be done during
* the initial server setup; it isn't necessary during
* a reload.)
*/
isc_taskmgr_setprivilegedmode(named_g_taskmgr);
}
isc_task_endexclusive(server->task);
if (init) {
/*
* If we're setting up the server for the first time, set
* the task manager into privileged mode; this ensures
* that no other tasks will begin to run until after zone
* loading is complete. We won't return from exclusive mode
* until the loading is finished; we can then drop out of
* privileged mode.
*
* We do *not* want to do this in the case of reload or
* reconfig, as loading a large zone could cause the server
* to be inactive for too long a time.
*/
isc_taskmgr_setmode(taskmgr, isc_taskmgrmode_privileged);
isc_task_endexclusive(server->task);
isc_taskmgr_setmode(taskmgr, isc_taskmgrmode_normal);
} else {
isc_task_endexclusive(server->task);
}
return (result);
}
@@ -9960,7 +10016,7 @@ run_server(isc_task_t *task, isc_event_t *event) {
CHECKFATAL(ns_interfacemgr_create(
named_g_mctx, server->sctx, named_g_taskmgr,
named_g_timermgr, named_g_socketmgr, named_g_nm,
named_g_timermgr, named_g_socketmgr, named_g_netmgr,
named_g_dispatchmgr, server->task, named_g_udpdisp,
geoip, named_g_cpus, &server->interfacemgr),
"creating interface manager");
@@ -10191,7 +10247,7 @@ named_server_create(isc_mem_t *mctx, named_server_t **serverp) {
* startup and shutdown of the server, as well as all exclusive
* tasks.
*/
CHECKFATAL(isc_task_create(named_g_taskmgr, 0, &server->task),
CHECKFATAL(isc_task_create_bound(named_g_taskmgr, 0, &server->task, 0),
"creating server task");
isc_task_setname(server->task, "server", server);
isc_taskmgr_setexcltask(named_g_taskmgr, server->task);
@@ -10230,7 +10286,7 @@ named_server_create(isc_mem_t *mctx, named_server_t **serverp) {
CHECKFATAL(dns_zonemgr_create(named_g_mctx, named_g_taskmgr,
named_g_timermgr, named_g_socketmgr,
named_g_nm, &server->zonemgr),
named_g_netmgr, &server->zonemgr),
"dns_zonemgr_create");
CHECKFATAL(dns_zonemgr_setsize(server->zonemgr, 1000), "dns_zonemgr_"
"setsize");
@@ -10270,7 +10326,7 @@ named_server_create(isc_mem_t *mctx, named_server_t **serverp) {
isc_sockstatscounter_max),
"isc_stats_create");
isc_socketmgr_setstats(named_g_socketmgr, server->sockstats);
isc_nm_setstats(named_g_nm, server->sockstats);
isc_nm_setstats(named_g_netmgr, server->sockstats);
CHECKFATAL(isc_stats_create(named_g_mctx, &server->zonestats,
dns_zonestatscounter_max),
@@ -11431,7 +11487,7 @@ resume:
";\n; Cache dump of view '%s' (cache %s)\n;\n",
dctx->view->view->name,
dns_cache_getname(dctx->view->view->cache));
result = dns_master_dumptostreaminc(
result = dns_master_dumptostreamasync(
dctx->mctx, dctx->cache, NULL, style, dctx->fp,
dctx->task, dumpdone, dctx, &dctx->mdctx);
if (result == DNS_R_CONTINUE) {
@@ -11491,7 +11547,7 @@ resume:
goto nextzone;
}
dns_db_currentversion(dctx->db, &dctx->version);
result = dns_master_dumptostreaminc(
result = dns_master_dumptostreamasync(
dctx->mctx, dctx->db, dctx->version, style,
dctx->fp, dctx->task, dumpdone, dctx,
&dctx->mdctx);
@@ -13693,13 +13749,13 @@ do_addzone(named_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view,
#ifndef HAVE_LMDB
FILE *fp = NULL;
bool cleanup_config = false;
#else /* HAVE_LMDB */
#else /* HAVE_LMDB */
MDB_txn *txn = NULL;
MDB_dbi dbi;
bool locked = false;
UNUSED(zoneconf);
LOCK(&view->new_zone_lock);
#endif /* HAVE_LMDB */
#endif
/* Zone shouldn't already exist */
if (redirect) {
@@ -13719,12 +13775,16 @@ do_addzone(named_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view,
goto cleanup;
}
result = isc_task_beginexclusive(server->task);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
#ifndef HAVE_LMDB
/*
* Make sure we can open the configuration save file
*/
result = isc_stdio_open(view->new_zone_file, "a", &fp);
if (result != ISC_R_SUCCESS) {
isc_task_endexclusive(server->task);
TCHECK(putstr(text, "unable to create '"));
TCHECK(putstr(text, view->new_zone_file));
TCHECK(putstr(text, "': "));
@@ -13735,9 +13795,12 @@ do_addzone(named_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view,
(void)isc_stdio_close(fp);
fp = NULL;
#else /* HAVE_LMDB */
LOCK(&view->new_zone_lock);
locked = true;
/* Make sure we can open the NZD database */
result = nzd_writable(view);
if (result != ISC_R_SUCCESS) {
isc_task_endexclusive(server->task);
TCHECK(putstr(text, "unable to open NZD database for '"));
TCHECK(putstr(text, view->new_zone_db));
TCHECK(putstr(text, "'"));
@@ -13746,9 +13809,6 @@ do_addzone(named_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view,
}
#endif /* HAVE_LMDB */
result = isc_task_beginexclusive(server->task);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
/* Mark view unfrozen and configure zone */
dns_view_thaw(view);
result = configure_zone(cfg->config, zoneobj, cfg->vconfig,
@@ -13852,7 +13912,9 @@ cleanup:
if (txn != NULL) {
(void)nzd_close(&txn, false);
}
UNLOCK(&view->new_zone_lock);
if (locked) {
UNLOCK(&view->new_zone_lock);
}
#endif /* HAVE_LMDB */
if (zone != NULL) {
@@ -13876,7 +13938,7 @@ do_modzone(named_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view,
#else /* HAVE_LMDB */
MDB_txn *txn = NULL;
MDB_dbi dbi;
LOCK(&view->new_zone_lock);
bool locked = false;
#endif /* HAVE_LMDB */
/* Zone must already exist */
@@ -13922,6 +13984,8 @@ do_modzone(named_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view,
(void)isc_stdio_close(fp);
fp = NULL;
#else /* HAVE_LMDB */
LOCK(&view->new_zone_lock);
locked = true;
/* Make sure we can open the NZD database */
result = nzd_writable(view);
if (result != ISC_R_SUCCESS) {
@@ -14074,7 +14138,9 @@ cleanup:
if (txn != NULL) {
(void)nzd_close(&txn, false);
}
UNLOCK(&view->new_zone_lock);
if (locked) {
UNLOCK(&view->new_zone_lock);
}
#endif /* HAVE_LMDB */
if (zone != NULL) {
@@ -14786,7 +14852,8 @@ named_server_signing(named_server_t *server, isc_lex_t *lex,
return (ISC_R_BADNUMBER);
}
if (hash > 0xffU || flags > 0xffU) {
if (hash > 0xffU || flags > 0xffU ||
iter > dns_nsec3_maxiterations()) {
return (ISC_R_RANGE);
}
@@ -14826,7 +14893,7 @@ named_server_signing(named_server_t *server, isc_lex_t *lex,
CHECK(ISC_R_UNEXPECTEDEND);
}
if (dns_zone_use_kasp(zone)) {
if (dns_zone_getkasp(zone) != NULL) {
(void)putstr(text, "zone uses dnssec-policy, use rndc dnssec "
"command instead");
(void)putnull(text);
@@ -14934,8 +15001,8 @@ named_server_dnssec(named_server_t *server, isc_lex_t *lex,
isc_result_t result = ISC_R_SUCCESS;
dns_zone_t *zone = NULL;
dns_kasp_t *kasp = NULL;
dns_dnsseckeylist_t keys;
dns_dnsseckey_t *key;
dns_dnsseckeylist_t keys, dnskeys;
dns_dnsseckey_t *key, *key_next = NULL;
char *ptr, *zonetext = NULL;
const char *msg = NULL;
/* variables for -checkds */
@@ -14952,6 +15019,11 @@ named_server_dnssec(named_server_t *server, isc_lex_t *lex,
isc_stdtime_t now, when;
isc_time_t timenow, timewhen;
const char *dir;
dns_name_t *origin;
dns_db_t *db = NULL;
dns_dbnode_t *node = NULL;
dns_dbversion_t *version = NULL;
dns_rdataset_t keyset;
/* Skip the command name. */
ptr = next_token(lex, text);
@@ -14970,7 +15042,9 @@ named_server_dnssec(named_server_t *server, isc_lex_t *lex,
now = isc_time_seconds(&timenow);
when = now;
ISC_LIST_INIT(dnskeys);
ISC_LIST_INIT(keys);
dns_rdataset_init(&keyset);
if (strcasecmp(ptr, "-status") == 0) {
status = true;
@@ -15083,13 +15157,46 @@ named_server_dnssec(named_server_t *server, isc_lex_t *lex,
/* Get DNSSEC keys. */
dir = dns_zone_getkeydirectory(zone);
LOCK(&kasp->lock);
origin = dns_zone_getorigin(zone);
CHECK(dns_zone_getdb(zone, &db));
CHECK(dns_db_findnode(db, origin, false, &node));
dns_db_currentversion(db, &version);
/* Get keys from private key files. */
dns_zone_lock_keyfiles(zone);
result = dns_dnssec_findmatchingkeys(dns_zone_getorigin(zone), dir, now,
dns_zone_getmctx(zone), &keys);
UNLOCK(&kasp->lock);
dns_zone_unlock_keyfiles(zone);
if (result != ISC_R_SUCCESS && result != ISC_R_NOTFOUND) {
goto cleanup;
}
/* Get public keys (dnskeys). */
result = dns_db_findrdataset(db, node, version, dns_rdatatype_dnskey,
dns_rdatatype_none, 0, &keyset, NULL);
if (result == ISC_R_SUCCESS) {
CHECK(dns_dnssec_keylistfromrdataset(
origin, dir, dns_zone_getmctx(zone), &keyset, NULL,
NULL, false, false, &dnskeys));
} else if (result != ISC_R_NOTFOUND) {
CHECK(result);
}
/* Add new 'dnskeys' to 'keys'. */
for (dns_dnsseckey_t *k1 = ISC_LIST_HEAD(dnskeys); k1 != NULL;
k1 = key_next) {
dns_dnsseckey_t *k2 = NULL;
key_next = ISC_LIST_NEXT(k1, link);
for (k2 = ISC_LIST_HEAD(keys); k2 != NULL;
k2 = ISC_LIST_NEXT(k2, link)) {
if (dst_key_compare(k1->key, k2->key)) {
break;
}
}
/* No match found, add the new key. */
if (k2 == NULL) {
ISC_LIST_UNLINK(dnskeys, k1, link);
ISC_LIST_APPEND(keys, k1, link);
}
}
if (status) {
/*
@@ -15209,6 +15316,24 @@ cleanup:
(void)putnull(text);
}
if (dns_rdataset_isassociated(&keyset)) {
dns_rdataset_disassociate(&keyset);
}
if (node != NULL) {
dns_db_detachnode(db, &node);
}
if (version != NULL) {
dns_db_closeversion(db, &version, false);
}
if (db != NULL) {
dns_db_detach(&db);
}
while (!ISC_LIST_EMPTY(dnskeys)) {
key = ISC_LIST_HEAD(dnskeys);
ISC_LIST_UNLINK(dnskeys, key, link);
dns_dnsseckey_destroy(dns_zone_getmctx(zone), &key);
}
while (!ISC_LIST_EMPTY(keys)) {
key = ISC_LIST_HEAD(keys);
ISC_LIST_UNLINK(keys, key, link);
@@ -16283,7 +16408,7 @@ named_server_tcptimeouts(isc_lex_t *lex, isc_buffer_t **text) {
return (ISC_R_UNEXPECTEDEND);
}
isc_nm_gettimeouts(named_g_nm, &initial, &idle, &keepalive,
isc_nm_gettimeouts(named_g_netmgr, &initial, &idle, &keepalive,
&advertised);
/* Look for optional arguments. */
@@ -16337,7 +16462,7 @@ named_server_tcptimeouts(isc_lex_t *lex, isc_buffer_t **text) {
result = isc_task_beginexclusive(named_g_server->task);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
isc_nm_settimeouts(named_g_nm, initial, idle, keepalive,
isc_nm_settimeouts(named_g_netmgr, initial, idle, keepalive,
advertised);
isc_task_endexclusive(named_g_server->task);
+1 -1
View File
@@ -3612,7 +3612,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
CHECK(ISC_R_FAMILYNOSUPPORT);
}
CHECK(isc_httpdmgr_create(named_g_nm, server->mctx, addr, client_ok,
CHECK(isc_httpdmgr_create(named_g_netmgr, server->mctx, addr, client_ok,
destroy_listener, listener,
&listener->httpdmgr));
+1 -1
View File
@@ -379,7 +379,7 @@ all_digits(const char *s) {
return (false);
}
while (*s != '\0') {
if (!isdigit((*s) & 0xff)) {
if (!isdigit((unsigned char)(*s))) {
return (false);
}
s++;
+22 -25
View File
@@ -272,8 +272,8 @@ configure_zone_ssutable(const cfg_obj_t *zconfig, dns_zone_t *zone,
dns_fixedname_init(&fname);
if (usezone) {
dns_name_copynf(dns_zone_getorigin(zone),
dns_fixedname_name(&fname));
dns_name_copy(dns_zone_getorigin(zone),
dns_fixedname_name(&fname));
} else {
str = cfg_obj_asstring(dname);
isc_buffer_constinit(&b, str, strlen(str));
@@ -1249,15 +1249,23 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
result = named_config_get(maps, "dnssec-policy", &obj);
if (result == ISC_R_SUCCESS) {
kaspname = cfg_obj_asstring(obj);
result = dns_kasplist_find(kasplist, kaspname, &kasp);
if (result != ISC_R_SUCCESS) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_ERROR,
"'dnssec-policy '%s' not found ",
kaspname);
RETERR(result);
if (strcmp(kaspname, "none") != 0) {
result = dns_kasplist_find(kasplist, kaspname,
&kasp);
if (result != ISC_R_SUCCESS) {
cfg_obj_log(
obj, named_g_lctx,
ISC_LOG_ERROR,
"dnssec-policy '%s' not found ",
kaspname);
RETERR(result);
}
dns_zone_setkasp(zone, kasp);
use_kasp = true;
}
dns_zone_setkasp(zone, kasp);
use_kasp = dns_zone_use_kasp(zone);
}
if (!use_kasp) {
dns_zone_setkasp(zone, NULL);
}
obj = NULL;
@@ -1671,10 +1679,11 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
obj = NULL;
result = cfg_map_get(zoptions, "auto-dnssec", &obj);
if (kasp != NULL && strcmp(dns_kasp_getname(kasp), "none") != 0)
{
if (kasp != NULL) {
bool s2i = (strcmp(dns_kasp_getname(kasp),
"insecure") != 0);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_ALLOW, true);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_CREATE, true);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_CREATE, !s2i);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_MAINTAIN, true);
} else if (result == ISC_R_SUCCESS) {
const char *arg = cfg_obj_asstring(obj);
@@ -1691,11 +1700,6 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setkeyopt(zone, DNS_ZONEKEY_ALLOW, allow);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_CREATE, false);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_MAINTAIN, maint);
} else {
bool s2i = dns_zone_secure_to_insecure(zone, false);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_ALLOW, s2i);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_CREATE, false);
dns_zone_setkeyopt(zone, DNS_ZONEKEY_MAINTAIN, s2i);
}
}
@@ -2216,13 +2220,6 @@ named_zone_inlinesigning(dns_zone_t *zone, const cfg_obj_t *zconfig,
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"inline-signing: "
"implicitly through dnssec-policy");
} else {
inline_signing = dns_zone_secure_to_insecure(zone,
true);
dns_zone_log(
zone, ISC_LOG_DEBUG(1), "inline-signing: %s",
inline_signing ? "transitioning to insecure"
: "no");
}
}
+21 -25
View File
@@ -29,6 +29,7 @@
#include <isc/hash.h>
#include <isc/lex.h>
#include <isc/log.h>
#include <isc/managers.h>
#include <isc/mem.h>
#include <isc/nonce.h>
#include <isc/parseint.h>
@@ -57,6 +58,7 @@
#include <dns/masterdump.h>
#include <dns/message.h>
#include <dns/name.h>
#include <dns/nsec3.h>
#include <dns/rcode.h>
#include <dns/rdata.h>
#include <dns/rdataclass.h>
@@ -125,6 +127,7 @@ static bool usegsstsig = false;
static bool use_win2k_gsstsig = false;
static bool tried_other_gsstsig = false;
static bool local_only = false;
static isc_nm_t *netmgr = NULL;
static isc_taskmgr_t *taskmgr = NULL;
static isc_task_t *global_task = NULL;
static isc_event_t *global_event = NULL;
@@ -921,14 +924,8 @@ setup_system(void) {
result = dns_dispatchmgr_create(gmctx, &dispatchmgr);
check_result(result, "dns_dispatchmgr_create");
result = isc_socketmgr_create(gmctx, &socketmgr);
check_result(result, "dns_socketmgr_create");
result = isc_timermgr_create(gmctx, &timermgr);
check_result(result, "dns_timermgr_create");
result = isc_taskmgr_create(gmctx, 1, 0, NULL, &taskmgr);
check_result(result, "isc_taskmgr_create");
isc_managers_create(gmctx, 1, 0, 0, &netmgr, &taskmgr, &timermgr,
&socketmgr);
result = isc_task_create(taskmgr, 0, &global_task);
check_result(result, "isc_task_create");
@@ -1267,7 +1264,6 @@ static uint16_t
parse_name(char **cmdlinep, dns_message_t *msg, dns_name_t **namep) {
isc_result_t result;
char *word;
isc_buffer_t *namebuf = NULL;
isc_buffer_t source;
word = nsu_strsep(cmdlinep, " \t\r\n");
@@ -1278,10 +1274,6 @@ parse_name(char **cmdlinep, dns_message_t *msg, dns_name_t **namep) {
result = dns_message_gettempname(msg, namep);
check_result(result, "dns_message_gettempname");
isc_buffer_allocate(gmctx, &namebuf, DNS_NAME_MAXWIRE);
dns_name_init(*namep, NULL);
dns_name_setbuffer(*namep, namebuf);
dns_message_takebuffer(msg, &namebuf);
isc_buffer_init(&source, word, strlen(word));
isc_buffer_add(&source, strlen(word));
result = dns_name_fromtext(*namep, &source, dns_rootname, 0, NULL);
@@ -1965,6 +1957,19 @@ parseclass:
}
}
if (!isdelete && rdata->type == dns_rdatatype_nsec3param) {
dns_rdata_nsec3param_t nsec3param;
result = dns_rdata_tostruct(rdata, &nsec3param, NULL);
check_result(result, "dns_rdata_tostruct");
if (nsec3param.iterations > dns_nsec3_maxiterations()) {
fprintf(stderr,
"NSEC3PARAM has excessive iterations (> %u)\n",
dns_nsec3_maxiterations());
goto failure;
}
}
doneparsing:
result = dns_message_gettemprdatalist(updatemsg, &rdatalist);
@@ -2063,7 +2068,6 @@ setzone(dns_name_t *zonename) {
if (zonename != NULL) {
result = dns_message_gettempname(updatemsg, &name);
check_result(result, "dns_message_gettempname");
dns_name_init(name, NULL);
dns_name_clone(zonename, name);
result = dns_message_gettemprdataset(updatemsg, &rdataset);
check_result(result, "dns_message_gettemprdataset");
@@ -2726,7 +2730,7 @@ lookforsoa:
* address.
*/
zname = dns_fixedname_initname(&fzname);
dns_name_copynf(name, zname);
dns_name_copy(name, zname);
}
if (debugging) {
@@ -3238,7 +3242,6 @@ start_update(void) {
dns_rdataset_makequestion(rdataset, getzoneclass(), dns_rdatatype_soa);
if (userzone != NULL) {
dns_name_init(name, NULL);
dns_name_clone(userzone, name);
} else {
dns_rdataset_t *tmprdataset;
@@ -3257,7 +3260,6 @@ start_update(void) {
}
firstname = NULL;
dns_message_currentname(updatemsg, section, &firstname);
dns_name_init(name, NULL);
dns_name_clone(firstname, name);
/*
* Looks to see if the first name references a DS record
@@ -3308,18 +3310,12 @@ cleanup(void) {
dst_key_free(&sig0key);
}
ddebug("Shutting down task manager");
isc_taskmgr_destroy(&taskmgr);
ddebug("Shutting down managers");
isc_managers_destroy(&netmgr, &taskmgr, &timermgr, &socketmgr);
ddebug("Destroying event");
isc_event_free(&global_event);
ddebug("Shutting down socket manager");
isc_socketmgr_destroy(&socketmgr);
ddebug("Shutting down timer manager");
isc_timermgr_destroy(&timermgr);
#ifdef HAVE_GSSAPI
/*
* Cleanup GSSAPI resources after taskmgr has been destroyed.
+6 -14
View File
@@ -22,6 +22,7 @@
#include <isc/commandline.h>
#include <isc/file.h>
#include <isc/log.h>
#include <isc/managers.h>
#include <isc/mem.h>
#include <isc/net.h>
#include <isc/netmgr.h>
@@ -59,6 +60,7 @@
const char *progname = NULL;
bool verbose;
static isc_nm_t *netmgr = NULL;
static isc_taskmgr_t *taskmgr = NULL;
static isc_task_t *rndc_task = NULL;
@@ -72,7 +74,6 @@ static bool local4set = false, local6set = false;
static int nserveraddrs;
static int currentaddr = 0;
static unsigned int remoteport = 0;
static isc_nm_t *netmgr = NULL;
static isc_buffer_t *databuf = NULL;
static isccc_ccmsg_t rndc_ccmsg;
static uint32_t algorithm;
@@ -574,7 +575,6 @@ rndc_connected(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
static void
rndc_startconnect(isc_sockaddr_t *addr) {
isc_result_t result;
char socktext[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_t *local = NULL;
@@ -600,10 +600,8 @@ rndc_startconnect(isc_sockaddr_t *addr) {
}
atomic_fetch_add_relaxed(&connects, 1);
DO("create connection",
isc_nm_tcpconnect(netmgr, (isc_nmiface_t *)local,
(isc_nmiface_t *)addr, rndc_connected, &rndc_ccmsg,
10000, 0));
isc_nm_tcpconnect(netmgr, local, addr, rndc_connected, &rndc_ccmsg,
60000, 0);
}
static void
@@ -1033,9 +1031,7 @@ main(int argc, char **argv) {
serial = isc_random32();
isc_mem_create(&rndc_mctx);
netmgr = isc_nm_start(rndc_mctx, 1);
DO("create task manager",
isc_taskmgr_create(rndc_mctx, 1, 0, netmgr, &taskmgr));
isc_managers_create(rndc_mctx, 1, 0, 0, &netmgr, &taskmgr, NULL, NULL);
DO("create task", isc_task_create(taskmgr, 0, &rndc_task));
isc_log_create(rndc_mctx, &log, &logconfig);
isc_log_setcontext(log);
@@ -1092,9 +1088,7 @@ main(int argc, char **argv) {
}
isc_task_detach(&rndc_task);
isc_taskmgr_destroy(&taskmgr);
isc_nm_closedown(netmgr);
isc_managers_destroy(&netmgr, &taskmgr, NULL, NULL);
/*
* Note: when TCP connections are shut down, there will be a final
@@ -1104,8 +1098,6 @@ main(int argc, char **argv) {
*/
isccc_ccmsg_invalidate(&rndc_ccmsg);
isc_nm_destroy(&netmgr);
isc_log_destroy(&log);
isc_log_setcontext(NULL);
+1 -1
View File
@@ -136,7 +136,7 @@ Currently supported commands are:
This sample ``addzone`` command adds the zone ``example.com`` to
the default view:
``$ \ rndc addzone example.com '{ type master; file "example.com.db"; };'``
``rndc addzone example.com '{ type master; file "example.com.db"; };'``
(Note the brackets around and semi-colon after the zone configuration
text.)
+2 -2
View File
@@ -1,3 +1,4 @@
.cache
__pycache__
dig.out*
rndc.out*
@@ -13,8 +14,7 @@ named.run
parallel.mk
/*.log
/*.trs
/get_ports.state
/get_ports.lock
/resolve
/run.sh
/run.log
/start.sh
+9 -3
View File
@@ -23,6 +23,7 @@ check_PROGRAMS = \
feature-test \
makejournal \
pipelined/pipequeries \
resolve \
rndc/gencheck \
rpz/dnsrps \
tkey/keycreate \
@@ -48,6 +49,14 @@ pipelined_pipequeries_LDADD = \
$(LDADD) \
$(LIBDNS_LIBS)
resolve_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
$(LIBIRS_CFLAGS)
resolve_LDADD = $(LIBISC_LIBS) $(LIBIRS_LIBS) $(LIBDNS_LIBS)
tkey_keycreate_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(LIBDNS_CFLAGS)
@@ -241,7 +250,4 @@ AM_LOG_FLAGS = -r
$(TESTS): run.sh
clean-local:
-rm -f get_ports.state get_ports.lock
test-local: check
+2
View File
@@ -0,0 +1,2 @@
@ IN SOA localhost. localhost.localhost. 1 10800 3600 605800 86400
@ IN NS localhost.
+89
View File
@@ -0,0 +1,89 @@
############################################################################
# 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 concurrent.futures
import os
import subprocess
import time
def run_rndc(server, rndc_command):
'''
Send the specified 'rndc_command' to 'server' with a timeout of 2 seconds
'''
rndc = os.getenv('RNDC')
port = os.getenv('CONTROLPORT')
cmdline = [rndc, '-c', '../common/rndc.conf', '-p', port, '-s', server]
cmdline.extend(rndc_command)
subprocess.check_output(cmdline, stderr=subprocess.STDOUT, timeout=2)
def rndc_loop(test_state, domain):
'''
Run "rndc addzone", "rndc modzone", and "rndc delzone" in a tight loop
until the test is considered finished, ignoring errors
'''
rndc_commands = [
['addzone', domain,
'{ type master; file "example.db"; };'],
['modzone', domain,
'{ type master; file "example.db"; allow-transfer { any; }; };'],
['delzone', domain],
]
while not test_state['finished']:
for command in rndc_commands:
try:
run_rndc('10.53.0.3', command)
except subprocess.SubprocessError:
pass
def check_if_server_is_responsive():
'''
Check if server status can be successfully retrieved using "rndc status"
'''
try:
run_rndc('10.53.0.3', ['status'])
return True
except subprocess.SubprocessError:
return False
def test_rndc_deadlock():
'''
Test whether running "rndc addzone", "rndc modzone", and "rndc delzone"
commands concurrently does not trigger a deadlock
'''
test_state = {'finished': False}
# Create 4 worker threads running "rndc" commands in a loop.
with concurrent.futures.ThreadPoolExecutor() as executor:
for i in range(1, 5):
domain = 'example%d' % i
executor.submit(rndc_loop, test_state, domain)
# Run "rndc status" in 1-second intervals for a maximum of 10 seconds.
# If any "rndc status" command fails, the loop will be interrupted.
server_is_responsive = True
attempts = 10
while server_is_responsive and attempts > 0:
server_is_responsive = check_if_server_is_responsive()
attempts -= 1
time.sleep(1)
# Signal worker threads that the test is finished.
test_state['finished'] = True
# Check whether all "rndc status" commands succeeded.
assert server_is_responsive
+1 -1
View File
@@ -1590,7 +1590,7 @@ status=`expr $status + $ret`
echo_i "check that DNAME at apex with NSEC3 is correctly signed (auto-dnssec maintain) ($n)"
ret=0
$DIG $DIGOPTS txt dname-at-apex-nsec3.example @10.53.0.3 > dig.out.ns3.test$n || ret=1
grep "RRSIG NSEC3 7 3 3600" dig.out.ns3.test$n > /dev/null || ret=1
grep "RRSIG NSEC3 7 3 600" dig.out.ns3.test$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -0,0 +1 @@
-m record,size,mctx -c named.conf -d 1 -D cacheclean-ns1 -X named.lock -g -T maxcachesize=2097152
@@ -0,0 +1 @@
-m record,size,mctx -c named.conf -d 3 -D cacheclean-ns2 -X named.lock -g -T maxcachesize=2097152
+28
View File
@@ -80,6 +80,34 @@ sub reply_handler {
$rr = new Net::DNS::RR("$synth2 $ttl $qclass DNAME .");
push @ans, $rr;
$rcode = "NOERROR";
# The following three code branches referring to the "example.dname"
# zone are necessary for the resolver variant of the CVE-2021-25215
# regression test to work. A named instance cannot be used for
# serving the DNAME records below as a version of BIND vulnerable to
# CVE-2021-25215 would crash while answering the queries asked by
# the tested resolver.
} elsif ($qname eq "ns3.example.dname") {
if ($qtype eq "A") {
my $rr = new Net::DNS::RR("$qname $ttl $qclass A 10.53.0.3");
push @ans, $rr;
}
if ($qtype eq "AAAA") {
my $rr = new Net::DNS::RR("example.dname. $ttl $qclass SOA . . 0 0 0 0 $ttl");
push @auth, $rr;
}
$rcode = "NOERROR";
} elsif ($qname eq "self.example.self.example.dname") {
my $rr = new Net::DNS::RR("self.example.dname. $ttl $qclass DNAME dname.");
push @ans, $rr;
$rr = new Net::DNS::RR("$qname $ttl $qclass CNAME self.example.dname.");
push @ans, $rr;
$rcode = "NOERROR";
} elsif ($qname eq "self.example.dname") {
if ($qtype eq "DNAME") {
my $rr = new Net::DNS::RR("$qname $ttl $qclass DNAME dname.");
push @ans, $rr;
}
$rcode = "NOERROR";
} else {
$rcode = "REFUSED";
}
+4
View File
@@ -24,6 +24,10 @@ ns2.example. A 10.53.0.2
example.broken. NS ns3.example.broken.
ns3.example.broken. A 10.53.0.3
; for the resolver variant of the CVE-2021-25215 regression test
example.dname. NS ns3.example.dname.
ns3.example.dname. A 10.53.0.3
domain0.nil. NS ns2.domain0.nil
domain1.nil. NS ns2.domain0.nil
domain2.nil. NS ns2.domain0.nil
+2
View File
@@ -16,3 +16,5 @@ ns2 86400 AAAA fd92:7065:b8e:ffff::2
@ 86400 AAAA 1:2:3::4
* 86400 A 1.2.3.4
* 86400 AAAA 1:2:3::4
; CVE-2021-25215 regression test data
self 86400 DNAME nil.
+18
View File
@@ -295,5 +295,23 @@ grep 'status: NOERROR' dig.out.7.$n > /dev/null 2>&1 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
# Regression test for CVE-2021-25215 (authoritative server).
n=`expr $n + 1`
echo_i "checking DNAME resolution via itself (authoritative) ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.2 DNAME self.domain0.self.domain0.nil. > dig.out.2.$n 2>&1
grep 'status: NOERROR' dig.out.2.$n > /dev/null 2>&1 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
# Regression test for CVE-2021-25215 (recursive resolver).
n=`expr $n + 1`
echo_i "checking DNAME resolution via itself (recursive) ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.7 DNAME self.example.self.example.dname. > dig.out.7.$n 2>&1
grep 'status: NOERROR' dig.out.7.$n > /dev/null 2>&1 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
@@ -0,0 +1,22 @@
/*
* 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.
*/
/*
* inline-signing not allowed at options level.
*/
options {
inline-signing yes;
};
zone "." {
type primary;
file "root.db";
};
@@ -0,0 +1,29 @@
/*
* 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.
*/
/*
* inline-signing not allowed at view level.
*/
view "a" {
inline-signing yes;
zone "." {
type primary;
file "root.db.signed";
};
};
view "b" {
zone "." {
type primary;
file "root.db";
};
};
@@ -9,7 +9,7 @@
* information regarding copyright ownership.
*/
// Using the keyword 'default' is not allowed.
// 'default' is a built-in policy, redefinition not allowed.
dnssec-policy "default" {
signatures-refresh P5D;
};
@@ -19,4 +19,3 @@ zone "example.net" {
file "example.db";
dnssec-policy "default";
};
@@ -0,0 +1,21 @@
/*
* 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.
*/
// 'insecure' is a built-in policy, redefinition not allowed.
dnssec-policy "insecure" {
signatures-refresh P5D;
};
zone "example.net" {
type master;
file "example.db";
dnssec-policy "insecure";
};
@@ -9,7 +9,7 @@
* information regarding copyright ownership.
*/
// Using the keyword 'none' is not allowed.
// 'none' is a built-in policy, redefinition not allowed.
dnssec-policy "none" {
signatures-refresh P5D;
};
@@ -19,4 +19,3 @@ zone "example.net" {
file "example.db";
dnssec-policy "none";
};
@@ -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 "keyforview1" {
algorithm "hmac-sha1";
secret "YPfMoAk6h+3iN8MDRQC004iSNHY=";
};
key "keyforview2" {
algorithm "hmac-sha1";
secret "4xILSZQnuO1UKubXHkYUsvBRPu8=";
};
view "example1" {
match-clients { key "keyforview1"; };
zone "example.net" {
type primary;
dnssec-policy "default";
key-directory ".";
file "example1.db";
};
};
view "example2" {
match-clients { key "keyforview2"; };
zone "example.net" {
type primary;
dnssec-policy "insecure";
key-directory ".";
file "example2.db";
};
};
@@ -0,0 +1,40 @@
/*
* 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 "keyforview1" {
algorithm "hmac-sha1";
secret "YPfMoAk6h+3iN8MDRQC004iSNHY=";
};
key "keyforview2" {
algorithm "hmac-sha1";
secret "4xILSZQnuO1UKubXHkYUsvBRPu8=";
};
view "example1" {
match-clients { key "keyforview1"; };
zone "example.net" {
type primary;
dnssec-policy "default";
file "example1.db";
};
};
view "example2" {
match-clients { key "keyforview2"; };
zone "example.net" {
type primary;
dnssec-policy "insecure";
file "example2.db";
};
};
@@ -0,0 +1,26 @@
/*
* 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.
*/
// One zone with dnssec-policy 'none', one zone with dnssec-policy 'insecure',
// both using the same zone file.
zone "example1.net" {
type master;
file "example.db";
dnssec-policy "none";
};
zone "example2.net" {
type master;
file "example.db";
dnssec-policy "insecure";
};
@@ -0,0 +1,26 @@
/*
* 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.
*/
// One zone with a dnssec-policy, the other with allow-update,
// with the same zone file.
zone "example1.net" {
type master;
file "example.db";
dnssec-policy "default";
};
zone "example2.net" {
type master;
file "example.db";
allow-update { any; };
};
@@ -0,0 +1,28 @@
/*
* 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.
*/
// One zone with a dnssec-policy, the other with update-policy,
// with the same zone file.
zone "example1.net" {
type master;
file "example.db";
dnssec-policy "default";
};
zone "example2.net" {
type master;
file "example.db";
update-policy {
grant * self * TXT;
};
};
@@ -0,0 +1,26 @@
/*
* 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.
*/
// One zone transitioning to insecure, the other with allow-update,
// with the same zone file.
zone "example1.net" {
type master;
file "example.db";
dnssec-policy "insecure";
};
zone "example2.net" {
type master;
file "example.db";
allow-update { any; };
};
+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 http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
// Two zones with dnssec-policy with the same zone file.
zone "example1.net" {
type master;
file "example.db";
dnssec-policy "default";
};
zone "example2.net" {
type master;
file "example.db";
dnssec-policy "default";
};
+26
View File
@@ -0,0 +1,26 @@
/*
* 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.
*/
// Two zones with dnssec-policy 'insecure' (transitioning to insecure)
// with the same zone file.
zone "example1.net" {
type master;
file "example.db";
dnssec-policy "insecure";
};
zone "example2.net" {
type master;
file "example.db";
dnssec-policy "insecure";
};
+26
View File
@@ -0,0 +1,26 @@
/*
* 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.
*/
// One zone with dnssec-policy, the other zone has 'dnssec-policy none',
// both with the same zone file.
zone "example1.net" {
type master;
file "example.db";
dnssec-policy "default";
};
zone "example2.net" {
type master;
file "example.db";
dnssec-policy "none";
};
+26
View File
@@ -0,0 +1,26 @@
/*
* 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.
*/
// One zone with dnssec-policy, the other zone has 'dnssec-policy insecure'
// (transitioning to inseure), both with the same zone file.
zone "example1.net" {
type master;
file "example.db";
dnssec-policy "default";
};
zone "example2.net" {
type master;
file "example.db";
dnssec-policy "insecure";
};
+7 -2
View File
@@ -49,8 +49,13 @@ zone "example3" {
file "example3.db";
dnssec-policy "default";
};
zone "example4" {
zone "dnssec-policy-none-shared-zonefile1" {
type master;
file "example4.db";
file "shared.db";
dnssec-policy "none";
};
zone "dnssec-policy-none-shared-zonefile2" {
type master;
file "shared.db";
dnssec-policy "none";
};
+46
View File
@@ -192,7 +192,53 @@ view "fourth" {
file "dnssec-none.db";
dnssec-policy "none";
};
zone "dnssec-view1" {
type master;
file "dnssec-view41.db";
dnssec-policy "test";
};
zone "dnssec-view2" {
type master;
file "dnssec-view42.db";
};
zone "dnssec-view3" {
type master;
file "dnssec-view43.db";
dnssec-policy "none";
key-directory "keys";
};
zone "dnssec-view4" {
type master;
file "dnssec-view44.db";
dnssec-policy "none";
};
dnssec-policy "default";
key-directory ".";
};
view "fifth" {
zone "dnssec-view1" {
type master;
file "dnssec-view51.db";
dnssec-policy "test";
};
zone "dnssec-view2" {
type master;
file "dnssec-view52.db";
dnssec-policy "test";
key-directory "keys";
};
zone "dnssec-view3" {
type master;
file "dnssec-view53.db";
dnssec-policy "default";
key-directory "keys";
};
zone "dnssec-view4" {
type master;
file "dnssec-view54.db";
dnssec-policy "none";
};
key-directory ".";
};
view "chaos" chaos {
zone "hostname.bind" chaos {
+8
View File
@@ -13,4 +13,12 @@ dnssec-test IN fourth master
dnssec-default IN fourth master
dnssec-inherit IN fourth master
dnssec-none IN fourth master
dnssec-view1 IN fourth master
dnssec-view2 IN fourth master
dnssec-view3 IN fourth master
dnssec-view4 IN fourth master
dnssec-view1 IN fifth master
dnssec-view2 IN fifth master
dnssec-view3 IN fifth master
dnssec-view4 IN fifth master
hostname.bind chaos chaos master
@@ -27,28 +27,28 @@ dnssec-policy "rsasha256" {
keys {
csk lifetime P10Y algorithm rsasha256 2048;
};
nsec3param iterations 500;
nsec3param iterations 150;
};
dnssec-policy "rsasha256-bad" {
keys {
csk lifetime P10Y algorithm rsasha256 2048;
};
nsec3param iterations 501;
nsec3param iterations 151;
};
dnssec-policy "rsasha512" {
keys {
csk lifetime P10Y algorithm rsasha512 4096;
};
nsec3param iterations 2500;
nsec3param iterations 150;
};
dnssec-policy "rsasha512-bad" {
keys {
csk lifetime P10Y algorithm rsasha512 4096;
};
nsec3param iterations 2501;
nsec3param iterations 151;
};
zone "example.net" {
+4 -2
View File
@@ -12,6 +12,8 @@
status=0
n=0
mkdir keys
n=`expr $n + 1`
echo_i "checking that named-checkconf handles a known good config ($n)"
ret=0
@@ -495,8 +497,6 @@ echo_i "checking named-checkconf kasp nsec3 iterations errors ($n)"
ret=0
$CHECKCONF kasp-bad-nsec3-iter.conf > checkconf.out$n 2>&1 && ret=1
grep "dnssec-policy: nsec3 iterations value 151 out of range" < checkconf.out$n > /dev/null || ret=1
grep "dnssec-policy: nsec3 iterations value 501 out of range" < checkconf.out$n > /dev/null || ret=1
grep "dnssec-policy: nsec3 iterations value 2501 out of range" < checkconf.out$n > /dev/null || ret=1
lines=$(wc -l < "checkconf.out$n")
if [ $lines != 3 ]; then ret=1; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
@@ -551,5 +551,7 @@ grep "exceeds 100%" < checkconf.out$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi
status=`expr $status + $ret`
rmdir keys
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
+1 -1
View File
@@ -713,6 +713,7 @@ export KEYGEN
export KEYSETTOOL
export KEYSIGNER
export KRB5_CONFIG
export KRB5_KTNAME
export MAKEJOURNAL
export MDIG
export NAMED
@@ -730,7 +731,6 @@ export PYTHON
export RESOLVE
export RNDC
export RRCHECKER
export SAMPLEUPDATE
export SIGNER
export SUBDIRS
export TMPDIR
+3 -2
View File
@@ -51,7 +51,7 @@ NZD2NZF=$TOP_BUILDDIR/bin/tools/named-nzd2nzf
PK11DEL="$TOP_BUILDDIR/bin/pkcs11/pkcs11-destroy -s ${SLOT:-0} -p ${HSMPIN:-1234} -w 0"
PK11GEN="$TOP_BUILDDIR/bin/pkcs11/pkcs11-keygen -q -s ${SLOT:-0} -p ${HSMPIN:-1234}"
PK11LIST="$TOP_BUILDDIR/bin/pkcs11/pkcs11-list -s ${SLOT:-0} -p ${HSMPIN:-1234}"
RESOLVE=$TOP_BUILDDIR/lib/samples/resolve
RESOLVE=$TOP_BUILDDIR/bin/tests/system/resolve
REVOKE=$TOP_BUILDDIR/bin/dnssec/dnssec-revoke
RNDC=$TOP_BUILDDIR/bin/rndc/rndc
RNDCCONFGEN=$TOP_BUILDDIR/bin/confgen/rndc-confgen
@@ -68,10 +68,11 @@ KEYCREATE=$TOP_BUILDDIR/bin/tests/system/tkey/keycreate
KEYDELETE=$TOP_BUILDDIR/bin/tests/system/tkey/keydelete
MAKEJOURNAL=$TOP_BUILDDIR/bin/tests/system/makejournal
PIPEQUERIES=$TOP_BUILDDIR/bin/tests/system/pipelined/pipequeries
SAMPLEUPDATE=$TOP_BUILDDIR/lib/samples/sample-update
# we don't want a KRB5_CONFIG setting breaking the tests
KRB5_CONFIG=/dev/null
# use local keytab instead of default /etc/krb5.keytab
KRB5_KTNAME=dns.keytab
#
# Construct the lists of tests to run
+1 -3
View File
@@ -51,12 +51,10 @@ NZD2NZF=$TOP_BUILDDIR/Build/$VSCONF/named-nzd2nzf@EXEEXT@
PK11DEL="$TOP_BUILDDIR/Build/$VSCONF/pkcs11-destroy@EXEEXT@ -s ${SLOT:-0} -p ${HSMPIN:-1234} -w 0"
PK11GEN="$TOP_BUILDDIR/Build/$VSCONF/pkcs11-keygen@EXEEXT@ -q -s ${SLOT:-0} -p ${HSMPIN:-1234}"
PK11LIST="$TOP_BUILDDIR/Build/$VSCONF/pkcs11-list@EXEEXT@ -s ${SLOT:-0} -p ${HSMPIN:-1234}"
RESOLVE=$TOP_BUILDDIR/lib/samples/resolve
REVOKE=$TOP_BUILDDIR/Build/$VSCONF/dnssec-revoke@EXEEXT@
RNDC=$TOP_BUILDDIR/Build/$VSCONF/rndc@EXEEXT@
RNDCCONFGEN=$TOP_BUILDDIR/Build/$VSCONF/rndc-confgen@EXEEXT@
RRCHECKER=$TOP_BUILDDIR/Build/$VSCONF/named-rrchecker@EXEEXT@
SAMPLEUPDATE=$TOP_BUILDDIR/Build/$VSCONF/update@EXEEXT@
SETTIME=$TOP_BUILDDIR/Build/$VSCONF/dnssec-settime@EXEEXT@
SIGNER=$TOP_BUILDDIR/Build/$VSCONF/dnssec-signzone@EXEEXT@
TSIGKEYGEN=$TOP_BUILDDIR/Build/$VSCONF/tsig-keygen@EXEEXT@
@@ -71,7 +69,7 @@ KEYCREATE=$TOP_BUILDDIR/Build/$VSCONF/keycreate@EXEEXT@
KEYDELETE=$TOP_BUILDDIR/Build/$VSCONF/keydelete@EXEEXT@
MAKEJOURNAL=$TOP_BUILDDIR/Build/$VSCONF/makejournal@EXEEXT@
PIPEQUERIES=$TOP_BUILDDIR/Build/$VSCONF/pipequeries@EXEEXT@
# to port SAMPLEUPDATE=$TOP_BUILDDIR/lib/samples/sample-update
RESOLVE=$TOP_BUILDDIR/Build/$VSCONF/resolve@EXEEXT@
# we don't want a KRB5_CONFIG setting breaking the tests
KRB5_CONFIG=NUL
+25 -6
View File
@@ -801,7 +801,7 @@ if [ -x "$DIG" ] ; then
echo_i "checking exit code for a retry upon TCP EOF (immediate -> immediate) ($n)"
ret=0
echo "no_response no_response" | sendcmd 10.53.0.5
dig_with_opts @10.53.0.5 example AXFR +tries=1 > dig.out.test$n 2>&1 && ret=1
dig_with_opts @10.53.0.5 example AXFR +tries=2 > dig.out.test$n 2>&1 && ret=1
# Sanity check: ensure ans5 behaves as expected.
[ `grep "communications error.*end of file" dig.out.test$n | wc -l` -eq 2 ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
@@ -811,7 +811,7 @@ if [ -x "$DIG" ] ; then
echo_i "checking exit code for a retry upon TCP EOF (partial AXFR -> partial AXFR) ($n)"
ret=0
echo "partial_axfr partial_axfr" | sendcmd 10.53.0.5
dig_with_opts @10.53.0.5 example AXFR +tries=1 > dig.out.test$n 2>&1 && ret=1
dig_with_opts @10.53.0.5 example AXFR +tries=2 > dig.out.test$n 2>&1 && ret=1
# Sanity check: ensure ans5 behaves as expected.
[ `grep "communications error.*end of file" dig.out.test$n | wc -l` -eq 2 ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
@@ -821,7 +821,7 @@ if [ -x "$DIG" ] ; then
echo_i "checking exit code for a retry upon TCP EOF (immediate -> partial AXFR) ($n)"
ret=0
echo "no_response partial_axfr" | sendcmd 10.53.0.5
dig_with_opts @10.53.0.5 example AXFR +tries=1 > dig.out.test$n 2>&1 && ret=1
dig_with_opts @10.53.0.5 example AXFR +tries=2 > dig.out.test$n 2>&1 && ret=1
# Sanity check: ensure ans5 behaves as expected.
[ `grep "communications error.*end of file" dig.out.test$n | wc -l` -eq 2 ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
@@ -831,7 +831,7 @@ if [ -x "$DIG" ] ; then
echo_i "checking exit code for a retry upon TCP EOF (partial AXFR -> immediate) ($n)"
ret=0
echo "partial_axfr no_response" | sendcmd 10.53.0.5
dig_with_opts @10.53.0.5 example AXFR +tries=1 > dig.out.test$n 2>&1 && ret=1
dig_with_opts @10.53.0.5 example AXFR +tries=2 > dig.out.test$n 2>&1 && ret=1
# Sanity check: ensure ans5 behaves as expected.
[ `grep "communications error.*end of file" dig.out.test$n | wc -l` -eq 2 ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
@@ -841,7 +841,7 @@ if [ -x "$DIG" ] ; then
echo_i "checking exit code for a retry upon TCP EOF (immediate -> complete AXFR) ($n)"
ret=0
echo "no_response complete_axfr" | sendcmd 10.53.0.5
dig_with_opts @10.53.0.5 example AXFR +tries=1 > dig.out.test$n 2>&1 || ret=1
dig_with_opts @10.53.0.5 example AXFR +tries=2 > dig.out.test$n 2>&1 || ret=1
# Sanity check: ensure ans5 behaves as expected.
[ `grep "communications error.*end of file" dig.out.test$n | wc -l` -eq 1 ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
@@ -851,7 +851,26 @@ if [ -x "$DIG" ] ; then
echo_i "checking exit code for a retry upon TCP EOF (partial AXFR -> complete AXFR) ($n)"
ret=0
echo "partial_axfr complete_axfr" | sendcmd 10.53.0.5
dig_with_opts @10.53.0.5 example AXFR +tries=1 > dig.out.test$n 2>&1 || ret=1
dig_with_opts @10.53.0.5 example AXFR +tries=2 > dig.out.test$n 2>&1 || ret=1
# Sanity check: ensure ans5 behaves as expected.
[ `grep "communications error.*end of file" dig.out.test$n | wc -l` -eq 1 ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "checking +tries=1 won't retry twice upon TCP EOF ($n)"
ret=0
echo "no_response no_response" | sendcmd 10.53.0.5
dig_with_opts @10.53.0.5 example AXFR +tries=1 > dig.out.test$n 2>&1 && ret=1
# Sanity check: ensure ans5 behaves as expected.
[ `grep "communications error.*end of file" dig.out.test$n | wc -l` -eq 1 ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "checking +retry=0 won't retry twice upon TCP EOF ($n)"
ret=0
dig_with_opts @10.53.0.5 example AXFR +retry=0 > dig.out.test$n 2>&1 && ret=1
# Sanity check: ensure ans5 behaves as expected.
[ `grep "communications error.*end of file" dig.out.test$n | wc -l` -eq 1 ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
@@ -4,11 +4,10 @@ AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS)
dlzexternal_LTLIBRARIES = dlzexternal.la
dlzexternaldir = $(abs_builddir)
check_LTLIBRARIES = dlzexternal.la
dlzexternal_la_SOURCES = \
driver.c \
driver.h
dlzexternal_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
dlzexternal_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath $(abs_builddir)
+1
View File
@@ -25,6 +25,7 @@ rm -f ./canonical?.*
rm -f ./delv.out*
rm -f ./delve.out*
rm -f ./dig.out.*
rm -f ./ns2/too-many-iterations.db
rm -f ./dnssectools.out*
rm -f ./dsfromkey.out.*
rm -f ./keygen.err
+2
View File
@@ -31,3 +31,5 @@ ns6.optout-tld. A 10.53.0.6
in-addr.arpa. NS ns2.example.
inprogress. NS ns10.inprogress.
ns10.inprogress. A 10.53.0.10
too-many-iterations. NS ns2.too-many-iterations.
ns2.too-many-iterations. A 10.53.0.2
+1
View File
@@ -26,6 +26,7 @@ echo_i "ns1/sign.sh"
cp "../ns2/dsset-example$TP" .
cp "../ns2/dsset-in-addr.arpa$TP" .
cp "../ns2/dsset-too-many-iterations$TP" .
grep "$DEFAULT_ALGORITHM_NUMBER [12] " "../ns2/dsset-algroll$TP" > "dsset-algroll$TP"
cp "../ns6/dsset-optout-tld$TP" .
@@ -191,4 +191,9 @@ zone "hours-vs-days" {
allow-update { any; };
};
zone "too-many-iterations" {
type master;
file "too-many-iterations.db.signed";
};
include "trusted.conf";
+11
View File
@@ -318,3 +318,14 @@ 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")
$SETTIME -P sync now "$key1" > /dev/null
cat "$infile" > "$zonefile.signed"
#
# Negative result from this zone should come back as insecure.
#
zone=too-many-iterations
infile=too-many-iterations.db.in
zonefile=too-many-iterations.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 -3 - -H too-many -g -o "$zone" "$zonefile" > /dev/null 2>&1
@@ -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 http://mozilla.org/MPL/2.0/.
;
; See the COPYRIGHT file distributed with this work for additional
; information regarding copyright ownership.
$TTL 30 ; 5 minutes
@ IN SOA mname1. . (
2000042407 ; serial
20 ; refresh (20 seconds)
20 ; retry (20 seconds)
1814400 ; expire (3 weeks)
30 ; minimum (1 hour)
)
NS ns2
ns2 A 10.53.0.2
ns3 A 10.53.0.3
a A 10.0.0.1
*.a A 10.0.0.3
b A 10.0.0.2
d A 10.0.0.4
@@ -363,6 +363,12 @@ zone "revoked.trusted" {
file "revoked.trusted.db.signed";
};
zone "too-many-iterations" {
type secondary;
primaries { 10.53.0.2; };
file "too-many-iterations.bk";
};
include "siginterval.conf";
include "trusted.conf";
@@ -42,6 +42,7 @@ view rec {
recursion yes;
dnssec-validation yes;
dnssec-accept-expired yes;
minimal-responses no;
zone "." {
type hint;
+11 -1
View File
@@ -25,8 +25,18 @@ k2=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone")
cat "$infile" "$k1.key" "$k2.key" > "$zonefile"
# The awk script below achieves two goals:
#
# - it puts one of the two RRSIG(SOA) records at the end of the zone file, so
# that these two records (forming a single RRset) are not placed immediately
# next to each other; the test then checks if RRSIG RRsets split this way are
# correctly added to resigning heaps,
#
# - it places a copy of one of the RRSIG(SOA) records somewhere else than at the
# zone apex; the test then checks whether such signatures are automatically
# removed from the zone after it is loaded.
"$SIGNER" -P -3 - -A -o "$zone" -O full -f "$zonefile.unsplit" -e now-3600 -s now-7200 "$zonefile" > /dev/null 2>&1
awk 'BEGIN { r = ""; }
$4 == "RRSIG" && $5 == "SOA" && r == "" { r = $0; next; }
{ print }
END { print r }' "$zonefile.unsplit" > "$zonefile.signed"
END { print r; print "not-at-zone-apex." r; }' "$zonefile.unsplit" > "$zonefile.signed"
@@ -0,0 +1,5 @@
; This is a key-signing key, keyid 15002, for example.com.
; Created: 20210423012926 (Fri Apr 23 11:29:26 2021)
; Publish: 20210423012926 (Fri Apr 23 11:29:26 2021)
; Activate: 20210423012926 (Fri Apr 23 11:29:26 2021)
example.com. IN DNSKEY 257 3 8 AwEAAdp+oCXl7vpKA3Mmyndx6/iA+wLrtxeMUiWL7uWJ9ZF24EdS8Dye 63p0lGlyvjvM9T5dTiyEpTAdutEBr79H0MlDqIBqpadrCdJRI2S4kC+0 nq5+Aj2CEyiAamPGujwWeXwtfLAvVPfBqs42PBr6wPQIJOByFYDaZBU3 enUEWgHYy/7OnJDrt0QlswKphR6SvYtyuixiUR8J/WouWXglUY5qlC7Z vVDxs9E4q7B1mfKCyoqcFMKPh9lzEBH+IfUZ543xXEYf2BEztKB1SZ2R QnpYedjATGDcgPis46uA2gHMfvDYJTQ5UqTBtveGb3Wsqc0oRXVPMEoY 3WnWhaKDzkk=
@@ -0,0 +1,13 @@
Private-key-format: v1.3
Algorithm: 8 (RSASHA256)
Modulus: 2n6gJeXu+koDcybKd3Hr+ID7Auu3F4xSJYvu5Yn1kXbgR1LwPJ7renSUaXK+O8z1Pl1OLISlMB260QGvv0fQyUOogGqlp2sJ0lEjZLiQL7Sern4CPYITKIBqY8a6PBZ5fC18sC9U98GqzjY8GvrA9Agk4HIVgNpkFTd6dQRaAdjL/s6ckOu3RCWzAqmFHpK9i3K6LGJRHwn9ai5ZeCVRjmqULtm9UPGz0TirsHWZ8oLKipwUwo+H2XMQEf4h9RnnjfFcRh/YETO0oHVJnZFCelh52MBMYNyA+Kzjq4DaAcx+8NglNDlSpMG294ZvdaypzShFdU8wShjdadaFooPOSQ==
PublicExponent: AQAB
PrivateExponent: SD4X64/0DTONonRP+2Biej8DP7r6RcHyo1F6QtDzrg4VJ+AHaLPO/iUvsRHsTk99QwqMv3F4QMmDrHmXR3KSWQmS3Crm7M0aaTzErBfOLMfWs7EcQoQQm5KiGq1phFaWAnXzxTlRKb4SIK6T/wOr6sQKlV+DNqB++Pjn92rh67vLM8kZBUzWI14Vl9N0ib+xOOFH1oYFo7ynDgMfJhpnQSkuRfyQls3aD1eKQsNazRtZ7lFi2S0HR/V0AKYH2AQi7SdL5wH6hYba5cHfpKSw7PebI0lYkUJ4PAg3Xw7DPMkg8O0hkpLICpU8x7MPqQQ74eKDaEY+fjbL0KLL0Dy9UQ==
Prime1: /IDRb7WzMY6wp14LqDORULoUnmiQOqkRjOQnCoEXT2KVpYwPmGMG+GR40hrMFgqqAZFVmi56VBoasWpYbSBEqM4aJv1JVimMPREk23v5i+TY93kxICO/ee9/v0hXgLmrKUkS1Kwu4a1PxLX5U/LAzXPR6zF+EHP9OKFjDRWHqN0=
Prime2: 3YU9QdtsXofjNmlDETRwemKv45pa0oVNPmNvS1vtzIpQ3m/QSuhJxzyTgSP9x1XMiIsg63er3LOCtkRifXVE1IBrfIUgchp8YD5LsyesRl2ielE8Hw8PwSA1YjUVu90yRHcVfbZJ8lm2KyRKHgDWXz94t2Xnm/9M5XjUGuNW7l0=
Exponent1: 7KIkpJYZyvW4ZAFk10sMgiUBMbs4f2D2i509YUC9ga4YJD7wVpVncN1nxS9L19RCopl7KbUo+yxDm8TX/dzhu3j7VVLFqbPiM1Cfw/mZUhszoii3ezFFPpbOl4rKRl66I0TSGvEKNoDfYrBPavby7Rf/wHRveifZRXspgpeMvRk=
Exponent2: yvvtjuxW2CRiopg/+YL40lyd2cy2DpRRnKqW8BHzzGquAbWpwwopmOS8MSjewgqv2irK5pmJJTpku0nciiOsB6EJXVfLzGLSt4o96ZOf+/aPDNBla/xsLkaqRCxqlvPwvOX2DnS8O9PS5qNhOy7/QNYzcrJxUfPV7awTh/Pr040=
Coefficient: PHxU1tqPKTpI/8nABvso0SRerc1m+RPWGRk7s/SVcADSBvEW7fUDcwiZeRfK9MdlwPvLiVozbYnRbgRQl8GuKSqAD1+Cnvn2yOQk81AgNKbuKPwF7UvKIdq/c/xnhj2bvZUVSavJ91ux/RlZNP50378Ks8bj5HJl1xzAMVHXB5o=
Created: 20210423012926
Publish: 20210423012926
Activate: 20210423012926
@@ -0,0 +1,5 @@
; This is a zone-signing key, keyid 63613, for example.com.
; Created: 20210423012810 (Fri Apr 23 11:28:10 2021)
; Publish: 20210423012810 (Fri Apr 23 11:28:10 2021)
; Activate: 20210423012810 (Fri Apr 23 11:28:10 2021)
example.com. IN DNSKEY 256 3 8 AwEAAZzun7bYfjmGDwUEn4pyJG34vsiawRMW6pEdoNMH87ozxriOzgG6 /4zTjEv8JyYjGQz2k2vcoWWcD+86xD5IUqfa1pdXXUU8bdhG9DBtW/K1 mc4P6g8heU+0f++mq/L4TPlWVZUG8lVH4H8mD6r8PsVK7v/QR7wMeg9b JpCYyxon2A9rZ4zS0J9kX9bfciQVh6ODGVENctwEK5FNp5u0VonPEIx3 5Kj+IVn/mHpfbz4LaC02s7C6Kgvn3ToFFSJczwbOaexl/d+/ai8FLJi7 8UgiAq5/178bcVLItMeY6aD5eQGkRtr2c3JZ/JR4Nf+TQAWFBnl9NSDa RH4Qa55ZNqs=
@@ -0,0 +1,13 @@
Private-key-format: v1.3
Algorithm: 8 (RSASHA256)
Modulus: nO6ftth+OYYPBQSfinIkbfi+yJrBExbqkR2g0wfzujPGuI7OAbr/jNOMS/wnJiMZDPaTa9yhZZwP7zrEPkhSp9rWl1ddRTxt2Eb0MG1b8rWZzg/qDyF5T7R/76ar8vhM+VZVlQbyVUfgfyYPqvw+xUru/9BHvAx6D1smkJjLGifYD2tnjNLQn2Rf1t9yJBWHo4MZUQ1y3AQrkU2nm7RWic8QjHfkqP4hWf+Yel9vPgtoLTazsLoqC+fdOgUVIlzPBs5p7GX9379qLwUsmLvxSCICrn/XvxtxUsi0x5jpoPl5AaRG2vZzcln8lHg1/5NABYUGeX01INpEfhBrnlk2qw==
PublicExponent: AQAB
PrivateExponent: N4egcDzO/V/YdLgcFAsrpNY9/BH2e+DCA7NuMv4/WgX0LV4quyYGQzigDksdNzt4I8Qkiig53BCK+uXahwdkaAzhng/F6zfkzoDc6z3nKUzlLasn8U6w9Gk0VAKwGXuPETNheShKG68hWxyGssQrGfjX9SEoIPxxPHnOfZ/zTj95KAnVV5qPz90xVAb0+FUrLXAt72KuRwepOTlsETsMFDKe17uUCqCCdX98Ko0u14wrO6zGRQtNhUsfvNB/pY8fvbHD1GcCTbFSx4FxsUsZMrNtMsvMe3HN9ggC0Y9htbH9HV0hS0w9SKCUyoeOVwf/JZL4hlfoe8+jglsyJpAgoQ==
Prime1: zeXvO3PT4iXv9GlGeebl39pF1sXs8tXY4B9VHUJGGSYlyOlyCEy4URQJIPfuL6VjFKCErSxUJSrGz0HyQuKr8l9qP/0MGxGRH7wxvUR7YTmai84yyQ4fFENRmn8bzxGwj0MVHIW7cKC59j7nWT24gseT21/NP5m8EnPsjz/K40M=
Prime2: wx5vVFSydUfr8HtOHNS1kRrTjhnQOfjmj8SxGi72Hk+mgi9fBCTC5fRLifd80wGbgyFk1vZOXeStOC8L3IlnBGLX0O9MNip+vVX3hRzIRhLwHhL1ygN3xEd04qwVH0XJ8+4A0XCzh/FJgW59F62geN6gwedo7GmZAOSZUBAyRHk=
Exponent1: IlkqeLuQ7Fgx2I87b5iiXp62Keco6TXdkT4I3/GvagCgKw0utc2+rd/uye4ycQZhKg7BM3aCrxScx/STaq8PykY6nmQjgdyDXkzx60YiYwzOCGakuD+/1YyJb4Gm7PthffTN780rgNV/UGIcDBoszrxmoSExR1vpMRbfruIQgas=
Exponent2: or0Os/KUibc79W6Snv9WlLkgPAQRpViQzNaLtD/47R0Xzrs975HNsMgJ/P+bb86Ga1994MC8ahmh1BuBNCax8nmScWQ1V3QoEzjRYoe4DqIa/aposF4mFWJX/fry/wtRPo+CxSzPwJGh8j86PHaHQmjFAhVFcPE+OP1xVdK8alk=
Coefficient: r5wPmPXUF5pVC0Y7La3jVkL4w/3wvq9LBz91tH9gA8OUNLpDDBuFZISiJdhOZ4JVw+qSSoHcEa+3Phd+BqxmXzwZDU1Fqta9mLDDGCqCWjVQOopeeJgrvkv9P0TIzEuoGmW50cQhyqHYCtuUxjOnHfiQSc53p7rfD4Vom1VQ3Ok=
Created: 20210423012810
Publish: 20210423012810
Activate: 20210423012810
@@ -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.
; This is a zone which has two DNSKEY records, both of which have
; existing private key files available. They should be loaded automatically
; and the zone correctly signed.
;
$TTL 3600
example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
$include Kexample.com.+008+63613.key
$include Kexample.com.+008+15002.key
+96 -5
View File
@@ -1312,7 +1312,7 @@ status=$((status+ret))
echo_ic "one non-KSK DNSKEY ($n)"
ret=0
(
cd signer/general || exit 1
cd signer/general || exit 0
rm -f signed.zone
$SIGNER -f signed.zone -o example.com. test2.zone > signer.out.$n
test -f signed.zone
@@ -1324,7 +1324,7 @@ status=$((status+ret))
echo_ic "one KSK DNSKEY ($n)"
ret=0
(
cd signer/general || exit 1
cd signer/general || exit 0
rm -f signed.zone
$SIGNER -f signed.zone -o example.com. test3.zone > signer.out.$n
test -f signed.zone
@@ -1372,7 +1372,7 @@ status=$((status+ret))
echo_ic "two DNSKEY, both private keys missing ($n)"
ret=0
(
cd signer/general || exit 1
cd signer/general || exit 0
rm -f signed.zone
$SIGNER -f signed.zone -o example.com. test7.zone > signer.out.$n
test -f signed.zone
@@ -1384,7 +1384,7 @@ status=$((status+ret))
echo_ic "two DNSKEY, one private key missing ($n)"
ret=0
(
cd signer/general || exit 1
cd signer/general || exit 0
rm -f signed.zone
$SIGNER -f signed.zone -o example.com. test8.zone > signer.out.$n
test -f signed.zone
@@ -1393,6 +1393,30 @@ n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_ic "check that dnssec-signzone rejects excessive NSEC3 iterations ($n)"
ret=0
(
cd signer/general || exit 0
rm -f signed.zone
$SIGNER -f signed.zone -3 - -H 151 -o example.com. test9.zone > signer.out.$n
test -f signed.zone
) && ret=1
n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_ic "check that dnssec-signzone accepts maximum NSEC3 iterations ($n)"
ret=0
(
cd signer/general || exit 1
rm -f signed.zone
$SIGNER -f signed.zone -3 - -H 150 -o example.com. test9.zone > signer.out.$n
test -f signed.zone
) || ret=1
n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "checking that a key using an unsupported algorithm cannot be generated ($n)"
ret=0
zone=example
@@ -3244,6 +3268,14 @@ n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "check that not-at-zone-apex RRSIG(SOA) RRsets are removed from the zone after load ($n)"
ret=0
dig_with_opts split-rrsig AXFR @10.53.0.7 > dig.out.test$n || ret=1
grep -q "not-at-zone-apex.*RRSIG.*SOA" dig.out.test$n && ret=1
n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "check that 'dnssec-keygen -S' works for all supported algorithms ($n)"
ret=0
alg=1
@@ -3830,7 +3862,7 @@ status=$((status+ret))
echo_i "check that DNAME at apex with NSEC3 is correctly signed (dnssec-signzone) ($n)"
ret=0
dig_with_opts txt dname-at-apex-nsec3.example @10.53.0.3 > dig.out.ns3.test$n || ret=1
grep "RRSIG.NSEC3 ${DEFAULT_ALGORITHM_NUMBER} 3 3600" dig.out.ns3.test$n > /dev/null || ret=1
grep "RRSIG.NSEC3 ${DEFAULT_ALGORITHM_NUMBER} 3 600" dig.out.ns3.test$n > /dev/null || ret=1
n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
@@ -4291,5 +4323,64 @@ n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "checking excessive NSEC3 iteration warnings in named.run ($n)"
ret=0
grep "zone too-many-iterations/IN: excessive NSEC3PARAM iterations [0-9]* > 150" ns2/named.run >/dev/null 2>&1 || ret=1
grep "zone too-many-iterations/IN: excessive NSEC3PARAM iterations [0-9]* > 150" ns3/named.run >/dev/null 2>&1 || ret=1
n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
# Check that the validating resolver will fallback to insecure if the answer
# contains NSEC3 records with high iteration count.
echo_i "checking fallback to insecure when NSEC3 iterations is too high (nxdomain) ($n)"
ret=0
dig_with_opts @10.53.0.2 does-not-exist.too-many-iterations > dig.out.ns2.test$n || ret=1
dig_with_opts @10.53.0.4 does-not-exist.too-many-iterations > dig.out.ns4.test$n || ret=1
digcomp dig.out.ns2.test$n dig.out.ns4.test$n || ret=1
grep "flags: qr rd ra;" dig.out.ns4.test$n >/dev/null || ret=1
grep "status: NXDOMAIN" dig.out.ns4.test$n >/dev/null || ret=1
grep "ANSWER: 0, AUTHORITY: 6" dig.out.ns4.test$n > /dev/null || ret=1
n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "checking fallback to insecure when NSEC3 iterations is too high (nodata) ($n)"
ret=0
dig_with_opts @10.53.0.2 a.too-many-iterations txt > dig.out.ns2.test$n || ret=1
dig_with_opts @10.53.0.4 a.too-many-iterations txt > dig.out.ns4.test$n || ret=1
digcomp dig.out.ns2.test$n dig.out.ns4.test$n || ret=1
grep "flags: qr rd ra;" dig.out.ns4.test$n >/dev/null || ret=1
grep "status: NOERROR" dig.out.ns4.test$n >/dev/null || ret=1
grep "ANSWER: 0, AUTHORITY: 4" dig.out.ns4.test$n > /dev/null || ret=1
n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "checking fallback to insecure when NSEC3 iterations is too high (wildcard) ($n)"
ret=0
dig_with_opts @10.53.0.2 wild.a.too-many-iterations > dig.out.ns2.test$n || ret=1
dig_with_opts @10.53.0.4 wild.a.too-many-iterations > dig.out.ns4.test$n || ret=1
digcomp dig.out.ns2.test$n dig.out.ns4.test$n || ret=1
grep "flags: qr rd ra;" dig.out.ns4.test$n >/dev/null || ret=1
grep "status: NOERROR" dig.out.ns4.test$n >/dev/null || ret=1
grep 'wild\.a\.too-many-iterations\..*A.10\.0\.0\.3' dig.out.ns4.test$n >/dev/null || ret=1
grep "ANSWER: 2, AUTHORITY: 4" dig.out.ns4.test$n > /dev/null || ret=1
n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "checking fallback to insecure when NSEC3 iterations is too high (wildcard nodata) ($n)"
ret=0
dig_with_opts @10.53.0.2 type100 wild.a.too-many-iterations > dig.out.ns2.test$n || ret=1
dig_with_opts @10.53.0.4 type100 wild.a.too-many-iterations > dig.out.ns4.test$n || ret=1
digcomp dig.out.ns2.test$n dig.out.ns4.test$n || ret=1
grep "flags: qr rd ra;" dig.out.ns4.test$n >/dev/null || ret=1
grep "status: NOERROR" dig.out.ns4.test$n >/dev/null || ret=1
grep "ANSWER: 0, AUTHORITY: 8" dig.out.ns4.test$n > /dev/null || ret=1
n=$((n+1))
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
+2 -1
View File
@@ -164,7 +164,8 @@ wks01.example. 3600 IN WKS 10.0.0.1 6 0 1 2 21 23
wks02.example. 3600 IN WKS 10.0.0.1 17 0 1 2 53
wks03.example. 3600 IN WKS 10.0.0.2 6 65535
x2501.example. 3600 IN X25 "123456789"
zonemd01.example. 3600 IN ZONEMD 2019020700 1 0 C220B8A6ED5728A971902F7E3D4FD93ADEEA88B0453C2E8E8C863D46 5AB06CF34EB95B266398C98B59124FA239CB7EEB
zonemd01.example. 3600 IN ZONEMD 2019020700 1 1 C220B8A6ED5728A971902F7E3D4FD93ADEEA88B0453C2E8E8C863D46 5AB06CF34EB95B266398C98B59124FA239CB7EEB
zonemd02.example. 3600 IN ZONEMD 2019020700 1 2 08CFA1115C7B948C4163A901270395EA226A930CD2CBCF2FA9A5E6EB 85F37C8A4E114D884E66F176EAB121CB02DB7D652E0CC4827E7A3204 F166B47E5613FD27
8f1tmio9avcom2k0frp92lgcumak0cad.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C 8FPNS2UCT7FBS643THP2B77PEQ77K6IU A NS SOA MX AAAA RRSIG DNSKEY NSEC3PARAM
kcd3juae64f9c5csl1kif1htaui7un0g.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C KD5MN2M20340DGO0BL7NTSB8JP4BSC7E
mr5ukvsk1l37btu4q7b1dfevft4hkqdk.example. 3600 IN NSEC3 1 0 10 D2CF0294C020CE6C MT38J6VG7S0SN5G17MCUF6IQIKFUAJ05 A AAAA RRSIG
+2 -3
View File
@@ -4,8 +4,7 @@ AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS)
dyndb_LTLIBRARIES = sample.la
dyndbdir = $(abs_builddir)
check_LTLIBRARIES = sample.la
sample_la_SOURCES = \
db.c \
@@ -23,4 +22,4 @@ sample_la_SOURCES = \
util.h \
zone.h
sample_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
sample_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath $(abs_builddir)
+1 -1
View File
@@ -229,7 +229,7 @@ syncptr(sample_instance_t *inst, dns_name_t *name, dns_rdata_t *addr_rdata,
/* Reverse zone is managed by this driver, prepare PTR record */
pevent->zone = NULL;
dns_zone_attach(ptr_zone, &pevent->zone);
dns_name_copynf(name, dns_fixedname_name(&pevent->ptr_target_name));
dns_name_copy(name, dns_fixedname_name(&pevent->ptr_target_name));
dns_name_clone(dns_fixedname_name(&pevent->ptr_target_name),
&ptr_struct.ptr);
dns_diff_init(inst->mctx, &pevent->diff);
@@ -0,0 +1 @@
-m record,size,mctx -c named.conf -d 1 -D fetchlimit-ns3 -X named.lock -g -T maxcachesize=2097152
+7 -1
View File
@@ -369,11 +369,17 @@ csync01 CSYNC 0 0 A NS AAAA
csync02 CSYNC 0 0
;type 63
zonemd01 ZONEMD 2019020700 1 0 (
zonemd01 ZONEMD 2019020700 1 1 (
C220B8A6ED5728A971902F7E3D4FD93A
DEEA88B0453C2E8E8C863D465AB06CF3
4EB95B266398C98B59124FA239CB7EEB
)
zonemd02 ZONEMD 2019020700 1 2 (
08CFA1115C7B948C4163A901270395EA
226A930CD2CBCF2FA9A5E6EB85F37C8A
4E114D884E66F176EAB121CB02DB7D65
2E0CC4827E7A3204F166B47E5613FD27
)
; type 64 -- 98 (unassigned)
+30 -63
View File
@@ -12,60 +12,15 @@
# This script is a 'port' broker. It keeps track of ports given to the
# individual system subtests, so every test is given a unique port range.
lockfile=get_ports.lock
statefile=get_ports.state
total_tests=$(find . -maxdepth 1 -mindepth 1 -type d | wc -l)
ports_per_test=20
port_min=5001
port_max=32767
get_random() (
# shellcheck disable=SC2005,SC2046
echo $(dd if=/dev/urandom bs=1 count=2 2>/dev/null | od -tu2 -An) | sed -e 's/^0*//'
)
get_port() {
tries=10
port=0
while [ "${tries}" -gt 0 ]; do
if ( set -o noclobber; echo "$$" > "${lockfile}" ) 2> /dev/null; then
trap 'rm -f "${lockfile}"; exit $?' INT TERM EXIT
port=$(cat "${statefile}" 2>/dev/null)
if [ -z "${port}" ]; then
if [ "$1" -gt 0 ]; then
port="$1"
else
port_range=$((port_max-port_min))
port_random=$(get_random)
port=$((port_random%port_range+port_min))
fi
fi
if [ "$((port+1))" -gt "${port_max}" ]; then
port="${port_min}"
fi
echo $((port+1)) > get_ports.state
# clean up after yourself, and release your trap
rm -f "${lockfile}"
trap - INT TERM EXIT
# we have our port
break
fi
sleep 1
tries=$((tries-1))
done
if [ "$port" -eq 0 ]; then
exit 1
fi
echo "$port"
}
port_max=$((32767 - (total_tests * ports_per_test)))
baseport=0
while getopts "p:-:" OPT; do
test_index=0
while getopts "p:t:-:" OPT; do
if [ "$OPT" = "-" ] && [ -n "$OPTARG" ]; then
OPT="${OPTARG%%=*}"
OPTARG="${OPTARG#$OPT}"
@@ -75,24 +30,36 @@ while getopts "p:-:" OPT; do
# shellcheck disable=SC2214
case "$OPT" in
p | port) baseport=$OPTARG ;;
t | test)
test_index=$(find . -maxdepth 1 -mindepth 1 -type d | sort | grep -F -x -n "./${OPTARG}" | cut -d: -f1)
if [ -z "${test_index}" ]; then
echo "Test '${OPTARG}' not found" >&2
exit 1
fi
;;
-) break ;;
*) echo "invalid option" >&2; exit 1 ;;
esac
done
echo "export PORT=$(get_port "$baseport")"
echo "export TLSPORT=$(get_port)"
echo "export HTTPPORT=$(get_port)"
echo "export HTTPSPORT=$(get_port)"
echo "export EXTRAPORT1=$(get_port)"
echo "export EXTRAPORT2=$(get_port)"
echo "export EXTRAPORT3=$(get_port)"
echo "export EXTRAPORT4=$(get_port)"
echo "export EXTRAPORT5=$(get_port)"
echo "export EXTRAPORT6=$(get_port)"
echo "export EXTRAPORT7=$(get_port)"
echo "export EXTRAPORT8=$(get_port)"
echo "export CONTROLPORT=$(get_port)"
port_pool_size=$((port_max - port_min))
if [ "${baseport}" -eq 0 ]; then
baseport="$((($(date +%s) / 3600 % port_pool_size) + port_min + (test_index * ports_per_test)))"
fi
echo "export PORT=$((baseport))"
echo "export TLSPORT=$((baseport + 1))"
echo "export HTTPPORT=$((baseport + 2))"
echo "export HTTPSPORT=$((baseport + 3))"
echo "export EXTRAPORT1=$((baseport + 4))"
echo "export EXTRAPORT2=$((baseport + 5))"
echo "export EXTRAPORT3=$((baseport + 6))"
echo "export EXTRAPORT4=$((baseport + 7))"
echo "export EXTRAPORT5=$((baseport + 8))"
echo "export EXTRAPORT6=$((baseport + 9))"
echo "export EXTRAPORT7=$((baseport + 10))"
echo "export EXTRAPORT8=$((baseport + 11))"
echo "export CONTROLPORT=$((baseport + 12))"
# Local Variables:
# sh-basic-offset: 4
+2 -3
View File
@@ -6,8 +6,7 @@ AM_CPPFLAGS += \
$(LIBNS_CFLAGS) \
$(LIBISCCFG_CFLAGS)
hooks_LTLIBRARIES = test-async.la
hooksdir = $(abs_builddir)
check_LTLIBRARIES = test-async.la
test_async_la_SOURCES = test-async.c
test_async_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
test_async_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -rpath $(abs_builddir)
@@ -0,0 +1 @@
f A 10.0.0.7
+24
View File
@@ -0,0 +1,24 @@
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
;
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;
; See the COPYRIGHT file distributed with this work for additional
; information regarding copyright ownership.
$TTL 300 ; 5 minutes
@ IN SOA ns3 . (
2000042412 ; serial
20 ; refresh (20 seconds)
20 ; retry (20 seconds)
1814400 ; expire (3 weeks)
3600 ; minimum (1 hour)
)
NS ns3
ns3 A 10.53.0.3
c A 10.0.0.3
e A 10.0.0.5
$INCLUDE include.db
+1
View File
@@ -30,6 +30,7 @@ cp ns3/master.db.in ns3/nsec3.db
cp ns3/master.db.in ns3/externalkey.db
cp ns3/master.db.in ns3/delayedkeys.db
cp ns3/master.db.in ns3/removedkeys-primary.db
cp ns3/include.db.in ns3/include.db
mkdir ns3/removedkeys
+28 -4
View File
@@ -940,17 +940,17 @@ status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that reloading errors prevent synchronization ($n)"
ret=0
ret=1
$DIG $DIGOPTS +short @10.53.0.3 master SOA > dig.out.ns3.test$n.1 || ret=1
sleep 1
nextpart ns3/named.run > /dev/null
cp ns3/master5.db.in ns3/master.db
cp ns3/master6.db.in ns3/master.db
rndc_reload ns3 10.53.0.3
for i in 1 2 3 4 5 6 7 8 9 10
do
if nextpart ns3/named.run |
grep "not loaded due to errors" > /dev/null
if nextpart ns3/named.run | grep "not loaded due to errors" > /dev/null
then
ret=0
break
fi
sleep 1
@@ -961,6 +961,30 @@ $DIFF dig.out.ns3.test$n.1 dig.out.ns3.test$n.2 > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check inline-signing with an include file ($n)"
ret=0
$DIG $DIGOPTS +short @10.53.0.3 master SOA > dig.out.ns3.test$n.1 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
sleep 1
nextpart ns3/named.run > /dev/null
cp ns3/master7.db.in ns3/master.db
rndc_reload ns3 10.53.0.3
_includefile_loaded() {
$DIG $DIGOPTS @10.53.0.3 f.master A > dig.out.ns3.test$n
grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || return 1
grep "ANSWER: 2," dig.out.ns3.test$n > /dev/null || return 1
grep "10\.0\.0\.7" dig.out.ns3.test$n > /dev/null || return 1
return 0
}
retry_quiet 10 _includefile_loaded
# Sanity check: the SOA record should be changed
$DIG $DIGOPTS +short @10.53.0.3 master SOA > dig.out.ns3.test$n.2 || ret=1
$DIFF dig.out.ns3.test$n.1 dig.out.ns3.test$n.2 > /dev/null && ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "test add/del zone combinations ($n)"
ret=0
+74 -1
View File
@@ -108,7 +108,7 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "testing AXFR fallback after IXFR failure ($n)"
echo_i "testing AXFR fallback after IXFR failure (not exact error) ($n)"
ret=0
# Provide a broken IXFR response and a working fallback AXFR response
@@ -142,6 +142,66 @@ $DIG $DIGOPTS @10.53.0.1 nil. TXT | grep 'fallback AXFR' >/dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "testing AXFR fallback after IXFR failure (bad SOA owner) ($n)"
ret=0
# Prepare for checking the logs later on.
nextpart ns1/named.run >/dev/null
# Provide a broken IXFR response and a working fallback AXFR response.
sendcmd <<EOF
/SOA/
nil. 300 SOA ns.nil. root.nil. 4 300 300 604800 300
/IXFR/
nil. 300 SOA ns.nil. root.nil. 4 300 300 604800 300
nil. 300 SOA ns.nil. root.nil. 3 300 300 604800 300
bad-owner. 300 SOA ns.nil. root.nil. 4 300 300 604800 300
test.nil. 300 TXT "serial 4, malformed IXFR"
nil. 300 SOA ns.nil. root.nil. 4 300 300 604800 300
/AXFR/
nil. 300 SOA ns.nil. root.nil. 4 300 300 604800 300
/AXFR/
nil. 300 NS ns.nil.
test.nil. 300 TXT "serial 4, fallback AXFR"
/AXFR/
nil. 300 SOA ns.nil. root.nil. 4 300 300 604800 300
EOF
$RNDCCMD 10.53.0.1 refresh nil | sed 's/^/ns1 /' | cat_i
# A broken server would accept the malformed IXFR and apply its contents to the
# zone. A fixed one would reject the IXFR and fall back to AXFR. Both IXFR and
# AXFR above bring the nil. zone up to serial 4, but we cannot reliably query
# for the SOA record to check whether the transfer was finished because a broken
# server would send back SERVFAIL responses to SOA queries after accepting the
# malformed IXFR. Instead, check transfer progress by querying for a TXT record
# at test.nil. which is present in both IXFR and AXFR (with different contents).
_wait_until_transfer_is_finished() {
$DIG $DIGOPTS +tries=1 +time=1 @10.53.0.1 test.nil. TXT > dig.out.test$n.1 &&
grep -q -F "serial 4" dig.out.test$n.1
}
if ! retry_quiet 10 _wait_until_transfer_is_finished; then
echo_i "timed out waiting for version 4 of zone nil. to be transferred"
ret=1
fi
# At this point a broken server would be serving a zone with no SOA records.
# Try crashing it by triggering a SOA refresh query.
$RNDCCMD 10.53.0.1 refresh nil | sed 's/^/ns1 /' | cat_i
# Do not wait until the zone refresh completes - even if a crash has not
# happened by now, a broken server would never serve the record which is only
# present in the fallback AXFR, so checking for that is enough to verify if a
# server is broken or not; if it is, it is bound to crash shortly anyway.
$DIG $DIGOPTS test.nil. TXT @10.53.0.1 > dig.out.test$n.2 || ret=1
grep -q -F "serial 4, fallback AXFR" dig.out.test$n.2 || ret=1
# Ensure the expected error is logged.
nextpart ns1/named.run | grep -q -F "SOA name mismatch" || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "testing ixfr-from-differences option ($n)"
# ns3 is primary; ns4 is secondary
@@ -251,12 +311,25 @@ $DIG $DIGOPTS ixfr=1 +notcp test @10.53.0.4 > dig.out2.test$n || ret=1
digcomp dig.out1.test$n dig.out2.test$n || ret=1
awk '$4 == "SOA" { soacnt++} END {if (soacnt == 1) exit(0); else exit(1);}' dig.out1.test$n || ret=1
awk '$4 == "SOA" { if ($7 == 3) exit(0); else exit(1);}' dig.out1.test$n || ret=1
#
nextpart ns4/named.run > /dev/null
# Should be incremental transfer.
$DIG $DIGOPTS ixfr=1 test @10.53.0.4 > dig.out3.test$n || ret=1
awk '$4 == "SOA" { soacnt++} END { if (soacnt == 6) exit(0); else exit(1);}' dig.out3.test$n || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "check estimated IXFR size ($n)"
ret=0
# note IXFR delta size will be slightly bigger with version 1 transaction
# headers as there is no correction for the overall record length storage.
# Ver1 = 4 * (6 + 10 + 10 + 17 + 5 * 4) + 2 * (13 + 10 + 4) + (6 * 4) = 330
# Ver2 = 4 * (6 + 10 + 10 + 17 + 5 * 4) + 2 * (13 + 10 + 4) = 306
nextpart ns4/named.run | grep "IXFR delta size (306 bytes)" > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
# make sure ns5 has transfered the zone
# wait for secondary to reload
tret=0
+5 -2
View File
@@ -7,8 +7,11 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
rm -f */*.db */*.jnl
rm -f */named.conf
rm -f */named.memstats
rm -f */named.run
rm -f */named.conf
rm -f */*.db */*.jnl
rm -f dig.out*
rm -f journalprint.out.*
rm -f ns1/managed-keys.bind
rm -f tmp.jnl
@@ -0,0 +1,2 @@
. 0 IN SOA . . 3297 0 0 0 0
. 0 IN TYPE65533 \# 276 60621140598E0A83000000000101030803010001ACFFB409BCC939F8 31F7A1E5EC88F7A59255EC53040BE432027390A4CE896D6F9086F3C5 E177FBFE118163AAEC7AF1462C47945944C4E2C026BE5E98BBCDED25 978272E1E3E079C5094D573F0E83C92F02B32D3513B1550B826929C8 0DD0F92CAC966D17769FD5867B647C3F38029ABDC48152EB8F207159 ECC5D232C7C1537C79F4B7AC28FF11682F21681BF6D6ABA555032BF6 F9F036BEB2AAA5B3778D6EEBFBA6BF9EA191BE4AB0CAEA759E2F773A 1F9029C73ECB8D5735B9321DB085F1B8E2D8038FE2941992548CEE0D 67DD4547E11DD63AF9C9FC1C5466FB684CF009D7197C2CF79E792AB5 01E6A8A1CA519AF2CB9B5F6367E94C0D47502451357BE1B5
@@ -0,0 +1,704 @@
3b42494e44204c4f472056390a000000
00000cd20000020000000ce200002bf8
00000038000000000000000000000000
00000000000000000000000000000000
00000cd20000020000000cd30000049c
00000cd40000073800000cd5000009d8
00000cd600000c7800000cd700000f18
00000cd8000011b800000cd900001458
00000cda000016f800000cdb00001998
00000cdc00001c3800000cdd00001ed8
00000cde0000217800000cdf00002418
00000ce0000026b800000ce100002958
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
0000029000000cd200000cd300000021
0000060001000000000016000000000c
d2000000000000000000000000000000
000000011f00fffd0001000000000114
6058a4c2598e0a830000000001010308
03010001acffb409bcc939f831f7a1e5
ec88f7a59255ec53040be432027390a4
ce896d6f9086f3c5e177fbfe118163aa
ec7af1462c47945944c4e2c026be5e98
bbcded25978272e1e3e079c5094d573f
0e83c92f02b32d3513b1550b826929c8
0dd0f92cac966d17769fd5867b647c3f
38029abdc48152eb8f207159ecc5d232
c7c1537c79f4b7ac28ff11682f21681b
f6d6aba555032bf6f9f036beb2aaa5b3
778d6eebfba6bf9ea191be4ab0caea75
9e2f773a1f9029c73ecb8d5735b9321d
b085f1b8e2d8038fe2941992548cee0d
67dd4547e11dd63af9c9fc1c5466fb68
4cf009d7197c2cf79e792ab501e6a8a1
ca519af2cb9b5f6367e94c0d47502451
357be1b5000000210000060001000000
000016000000000cd300000000000000
0000000000000000000000011f00fffd
00010000000001146058e4a0598e0a83
000000000101030803010001acffb409
bcc939f831f7a1e5ec88f7a59255ec53
040be432027390a4ce896d6f9086f3c5
e177fbfe118163aaec7af1462c479459
44c4e2c026be5e98bbcded25978272e1
e3e079c5094d573f0e83c92f02b32d35
13b1550b826929c80dd0f92cac966d17
769fd5867b647c3f38029abdc48152eb
8f207159ecc5d232c7c1537c79f4b7ac
28ff11682f21681bf6d6aba555032bf6
f9f036beb2aaa5b3778d6eebfba6bf9e
a191be4ab0caea759e2f773a1f9029c7
3ecb8d5735b9321db085f1b8e2d8038f
e2941992548cee0d67dd4547e11dd63a
f9c9fc1c5466fb684cf009d7197c2cf7
9e792ab501e6a8a1ca519af2cb9b5f63
67e94c0d47502451357be1b500000290
00000cd300000cd40000002100000600
01000000000016000000000cd3000000
00000000000000000000000000000001
1f00fffd00010000000001146058e4a0
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000cd40000000000000000000000
00000000000000011f00fffd00010000
000001146059f642598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000cd4
00000cd5000000000000002100000600
01000000000016000000000cd4000000
00000000000000000000000000000001
1f00fffd00010000000001146059f642
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000cd50000000000000000000000
00000000000000011f00fffd00010000
00000114605a283e598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000cd5
00000cd6000000000000002100000600
01000000000016000000000cd5000000
00000000000000000000000000000001
1f00fffd0001000000000114605a283e
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000cd60000000000000000000000
00000000000000011f00fffd00010000
00000114605b47c2598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000cd6
00000cd7000000000000002100000600
01000000000016000000000cd6000000
00000000000000000000000000000001
1f00fffd0001000000000114605b47c2
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000cd70000000000000000000000
00000000000000011f00fffd00010000
00000114605b79bf598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000cd7
00000cd8000000000000002100000600
01000000000016000000000cd7000000
00000000000000000000000000000001
1f00fffd0001000000000114605b79bf
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000cd80000000000000000000000
00000000000000011f00fffd00010000
00000114605c9943598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000cd8
00000cd9000000000000002100000600
01000000000016000000000cd8000000
00000000000000000000000000000001
1f00fffd0001000000000114605c9943
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000cd90000000000000000000000
00000000000000011f00fffd00010000
00000114605ccb40598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000cd9
00000cda000000000000002100000600
01000000000016000000000cd9000000
00000000000000000000000000000001
1f00fffd0001000000000114605ccb40
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000cda0000000000000000000000
00000000000000011f00fffd00010000
00000114605deac4598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000cda
00000cdb000000000000002100000600
01000000000016000000000cda000000
00000000000000000000000000000001
1f00fffd0001000000000114605deac4
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000cdb0000000000000000000000
00000000000000011f00fffd00010000
00000114605e1cc0598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000cdb
00000cdc000000000000002100000600
01000000000016000000000cdb000000
00000000000000000000000000000001
1f00fffd0001000000000114605e1cc0
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000cdc0000000000000000000000
00000000000000011f00fffd00010000
00000114605efb3a598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000cdc
00000cdd000000000000002100000600
01000000000016000000000cdc000000
00000000000000000000000000000001
1f00fffd0001000000000114605efb3a
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000cdd0000000000000000000000
00000000000000011f00fffd00010000
00000114605f6e40598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000cdd
00000cde000000000000002100000600
01000000000016000000000cdd000000
00000000000000000000000000000001
1f00fffd0001000000000114605f6e40
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000cde0000000000000000000000
00000000000000011f00fffd00010000
0000011460604cbb598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000cde
00000cdf000000000000002100000600
01000000000016000000000cde000000
00000000000000000000000000000001
1f00fffd000100000000011460604cbb
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000cdf0000000000000000000000
00000000000000011f00fffd00010000
000001146060bfc0598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000cdf
00000ce0000000000000002100000600
01000000000016000000000cdf000000
00000000000000000000000000000001
1f00fffd00010000000001146060bfc0
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000ce00000000000000000000000
00000000000000011f00fffd00010000
0000011460619e3b598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000ce0
00000ce1000000000000002100000600
01000000000016000000000ce0000000
00000000000000000000000000000001
1f00fffd000100000000011460619e3b
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000ce10000000000000000000000
00000000000000011f00fffd00010000
0000011460621140598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b50000029000000ce1
00000ce2000000000000002100000600
01000000000016000000000ce1000000
00000000000000000000000000000001
1f00fffd000100000000011460621140
598e0a83000000000101030803010001
acffb409bcc939f831f7a1e5ec88f7a5
9255ec53040be432027390a4ce896d6f
9086f3c5e177fbfe118163aaec7af146
2c47945944c4e2c026be5e98bbcded25
978272e1e3e079c5094d573f0e83c92f
02b32d3513b1550b826929c80dd0f92c
ac966d17769fd5867b647c3f38029abd
c48152eb8f207159ecc5d232c7c1537c
79f4b7ac28ff11682f21681bf6d6aba5
55032bf6f9f036beb2aaa5b3778d6eeb
fba6bf9ea191be4ab0caea759e2f773a
1f9029c73ecb8d5735b9321db085f1b8
e2d8038fe2941992548cee0d67dd4547
e11dd63af9c9fc1c5466fb684cf009d7
197c2cf79e792ab501e6a8a1ca519af2
cb9b5f6367e94c0d47502451357be1b5
00000021000006000100000000001600
0000000ce20000000000000000000000
00000000000000011f00fffd00010000
000001146062efbb598e0a8300000000
0101030803010001acffb409bcc939f8
31f7a1e5ec88f7a59255ec53040be432
027390a4ce896d6f9086f3c5e177fbfe
118163aaec7af1462c47945944c4e2c0
26be5e98bbcded25978272e1e3e079c5
094d573f0e83c92f02b32d3513b1550b
826929c80dd0f92cac966d17769fd586
7b647c3f38029abdc48152eb8f207159
ecc5d232c7c1537c79f4b7ac28ff1168
2f21681bf6d6aba555032bf6f9f036be
b2aaa5b3778d6eebfba6bf9ea191be4a
b0caea759e2f773a1f9029c73ecb8d57
35b9321db085f1b8e2d8038fe2941992
548cee0d67dd4547e11dd63af9c9fc1c
5466fb684cf009d7197c2cf79e792ab5
01e6a8a1ca519af2cb9b5f6367e94c0d
47502451357be1b5
+3
View File
@@ -40,3 +40,6 @@ cp ns1/maxjournal.jnl.saved ns1/maxjournal.db.jnl
cp ns1/generic.db.in ns1/maxjournal2.db
cp ns1/maxjournal2.jnl.saved ns1/maxjournal2.db.jnl
cp ns1/managed-keys.bind.in ns1/managed-keys.bind
$PERL ../fromhex.pl < ns1/managed-keys.bind.jnl.in > ns1/managed-keys.bind.jnl
+56 -10
View File
@@ -28,7 +28,7 @@ ret=0
dig_with_opts changed soa > dig.out.test$n
grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
grep '2012010902' dig.out.test$n > /dev/null || ret=1
grep 'zone changed/IN: retried using old journal format' ns1/named.run > /dev/null || ret=1
grep 'zone changed/IN: journal rollforward completed successfully using old journal format' ns1/named.run > /dev/null || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
@@ -62,7 +62,8 @@ ret=0
dig_with_opts changed2 soa > dig.out.test$n
grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
grep '2012010902' dig.out.test$n > /dev/null || ret=1
grep 'zone changed2/IN: retried using old journal format' ns1/named.run > /dev/null && ret=1
grep 'zone changed2/IN: journal rollforward completed successfully: success' ns1/named.run > /dev/null || ret=1
grep 'zone changed2/IN: journal rollforward completed successfully using old journal format' ns1/named.run > /dev/null && ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
@@ -72,7 +73,8 @@ ret=0
dig_with_opts unchanged2 soa > dig.out.test$n
grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
grep '2012010901' dig.out.test$n > /dev/null || ret=1
grep 'zone unchanged2/IN: retried using old journal format' ns1/named.run > /dev/null && ret=1
grep 'zone unchanged2/IN: journal rollforward completed successfully' ns1/named.run > /dev/null && ret=1
grep 'zone unchanged2/IN: journal rollforward completed successfully using old journal format' ns1/named.run > /dev/null && ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
@@ -90,7 +92,7 @@ ret=0
dig_with_opts -t soa ixfr > dig.out.test$n
grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
grep '2012010902' dig.out.test$n > /dev/null || ret=1
grep 'zone ixfr/IN: journal rollforward completed successfully: recoverable' ns1/named.run > /dev/null || ret=1
grep 'zone ixfr/IN: journal rollforward completed successfully using old journal format: up to date' ns1/named.run > /dev/null || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
@@ -107,7 +109,9 @@ ret=0
dig_with_opts -t soa hdr1d1d2d1d2 > dig.out.test$n
grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
grep '2012010905' dig.out.test$n > /dev/null || ret=1
grep 'zone hdr1d1d2d1d2/IN: journal rollforward completed successfully: recoverable' ns1/named.run > /dev/null || ret=1
grep 'zone hdr1d1d2d1d2/IN: journal rollforward completed successfully using old journal format: success' ns1/named.run > /dev/null || ret=1
grep 'zone_journal_compact: zone hdr1d1d2d1d2/IN: repair full journal' ns1/named.run > /dev/null || ret=1
grep 'hdr1d1d2d1d2/IN: dns_journal_compact: success' ns1/named.run > /dev/null || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
@@ -127,7 +131,9 @@ ret=0
dig_with_opts -t soa hdr1d2d1d2d1 > dig.out.test$n
grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
grep '2012010905' dig.out.test$n > /dev/null || ret=1
grep 'zone hdr1d2d1d2d1/IN: journal rollforward completed successfully: recoverable' ns1/named.run > /dev/null || ret=1
grep 'zone hdr1d2d1d2d1/IN: journal rollforward completed successfully using old journal format: success' ns1/named.run > /dev/null || ret=1
grep 'zone_journal_compact: zone hdr1d2d1d2d1/IN: repair full journal' ns1/named.run > /dev/null || ret=1
grep 'zone hdr1d2d1d2d1/IN: dns_journal_compact: success' ns1/named.run > /dev/null || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
@@ -150,6 +156,41 @@ c2=$(cat -v ns1/*.jnl | grep -c "BIND LOG V9.2")
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "Check that journal with mixed headers can be compacted (version 1,2,1,2) ($n)"
ret=0
journal=ns1/d1212.jnl.saved
seriallist=$($JOURNALPRINT -x $journal | awk '$1 == "Transaction:" { print $11 }')
for serial in $seriallist
do
cp $journal tmp.jnl
$JOURNALPRINT -c $serial tmp.jnl || ret=1
done
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "Check that journal with mixed headers can be compacted (version 2,1,2,1) ($n)"
ret=0
journal=ns1/d2121.jnl.saved
seriallist=$($JOURNALPRINT -x $journal | awk '$1 == "Transaction:" { print $11 }')
for serial in $seriallist
do
cp ns1/d1212.jnl.saved tmp.jnl
$JOURNALPRINT -c $serial tmp.jnl || ret=1
done
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check upgrade of managed-keys.bind.jnl succeeded($n)"
ret=0
$JOURNALPRINT ns1/managed-keys.bind.jnl > journalprint.out.test$n
lines=$(awk '$1 == "add" && $5 == "SOA" && $8 == "3297" { print }' journalprint.out.test$n | wc -l)
test $lines -eq 1 || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check journal downgrade/upgrade ($n)"
ret=0
@@ -166,10 +207,15 @@ status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check max-journal-size works after journal update ($n)"
ret=0
# a dump should have been triggered by repairing the journal,
# which would have resulted in the journal already being
# compacted.
[ $(wc -c < ns1/maxjournal.db.jnl) -lt 4000 ] || ret=1
# journal was repaired, it should still be big
[ $(wc -c < ns1/maxjournal.db.jnl) -gt 12000 ] || ret=1
# the zone hasn't been dumped yet, so 'rndc sync' should work without
# needing a zone update first.
rndc_with_opts 10.53.0.1 sync maxjournal
check_size() (
[ $(wc -c < ns1/maxjournal.db.jnl) -lt 4000 ]
)
retry_quiet 10 check_size || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
+159 -93
View File
@@ -59,6 +59,7 @@ VIEW2="4xILSZQnuO1UKubXHkYUsvBRPu8="
# EXPECT_ZRRSIG
# EXPECT_KRRSIG
# LEGACY
# PRIVATE
key_key() {
echo "${1}__${2}"
@@ -112,6 +113,7 @@ key_clear() {
key_set "$1" "EXPECT_ZRRSIG" 'no'
key_set "$1" "EXPECT_KRRSIG" 'no'
key_set "$1" "LEGACY" 'no'
key_set "$1" "PRIVATE" 'yes'
}
# Start clear.
@@ -196,8 +198,8 @@ set_policy() {
CDS_DELETE="no"
}
# By default policies are considered to be secure.
# If a zone sets its policy to "none", call 'set_cdsdelete' to tell the system
# test to expect a CDS and CDNSKEY Delete record.
# If a zone sets its policy to "insecure", call 'set_cdsdelete' to tell the
# system test to expect a CDS and CDNSKEY Delete record.
set_cdsdelete() {
CDS_DELETE="yes"
}
@@ -303,6 +305,7 @@ check_key() {
_dnskey_ttl="$DNSKEY_TTL"
_lifetime=$(key_get "$1" LIFETIME)
_legacy=$(key_get "$1" LEGACY)
_private=$(key_get "$1" PRIVATE)
_published=$(key_get "$1" PUBLISHED)
_active=$(key_get "$1" ACTIVE)
@@ -341,7 +344,9 @@ check_key() {
# Check file existence.
[ -s "$KEY_FILE" ] || ret=1
[ -s "$PRIVATE_FILE" ] || ret=1
if [ "$_private" = "yes" ]; then
[ -s "$PRIVATE_FILE" ] || ret=1
fi
if [ "$_legacy" = "no" ]; then
[ -s "$STATE_FILE" ] || ret=1
fi
@@ -352,7 +357,9 @@ check_key() {
grep "; Created:" "$KEY_FILE" > "${ZONE}.${KEY_ID}.${_alg_num}.created" || _log_error "mismatch created comment in $KEY_FILE"
KEY_CREATED=$(awk '{print $3}' < "${ZONE}.${KEY_ID}.${_alg_num}.created")
grep "Created: ${KEY_CREATED}" "$PRIVATE_FILE" > /dev/null || _log_error "mismatch created in $PRIVATE_FILE"
if [ "$_private" = "yes" ]; then
grep "Created: ${KEY_CREATED}" "$PRIVATE_FILE" > /dev/null || _log_error "mismatch created in $PRIVATE_FILE"
fi
if [ "$_legacy" = "no" ]; then
grep "Generated: ${KEY_CREATED}" "$STATE_FILE" > /dev/null || _log_error "mismatch generated in $STATE_FILE"
fi
@@ -363,8 +370,10 @@ check_key() {
grep "This is a ${_role2} key, keyid ${_key_id}, for ${_zone}." "$KEY_FILE" > /dev/null || _log_error "mismatch top comment in $KEY_FILE"
grep "${_zone}\. ${_dnskey_ttl} IN DNSKEY ${_flags} 3 ${_alg_num}" "$KEY_FILE" > /dev/null || _log_error "mismatch DNSKEY record in $KEY_FILE"
# Now check the private key file.
grep "Private-key-format: v1.3" "$PRIVATE_FILE" > /dev/null || _log_error "mismatch private key format in $PRIVATE_FILE"
grep "Algorithm: ${_alg_num} (${_alg_string})" "$PRIVATE_FILE" > /dev/null || _log_error "mismatch algorithm in $PRIVATE_FILE"
if [ "$_private" = "yes" ]; then
grep "Private-key-format: v1.3" "$PRIVATE_FILE" > /dev/null || _log_error "mismatch private key format in $PRIVATE_FILE"
grep "Algorithm: ${_alg_num} (${_alg_string})" "$PRIVATE_FILE" > /dev/null || _log_error "mismatch algorithm in $PRIVATE_FILE"
fi
# Now check the key state file.
if [ "$_legacy" = "no" ]; then
grep "This is the state of key ${_key_id}, for ${_zone}." "$STATE_FILE" > /dev/null || _log_error "mismatch top comment in $STATE_FILE"
@@ -444,6 +453,8 @@ check_timingmetadata() {
_key_file="${_base_file}.key"
_private_file="${_base_file}.private"
_state_file="${_base_file}.state"
_legacy=$(key_get "$1" LEGACY)
_private=$(key_get "$1" PRIVATE)
_published=$(key_get "$1" PUBLISHED)
_syncpublish=$(key_get "$1" SYNCPUBLISH)
@@ -459,13 +470,17 @@ check_timingmetadata() {
if [ "$_published" = "none" ]; then
grep "; Publish:" "${_key_file}" > /dev/null && _log_error "unexpected publish comment in ${_key_file}"
grep "Publish:" "${_private_file}" > /dev/null && _log_error "unexpected publish in ${_private_file}"
if [ "$_private" = "yes" ]; then
grep "Publish:" "${_private_file}" > /dev/null && _log_error "unexpected publish in ${_private_file}"
fi
if [ "$_legacy" = "no" ]; then
grep "Published: " "${_state_file}" > /dev/null && _log_error "unexpected publish in ${_state_file}"
fi
else
grep "; Publish: $_published" "${_key_file}" > /dev/null || _log_error "mismatch publish comment in ${_key_file} (expected ${_published})"
grep "Publish: $_published" "${_private_file}" > /dev/null || _log_error "mismatch publish in ${_private_file} (expected ${_published})"
if [ "$_private" = "yes" ]; then
grep "Publish: $_published" "${_private_file}" > /dev/null || _log_error "mismatch publish in ${_private_file} (expected ${_published})"
fi
if [ "$_legacy" = "no" ]; then
grep "Published: $_published" "${_state_file}" > /dev/null || _log_error "mismatch publish in ${_state_file} (expected ${_published})"
fi
@@ -473,13 +488,17 @@ check_timingmetadata() {
if [ "$_syncpublish" = "none" ]; then
grep "; SyncPublish:" "${_key_file}" > /dev/null && _log_error "unexpected syncpublish comment in ${_key_file}"
grep "SyncPublish:" "${_private_file}" > /dev/null && _log_error "unexpected syncpublish in ${_private_file}"
if [ "$_private" = "yes" ]; then
grep "SyncPublish:" "${_private_file}" > /dev/null && _log_error "unexpected syncpublish in ${_private_file}"
fi
if [ "$_legacy" = "no" ]; then
grep "PublishCDS: " "${_state_file}" > /dev/null && _log_error "unexpected syncpublish in ${_state_file}"
fi
else
grep "; SyncPublish: $_syncpublish" "${_key_file}" > /dev/null || _log_error "mismatch syncpublish comment in ${_key_file} (expected ${_syncpublish})"
grep "SyncPublish: $_syncpublish" "${_private_file}" > /dev/null || _log_error "mismatch syncpublish in ${_private_file} (expected ${_syncpublish})"
if [ "$_private" = "yes" ]; then
grep "SyncPublish: $_syncpublish" "${_private_file}" > /dev/null || _log_error "mismatch syncpublish in ${_private_file} (expected ${_syncpublish})"
fi
if [ "$_legacy" = "no" ]; then
grep "PublishCDS: $_syncpublish" "${_state_file}" > /dev/null || _log_error "mismatch syncpublish in ${_state_file} (expected ${_syncpublish})"
fi
@@ -487,13 +506,17 @@ check_timingmetadata() {
if [ "$_active" = "none" ]; then
grep "; Activate:" "${_key_file}" > /dev/null && _log_error "unexpected active comment in ${_key_file}"
grep "Activate:" "${_private_file}" > /dev/null && _log_error "unexpected active in ${_private_file}"
if [ "$_private" = "yes" ]; then
grep "Activate:" "${_private_file}" > /dev/null && _log_error "unexpected active in ${_private_file}"
fi
if [ "$_legacy" = "no" ]; then
grep "Active: " "${_state_file}" > /dev/null && _log_error "unexpected active in ${_state_file}"
fi
else
grep "; Activate: $_active" "${_key_file}" > /dev/null || _log_error "mismatch active comment in ${_key_file} (expected ${_active})"
grep "Activate: $_active" "${_private_file}" > /dev/null || _log_error "mismatch active in ${_private_file} (expected ${_active})"
if [ "$_private" = "yes" ]; then
grep "Activate: $_active" "${_private_file}" > /dev/null || _log_error "mismatch active in ${_private_file} (expected ${_active})"
fi
if [ "$_legacy" = "no" ]; then
grep "Active: $_active" "${_state_file}" > /dev/null || _log_error "mismatch active in ${_state_file} (expected ${_active})"
fi
@@ -501,13 +524,17 @@ check_timingmetadata() {
if [ "$_retired" = "none" ]; then
grep "; Inactive:" "${_key_file}" > /dev/null && _log_error "unexpected retired comment in ${_key_file}"
grep "Inactive:" "${_private_file}" > /dev/null && _log_error "unexpected retired in ${_private_file}"
if [ "$_private" = "yes" ]; then
grep "Inactive:" "${_private_file}" > /dev/null && _log_error "unexpected retired in ${_private_file}"
fi
if [ "$_legacy" = "no" ]; then
grep "Retired: " "${_state_file}" > /dev/null && _log_error "unexpected retired in ${_state_file}"
fi
else
grep "; Inactive: $_retired" "${_key_file}" > /dev/null || _log_error "mismatch retired comment in ${_key_file} (expected ${_retired})"
grep "Inactive: $_retired" "${_private_file}" > /dev/null || _log_error "mismatch retired in ${_private_file} (expected ${_retired})"
if [ "$_private" = "yes" ]; then
grep "Inactive: $_retired" "${_private_file}" > /dev/null || _log_error "mismatch retired in ${_private_file} (expected ${_retired})"
fi
if [ "$_legacy" = "no" ]; then
grep "Retired: $_retired" "${_state_file}" > /dev/null || _log_error "mismatch retired in ${_state_file} (expected ${_retired})"
fi
@@ -515,13 +542,17 @@ check_timingmetadata() {
if [ "$_revoked" = "none" ]; then
grep "; Revoke:" "${_key_file}" > /dev/null && _log_error "unexpected revoked comment in ${_key_file}"
grep "Revoke:" "${_private_file}" > /dev/null && _log_error "unexpected revoked in ${_private_file}"
if [ "$_private" = "yes" ]; then
grep "Revoke:" "${_private_file}" > /dev/null && _log_error "unexpected revoked in ${_private_file}"
fi
if [ "$_legacy" = "no" ]; then
grep "Revoked: " "${_state_file}" > /dev/null && _log_error "unexpected revoked in ${_state_file}"
fi
else
grep "; Revoke: $_revoked" "${_key_file}" > /dev/null || _log_error "mismatch revoked comment in ${_key_file} (expected ${_revoked})"
grep "Revoke: $_revoked" "${_private_file}" > /dev/null || _log_error "mismatch revoked in ${_private_file} (expected ${_revoked})"
if [ "$_private" = "yes" ]; then
grep "Revoke: $_revoked" "${_private_file}" > /dev/null || _log_error "mismatch revoked in ${_private_file} (expected ${_revoked})"
fi
if [ "$_legacy" = "no" ]; then
grep "Revoked: $_revoked" "${_state_file}" > /dev/null || _log_error "mismatch revoked in ${_state_file} (expected ${_revoked})"
fi
@@ -529,13 +560,17 @@ check_timingmetadata() {
if [ "$_removed" = "none" ]; then
grep "; Delete:" "${_key_file}" > /dev/null && _log_error "unexpected removed comment in ${_key_file}"
grep "Delete:" "${_private_file}" > /dev/null && _log_error "unexpected removed in ${_private_file}"
if [ "$_private" = "yes" ]; then
grep "Delete:" "${_private_file}" > /dev/null && _log_error "unexpected removed in ${_private_file}"
fi
if [ "$_legacy" = "no" ]; then
grep "Removed: " "${_state_file}" > /dev/null && _log_error "unexpected removed in ${_state_file}"
fi
else
grep "; Delete: $_removed" "${_key_file}" > /dev/null || _log_error "mismatch removed comment in ${_key_file} (expected ${_removed})"
grep "Delete: $_removed" "${_private_file}" > /dev/null || _log_error "mismatch removed in ${_private_file} (expected ${_removed})"
if [ "$_private" = "yes" ]; then
grep "Delete: $_removed" "${_private_file}" > /dev/null || _log_error "mismatch removed in ${_private_file} (expected ${_removed})"
fi
if [ "$_legacy" = "no" ]; then
grep "Removed: $_removed" "${_state_file}" > /dev/null || _log_error "mismatch removed in ${_state_file} (expected ${_removed})"
fi
@@ -672,7 +707,7 @@ _check_keys() {
# Check key files.
_ids=$(get_keyids "$DIR" "$ZONE")
for _id in $_ids; do
# There are three key files with the same algorithm.
# There are multiple key files with the same algorithm.
# Check them until a match is found.
ret=0
echo_i "check key id $_id"
@@ -779,18 +814,22 @@ check_dnssecstatus() {
_rndccmd $_server dnssec -status $_zone in $_view > rndc.dnssec.status.out.$_zone.$n || _log_error "rndc dnssec -status zone ${_zone} failed"
grep "dnssec-policy: ${_policy}" rndc.dnssec.status.out.$_zone.$n > /dev/null || _log_error "bad dnssec status for signed zone ${_zone}"
if [ "$(key_get KEY1 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY1 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || _log_error "missing key $(key_get KEY1 ID) from dnssec status"
fi
if [ "$(key_get KEY2 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY2 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || _log_error "missing key $(key_get KEY2 ID) from dnssec status"
fi
if [ "$(key_get KEY3 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY3 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || _log_error "missing key $(key_get KEY3 ID) from dnssec status"
fi
if [ "$(key_get KEY4 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY4 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || _log_error "missing key $(key_get KEY4 ID) from dnssec status"
if [ "$_policy" = "none" ]; then
grep "Zone does not have dnssec-policy" rndc.dnssec.status.out.$_zone.$n > /dev/null || log_error "bad dnssec status for unsigned zone ${_zone}"
else
grep "dnssec-policy: ${_policy}" rndc.dnssec.status.out.$_zone.$n > /dev/null || _log_error "bad dnssec status for signed zone ${_zone}"
if [ "$(key_get KEY1 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY1 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || _log_error "missing key $(key_get KEY1 ID) from dnssec status"
fi
if [ "$(key_get KEY2 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY2 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || _log_error "missing key $(key_get KEY2 ID) from dnssec status"
fi
if [ "$(key_get KEY3 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY3 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || _log_error "missing key $(key_get KEY3 ID) from dnssec status"
fi
if [ "$(key_get KEY4 EXPECT)" = "yes" ]; then
grep "key: $(key_get KEY4 ID)" rndc.dnssec.status.out.$_zone.$n > /dev/null || _log_error "missing key $(key_get KEY4 ID) from dnssec status"
fi
fi
test "$ret" -eq 0 || echo_i "failed"
@@ -799,11 +838,13 @@ check_dnssecstatus() {
# Check if RRset of type $1 in file $2 is signed with the right keys.
# The right keys are the ones that expect a signature and matches the role $3.
check_signatures() {
_check_signatures() {
_qtype=$1
_file=$2
_role=$3
numsigs=0
if [ "$_role" = "KSK" ]; then
_expect_type=EXPECT_KRRSIG
elif [ "$_role" = "ZSK" ]; then
@@ -811,28 +852,41 @@ check_signatures() {
fi
if [ "$(key_get KEY1 "$_expect_type")" = "yes" ] && [ "$(key_get KEY1 "$_role")" = "yes" ]; then
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY1 ID)$" > /dev/null || _log_error "${_qtype} RRset not signed with key $(key_get KEY1 ID)"
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY1 ID)$" > /dev/null || return 1
numsigs=$((numsigs+1))
elif [ "$(key_get KEY1 EXPECT)" = "yes" ]; then
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY1 ID)$" > /dev/null && _log_error "${_qtype} RRset signed unexpectedly with key $(key_get KEY1 ID)"
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY1 ID)$" > /dev/null && return 1
fi
if [ "$(key_get KEY2 "$_expect_type")" = "yes" ] && [ "$(key_get KEY2 "$_role")" = "yes" ]; then
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY2 ID)$" > /dev/null || _log_error "${_qtype} RRset not signed with key $(key_get KEY2 ID)"
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY2 ID)$" > /dev/null || return 1
numsigs=$((numsigs+1))
elif [ "$(key_get KEY2 EXPECT)" = "yes" ]; then
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY2 ID)$" > /dev/null && _log_error "${_qtype} RRset signed unexpectedly with key $(key_get KEY2 ID)"
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY2 ID)$" > /dev/null && return 1
fi
if [ "$(key_get KEY3 "$_expect_type")" = "yes" ] && [ "$(key_get KEY3 "$_role")" = "yes" ]; then
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY3 ID)$" > /dev/null || _log_error "${_qtype} RRset not signed with key $(key_get KEY3 ID)"
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY3 ID)$" > /dev/null || return 1
numsigs=$((numsigs+1))
elif [ "$(key_get KEY3 EXPECT)" = "yes" ]; then
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY3 ID)$" > /dev/null && _log_error "${_qtype} RRset signed unexpectedly with key $(key_get KEY3 ID)"
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY3 ID)$" > /dev/null && return 1
fi
if [ "$(key_get KEY4 "$_expect_type")" = "yes" ] && [ "$(key_get KEY4 "$_role")" = "yes" ]; then
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY4 ID)$" > /dev/null || _log_error "${_qtype} RRset not signed with key $(key_get KEY4 ID)"
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY4 ID)$" > /dev/null || return 1
numsigs=$((numsigs+1))
elif [ "$(key_get KEY4 EXPECT)" = "yes" ]; then
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY4 ID)$" > /dev/null && _log_error "${_qtype} RRset signed unexpectedly with key $(key_get KEY4 ID)"
get_keys_which_signed "$_qtype" "$_file" | grep "^$(key_get KEY4 ID)$" > /dev/null && return 1
fi
lines=$(get_keys_which_signed "${_qtype}" "${_file}" | wc -l)
test "$lines" -eq "$numsigs" || echo_i "bad number of signatures for $_qtype (got $lines, expected $numsigs)"
test "$lines" -eq "$numsigs" || return 1
return 0
}
check_signatures() {
retry_quiet 3 _check_signatures $1 $2 $3 || _log_error "RRset $1 in zone $ZONE incorrectly signed"
}
response_has_cds_for_key() (
@@ -867,6 +921,8 @@ check_cds() {
echo_i "check CDS and CDNSKEY rrset are signed correctly for zone ${ZONE} ($n)"
ret=0
_checksig=0
_dig_with_opts "$ZONE" "@${SERVER}" "CDS" > "dig.out.$DIR.test$n.cds" || _log_error "dig ${ZONE} CDS failed"
grep "status: NOERROR" "dig.out.$DIR.test$n.cds" > /dev/null || _log_error "mismatch status in DNS response"
@@ -879,13 +935,13 @@ check_cds() {
else
grep "CDS.*0 0 0 00" "dig.out.$DIR.test$n.cds" > /dev/null || _log_error "missing CDS DELETE record in DNS response"
grep "CDNSKEY.*0 3 0 AA==" "dig.out.$DIR.test$n.cdnskey" > /dev/null || _log_error "missing CDNSKEY DELETE record in DNS response"
_checksig=1
fi
if [ "$(key_get KEY1 STATE_DS)" = "rumoured" ] || [ "$(key_get KEY1 STATE_DS)" = "omnipresent" ]; then
response_has_cds_for_key KEY1 "dig.out.$DIR.test$n.cds" || _log_error "missing CDS record in response for key $(key_get KEY1 ID)"
check_signatures "CDS" "dig.out.$DIR.test$n.cds" "KSK"
response_has_cdnskey_for_key KEY1 "dig.out.$DIR.test$n.cdnskey" || _log_error "missing CDNSKEY record in response for key $(key_get KEY1 ID)"
check_signatures "CDNSKEY" "dig.out.$DIR.test$n.cdnskey" "KSK"
_checksig=1
elif [ "$(key_get KEY1 EXPECT)" = "yes" ]; then
response_has_cds_for_key KEY1 "dig.out.$DIR.test$n.cds" && _log_error "unexpected CDS record in response for key $(key_get KEY1 ID)"
# KEY1 should not have an associated CDNSKEY, but there may be
@@ -896,9 +952,8 @@ check_cds() {
if [ "$(key_get KEY2 STATE_DS)" = "rumoured" ] || [ "$(key_get KEY2 STATE_DS)" = "omnipresent" ]; then
response_has_cds_for_key KEY2 "dig.out.$DIR.test$n.cds" || _log_error "missing CDS record in response for key $(key_get KEY2 ID)"
check_signatures "CDS" "dig.out.$DIR.test$n.cds" "KSK"
response_has_cdnskey_for_key KEY2 "dig.out.$DIR.test$n.cdnskey" || _log_error "missing CDNSKEY record in response for key $(key_get KEY2 ID)"
check_signatures "CDNSKEY" "dig.out.$DIR.test$n.cdnskey" "KSK"
_checksig=1
elif [ "$(key_get KEY2 EXPECT)" = "yes" ]; then
response_has_cds_for_key KEY2 "dig.out.$DIR.test$n.cds" && _log_error "unexpected CDS record in response for key $(key_get KEY2 ID)"
# KEY2 should not have an associated CDNSKEY, but there may be
@@ -909,9 +964,8 @@ check_cds() {
if [ "$(key_get KEY3 STATE_DS)" = "rumoured" ] || [ "$(key_get KEY3 STATE_DS)" = "omnipresent" ]; then
response_has_cds_for_key KEY3 "dig.out.$DIR.test$n.cds" || _log_error "missing CDS record in response for key $(key_get KEY3 ID)"
check_signatures "CDS" "dig.out.$DIR.test$n.cds" "KSK"
response_has_cdnskey_for_key KEY3 "dig.out.$DIR.test$n.cdnskey" || _log_error "missing CDNSKEY record in response for key $(key_get KEY3 ID)"
check_signatures "CDNSKEY" "dig.out.$DIR.test$n.cdnskey" "KSK"
_checksig=1
elif [ "$(key_get KEY3 EXPECT)" = "yes" ]; then
response_has_cds_for_key KEY3 "dig.out.$DIR.test$n.cds" && _log_error "unexpected CDS record in response for key $(key_get KEY3 ID)"
# KEY3 should not have an associated CDNSKEY, but there may be
@@ -922,9 +976,8 @@ check_cds() {
if [ "$(key_get KEY4 STATE_DS)" = "rumoured" ] || [ "$(key_get KEY4 STATE_DS)" = "omnipresent" ]; then
response_has_cds_for_key KEY4 "dig.out.$DIR.test$n.cds" || _log_error "missing CDS record in response for key $(key_get KEY4 ID)"
check_signatures "CDS" "dig.out.$DIR.test$n.cds" "KSK"
response_has_cdnskey_for_key KEY4 "dig.out.$DIR.test$n.cdnskey" || _log_error "missing CDNSKEY record in response for key $(key_get KEY4 ID)"
check_signatures "CDNSKEY" "dig.out.$DIR.test$n.cdnskey" "KSK"
_checksig=1
elif [ "$(key_get KEY4 EXPECT)" = "yes" ]; then
response_has_cds_for_key KEY4 "dig.out.$DIR.test$n.cds" && _log_error "unexpected CDS record in response for key $(key_get KEY4 ID)"
# KEY4 should not have an associated CDNSKEY, but there may be
@@ -933,68 +986,81 @@ check_cds() {
# so let's skip this check for now.
fi
test "$_checksig" -eq 0 || check_signatures "CDS" "dig.out.$DIR.test$n.cds" "KSK"
test "$_checksig" -eq 0 || check_signatures "CDNSKEY" "dig.out.$DIR.test$n.cdnskey" "KSK"
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
}
# Test DNSKEY query.
_check_apex_dnskey() {
_dig_with_opts "$ZONE" "@${SERVER}" "DNSKEY" > "dig.out.$DIR.test$n" || return 1
grep "status: NOERROR" "dig.out.$DIR.test$n" > /dev/null || return 1
_checksig=0
if [ "$(key_get KEY1 STATE_DNSKEY)" = "rumoured" ] || [ "$(key_get KEY1 STATE_DNSKEY)" = "omnipresent" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*DNSKEY.*257.*.3.*$(key_get KEY1 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null || return 1
_checksig=1
elif [ "$(key_get KEY1 EXPECT)" = "yes" ]; then
grep "${ZONE}\.*${DNSKEY_TTL}.*IN.*DNSKEY.*257.*.3.*$(key_get KEY1 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null && return 1
fi
if [ "$(key_get KEY2 STATE_DNSKEY)" = "rumoured" ] || [ "$(key_get KEY2 STATE_DNSKEY)" = "omnipresent" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*DNSKEY.*257.*.3.*$(key_get KEY2 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null || return 1
_checksig=1
elif [ "$(key_get KEY2 EXPECT)" = "yes" ]; then
grep "${ZONE}\.*${DNSKEY_TTL}.*IN.*DNSKEY.*257.*.3.*$(key_get KEY2 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null && return 1
fi
if [ "$(key_get KEY3 STATE_DNSKEY)" = "rumoured" ] || [ "$(key_get KEY3 STATE_DNSKEY)" = "omnipresent" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*DNSKEY.*257.*.3.*$(key_get KEY3 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null || return 1
_checksig=1
elif [ "$(key_get KEY3 EXPECT)" = "yes" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*DNSKEY.*257.*.3.*$(key_get KEY3 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null && return 1
fi
if [ "$(key_get KEY4 STATE_DNSKEY)" = "rumoured" ] || [ "$(key_get KEY4 STATE_DNSKEY)" = "omnipresent" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*DNSKEY.*257.*.3.*$(key_get KEY4 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null || return 1
_checksig=1
elif [ "$(key_get KEY4 EXPECT)" = "yes" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*DNSKEY.*257.*.3.*$(key_get KEY4 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null && return 1
fi
test "$_checksig" -eq 0 && return 0
retry_quiet 3 _check_signatures "DNSKEY" "dig.out.$DIR.test$n" "KSK" || return 1
return 0
}
# Test the apex of a configured zone. This checks that the SOA and DNSKEY
# RRsets are signed correctly and with the appropriate keys.
check_apex() {
# Test DNSKEY query.
_qtype="DNSKEY"
n=$((n+1))
echo_i "check ${_qtype} rrset is signed correctly for zone ${ZONE} ($n)"
echo_i "check DNSKEY rrset is signed correctly for zone ${ZONE} ($n)"
ret=0
_dig_with_opts "$ZONE" "@${SERVER}" $_qtype > "dig.out.$DIR.test$n" || _log_error "dig ${ZONE} ${_qtype} failed"
grep "status: NOERROR" "dig.out.$DIR.test$n" > /dev/null || _log_error "mismatch status in DNS response"
if [ "$(key_get KEY1 STATE_DNSKEY)" = "rumoured" ] || [ "$(key_get KEY1 STATE_DNSKEY)" = "omnipresent" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*${_qtype}.*257.*.3.*$(key_get KEY1 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null || _log_error "missing ${_qtype} record in response for key $(key_get KEY1 ID)"
check_signatures $_qtype "dig.out.$DIR.test$n" "KSK"
numkeys=$((numkeys+1))
elif [ "$(key_get KEY1 EXPECT)" = "yes" ]; then
grep "${ZONE}\.*${DNSKEY_TTL}.*IN.*${_qtype}.*257.*.3.*$(key_get KEY1 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null && _log_error "unexpected ${_qtype} record in response for key $(key_get KEY1 ID)"
fi
if [ "$(key_get KEY2 STATE_DNSKEY)" = "rumoured" ] || [ "$(key_get KEY2 STATE_DNSKEY)" = "omnipresent" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*${_qtype}.*257.*.3.*$(key_get KEY2 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null || _log_error "missing ${_qtype} record in response for key $(key_get KEY2 ID)"
check_signatures $_qtype "dig.out.$DIR.test$n" "KSK"
numkeys=$((numkeys+1))
elif [ "$(key_get KEY2 EXPECT)" = "yes" ]; then
grep "${ZONE}\.*${DNSKEY_TTL}.*IN.*${_qtype}.*257.*.3.*$(key_get KEY2 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null && _log_error "unexpected ${_qtype} record in response for key $(key_get KEY2 ID)"
fi
if [ "$(key_get KEY3 STATE_DNSKEY)" = "rumoured" ] || [ "$(key_get KEY3 STATE_DNSKEY)" = "omnipresent" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*${_qtype}.*257.*.3.*$(key_get KEY3 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null || _log_error "missing ${_qtype} record in response for key $(key_get KEY3 ID)"
check_signatures $_qtype "dig.out.$DIR.test$n" "KSK"
numkeys=$((numkeys+1))
elif [ "$(key_get KEY3 EXPECT)" = "yes" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*${_qtype}.*257.*.3.*$(key_get KEY3 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null && _log_error "unexpected ${_qtype} record in response for key $(key_get KEY3 ID)"
fi
if [ "$(key_get KEY4 STATE_DNSKEY)" = "rumoured" ] || [ "$(key_get KEY4 STATE_DNSKEY)" = "omnipresent" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*${_qtype}.*257.*.3.*$(key_get KEY4 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null || _log_error "missing ${_qtype} record in response for key $(key_get KEY4 ID)"
check_signatures $_qtype "dig.out.$DIR.test$n" "KSK"
numkeys=$((numkeys+1))
elif [ "$(key_get KEY4 EXPECT)" = "yes" ]; then
grep "${ZONE}\..*${DNSKEY_TTL}.*IN.*${_qtype}.*257.*.3.*$(key_get KEY4 ALG_NUM)" "dig.out.$DIR.test$n" > /dev/null && _log_error "unexpected ${_qtype} record in response for key $(key_get KEY4 ID)"
fi
lines=$(get_keys_which_signed $_qtype "dig.out.$DIR.test$n" | wc -l)
check_signatures $_qtype "dig.out.$DIR.test$n" "KSK"
retry_quiet 3 _check_apex_dnskey || ret=1
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
# We retry the DNSKEY query for at most three seconds to avoid test
# failures due to timing issues. If the DNSKEY query check passes this
# means the zone is resigned and further apex checks (SOA, CDS, CDNSKEY)
# don't need to be retried quietly.
# Test SOA query.
_qtype="SOA"
n=$((n+1))
echo_i "check ${_qtype} rrset is signed correctly for zone ${ZONE} ($n)"
echo_i "check SOA rrset is signed correctly for zone ${ZONE} ($n)"
ret=0
_dig_with_opts "$ZONE" "@${SERVER}" $_qtype > "dig.out.$DIR.test$n" || _log_error "dig ${ZONE} ${_qtype} failed"
_dig_with_opts "$ZONE" "@${SERVER}" "SOA" > "dig.out.$DIR.test$n" || _log_error "dig ${ZONE} SOA failed"
grep "status: NOERROR" "dig.out.$DIR.test$n" > /dev/null || _log_error "mismatch status in DNS response"
grep "${ZONE}\..*${DEFAULT_TTL}.*IN.*${_qtype}.*" "dig.out.$DIR.test$n" > /dev/null || _log_error "missing ${_qtype} record in response"
lines=$(get_keys_which_signed $_qtype "dig.out.$DIR.test$n" | wc -l)
check_signatures $_qtype "dig.out.$DIR.test$n" "ZSK"
grep "${ZONE}\..*${DEFAULT_TTL}.*IN.*SOA.*" "dig.out.$DIR.test$n" > /dev/null || _log_error "missing SOA record in response"
check_signatures "SOA" "dig.out.$DIR.test$n" "ZSK"
test "$ret" -eq 0 || echo_i "failed"
status=$((status+ret))
+16
View File
@@ -100,6 +100,13 @@ zone "unsigned.kasp" {
dnssec-policy "none";
};
/* A zone that is initially set to insecure. */
zone "insecure.kasp" {
type primary;
file "insecure.kasp.db";
dnssec-policy "insecure";
};
/* A master zone with dnssec-policy but keys already created. */
zone "dnssec-keygen.kasp" {
type primary;
@@ -245,6 +252,15 @@ zone "unfresh-sigs.autosign" {
dnssec-policy "autosign";
};
/*
* Zone that has missing private KSK.
*/
zone "ksk-missing.autosign" {
type primary;
file "ksk-missing.autosign.db";
dnssec-policy "autosign";
};
/*
* Zone that has missing private ZSK.
*/
+31 -2
View File
@@ -77,6 +77,14 @@ zone="unsigned.kasp"
echo_i "setting up zone: $zone"
zonefile="${zone}.db"
infile="${zone}.db.infile"
cp template.db.in $infile
cp template.db.in $zonefile
# Set up zone that stays unsigned.
zone="insecure.kasp"
echo_i "setting up zone: $zone"
zonefile="${zone}.db"
infile="${zone}.db.infile"
cp template.db.in $zonefile
# Some of these zones already have keys.
@@ -187,7 +195,25 @@ private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$KSK" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$ZSK" >> "$infile"
$SIGNER -S -x -s now-1w -e now+1w -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
# These signatures are already expired, and the private ZSK is missing.
# These signatures are still good, but the private KSK is missing.
setup ksk-missing.autosign
T="now-6mo"
ksktimes="-P $T -A $T -P sync $T"
zsktimes="-P $T -A $T"
KSK=$($KEYGEN -a $DEFAULT_ALGORITHM -L 300 -f KSK $ksktimes $zone 2> keygen.out.$zone.1)
ZSK=$($KEYGEN -a $DEFAULT_ALGORITHM -L 300 $zsktimes $zone 2> keygen.out.$zone.2)
$SETTIME -s -g $O -d $O $T -k $O $T -r $O $T "$KSK" > settime.out.$zone.1 2>&1
$SETTIME -s -g $O -k $O $T -z $O $T "$ZSK" > settime.out.$zone.2 2>&1
cat template.db.in "${KSK}.key" "${ZSK}.key" > "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$KSK" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$ZSK" >> "$infile"
$SIGNER -S -x -s now-1w -e now+1w -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
echo "KSK: yes" >> "${KSK}".state
echo "ZSK: no" >> "${KSK}".state
echo "Lifetime: 63072000" >> "${KSK}".state # PT2Y
rm -f "${KSK}".private
# These signatures are still good, but the private ZSK is missing.
setup zsk-missing.autosign
T="now-6mo"
ksktimes="-P $T -A $T -P sync $T"
@@ -199,7 +225,10 @@ $SETTIME -s -g $O -k $O $T -z $O $T "$ZSK" > settime.out.$zone.2 2>&1
cat template.db.in "${KSK}.key" "${ZSK}.key" > "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$KSK" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$ZSK" >> "$infile"
$SIGNER -PS -x -s now-2w -e now-1mi -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
$SIGNER -S -x -s now-1w -e now+1w -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
echo "KSK: no" >> "${ZSK}".state
echo "ZSK: yes" >> "${ZSK}".state
echo "Lifetime: 31536000" >> "${ZSK}".state # PT1Y
rm -f "${ZSK}".private
# These signatures are already expired, and the private ZSK is retired.
+6
View File
@@ -50,6 +50,12 @@ zone "step1.going-insecure-dynamic.kasp" {
allow-update { any; };
};
zone "step1.going-straight-to-none.kasp" {
type master;
file "step1.going-straight-to-none.kasp.db";
dnssec-policy "default";
};
/* These are alorithm rollover test zones. */
zone "step1.algorithm-roll.kasp" {
type primary;

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