Compare commits

...
Author SHA1 Message Date
Matthijs Mekking d0b1a8b69a fixup! Refactor zone.c, use dns_remote_t structure 2022-10-28 10:26:05 +02:00
Matthijs Mekking 2d2a5dc860 fixup! Add new files for remote server communication 2022-10-28 10:24:36 +02:00
Matthijs Mekking 6bf3a30585 Refactor zone.c, use dns_remote_t structure
Use the new dns_remote_t structure for remote server communication to
primaries, parental agents, etc.
2022-10-26 14:40:30 +02:00
Matthijs Mekking 8cfeb973a4 Add new files for remote server communication
The dns_remote_t structure is intended to replace the variables in
the structure that deals with remote server communication to primaries,
parental agents, forwarders, etc.
2022-10-26 14:38:19 +02:00
Matthijs Mekking 0dc43a0a1f Add updateds system test 2022-10-21 16:33:51 +02:00
Matthijs Mekking 24d9677c0f Add update-ds configuration
Introduce a way to configure servers that can be used to dynamically
update DS records during KSK rollovers. The update-ds configuration
option is a zone only option and may reference a parental-agents
statement.

Add some checkconf checks similar to parental-agents, like the option
being at the wrong level, a duplicate list, an empty list, at the
wrong zone type, and a reference to parental-agents not found.
2022-10-21 16:26:54 +02:00
Arаm Sаrgsyаn 2bd3b452cf Merge branch '3598-adb-quota-might-not-be-decremented' into 'main'
Resolve "ADB quota might not be decremented"

Closes #3598

See merge request isc-projects/bind9!6893
2022-10-21 08:50:53 +00:00
Aram Sargsyan 6f50972e5f Add CHANGES and release notes for [GL #3598] 2022-10-21 08:25:31 +00:00
Aram Sargsyan 5da79e2be0 Call dns_adb_endudpfetch() on error path, if required
For UDP queries, after calling dns_adb_beginudpfetch() in fctx_query(),
make sure that dns_adb_endudpfetch() is also called on error path, in
order to adjust the quota back.
2022-10-21 08:08:55 +00:00
Aram Sargsyan e4569373ca Always call dns_adb_endudpfetch() in fctx_cancelquery() for UDP queries
It is currently possible that dns_adb_endudpfetch() is not
called in fctx_cancelquery() for a UDP query, which results
in quotas not being adjusted back.

Always call dns_adb_endudpfetch() for UDP queries.
2022-10-21 08:08:47 +00:00
Aram Sargsyan ac889684c7 Unlink the query under cleanup_query
In the cleanup code of fctx_query() function there is a code path
where 'query' is linked to 'fctx' and it is being destroyed.

Make sure that 'query' is unlinked before destroying it.
2022-10-21 08:08:37 +00:00
Ondřej Surý 442215dc6b Merge branch '3563-fix-named-startup-on-manycore-solaris-systems' into 'main'
Fix named failing to start on Solaris systems with hundreds of CPUs

Closes #3563

See merge request isc-projects/bind9!6955
2022-10-20 12:02:04 +00:00
Artem BoldarievandOndřej Surý 2c9400f116 Modify release notes [GL #3563]
Mention that a startup problem on manycore Solaris systems is fixed.
2022-10-20 14:01:28 +02:00
Artem BoldarievandOndřej Surý 03ee132e28 Modify CHANGES [GL #3563]
Mention that a startup problem on manycore Solaris systems is fixed.
2022-10-20 14:01:28 +02:00
Artem BoldarievandOndřej Surý fff01fe7eb Fix named failing to start on Solaris systems with hundreds of CPUs
This commit fixes a startup issue on Solaris systems with
many (reportedly > 510) CPUs by bumping RLIMIT_NOFILE. This appears to
be a regression from 9.11.
2022-10-20 14:01:28 +02:00
Ondřej Surý afd1908aa3 Merge branch '3270-use-curl-in-statschannel-system-test' into 'main'
Replace raw nc usage in statschannel system test with curl

Closes #3270

See merge request isc-projects/bind9!6946
2022-10-20 12:00:54 +00:00
Ondřej Surý cd0e5c5784 Replace some raw nc usage in statschannel system test with curl
For tests where the TCP connection might get interrupted abruptly,
replace the nc with curl as the data sent from server to client might
get lost because of abrupt TCP connection.  This happens when the TCP
connection gets closed during sending the large request to the server.

As we already require curl for other system tests, replace the nc usage
in the statschannel test with curl that actually understands the
HTTP/1.1 protocol, so the same connection is reused for sending the
consequtive requests, but without client-side "pipelining".

For the record, the server doesn't support parallel processing of the
pipelined request, so it's a bit misnomer here, because what we are
actually testing is that we process all requests received in a single
TCP read callback.
2022-10-20 12:23:34 +02:00
Michal Nowak 97b9a7eb56 Merge tag 'v9_19_6'
BIND 9.19.6
2022-10-20 11:01:27 +02:00
Evan Hunt 6c8bc44bc4 Merge branch '3247-rpz-ip-cd' into 'main'
ensure RPZ lookups handle CD=1 correctly

Closes #3247

See merge request isc-projects/bind9!6944
2022-10-19 20:11:26 +00:00
Evan Hunt 3676f6394b CHANGES for [GL #3247] 2022-10-19 11:36:11 -07:00
Evan Hunt 575a924b1a add a test with CD=1 query for pending data
this is a regression test for [GL #3247].
2022-10-19 11:36:11 -07:00
Evan Hunt 305a50dbe1 ensure RPZ lookups handle CD=1 correctly
RPZ rewrites called dns_db_findext() without passing through the
client database options; as as result, if the client set CD=1,
DNS_DBFIND_PENDINGOK was not used as it should have been, and
cache lookups failed, resulting in failure of the rewrite.
2022-10-19 11:36:11 -07:00
Ondřej Surý 0bcff38391 Merge branch '3270-serialize-statschannel-http-requests' into 'main'
Serialize the HTTP/1.1 statschannel requests

Closes #3270

See merge request isc-projects/bind9!6954
2022-10-19 12:47:06 +00:00
Ondřej Surý 13959781cb Serialize the HTTP/1.1 statschannel requests
The statschannel truncated test still terminates abruptly sometimes and
it doesn't return the answer for the first query.  This might happen
when the second process_request() discovers there's not enough space
before the sending is complete and the connection is terminated before
the client gets the data.

Change the isc_http, so it pauses the reading when it receives the data
and resumes it only after the sending has completed or there's
incomplete request waiting for more data.

This makes the request processing slightly less efficient, but also less
taxing for the server, because previously all requests that has been
received via single TCP read would be processed in the loop and the
sends would be queued after the read callback has processed a full
buffer.
2022-10-19 14:45:36 +02:00
Ondřej Surý edb0e756bc Merge branch '3612-fix-mem-functions-with-openssl-1.0.2' into 'main'
Fix the non-developer build with OpenSSL 1.0.2

Closes #3612

See merge request isc-projects/bind9!6952
2022-10-19 12:42:20 +00:00
Ondřej Surý dfaae53b9a Fix the non-developer build with OpenSSL 1.0.2
In non-developer build, a wrong condition prevented the
isc__tls_malloc_ex, isc__tls_realloc_ex and isc__tls_free_ex to be
defined.  This was causing FTBFS on platforms with OpenSSL 1.0.2.
2022-10-19 14:41:10 +02:00
Ondřej Surý a08a84695a Merge branch '3270-remove-time-requirement-for-statschannel-truncated-test' into 'main'
Remove the time requirement for the statschannel truncated test

Closes #3270

See merge request isc-projects/bind9!6951
2022-10-19 12:35:38 +00:00
Ondřej Surý 0f56a53d66 Remove the time requirement for the statschannel truncated test
The 5 seconds requirement to finish the 'pipelined with truncated
stream' was causing spurious failures in the CI because the job runners
might be very busy and sending 128k of data might simply take some time.

Remove the time requirement altogether, there's actually no reason why
the test SHOULD or even MUST finish under 5 seconds.
2022-10-19 14:08:24 +02:00
Tom Krizek a8c1ac7f92 Merge branch 'tkrizek/system-tests-fixes' into 'main'
Update various system tests and add them to default test suite

See merge request isc-projects/bind9!6942
2022-10-19 11:01:26 +00:00
Tom Krizek cbd0355328 Remove generated controls.conf file from system tests
The controls.conf file shouldn't be used directly without templating it
first. Remove this no longer used hard-coded file to avoid confusion.
2022-10-19 12:59:27 +02:00
Tom Krizek cb0a2ae1dd Revive dupsigs system test
Correctly source conf.sh in dupsigs test scripts (fix issue introduced
by 093af1c00a).

Update dupsigs test for dnssec-dnskey-kskonly default. Since v9.17.20,
the dnssec-dnskey-kskonly is set to yes. Update the test to not expect
the additional RRSIG with ZSK for DNSKEY.

Speed up the test from 20 minutes to 2.5 minutes and make it part of the
default test suite executed in CI.
- decrease number of records to sign from 2000 to 500
- decrease the signing interval by a factor of 6
- shorten the final part of the test after last signing (since nothing
  new happens there)

Finally, clarify misleading comments about (in)sufficient time for zone
re-signing. The time used in the test is in fact sufficient for the
re-signing to happen. If it wasn't, the previous ZSK would end up being
deleted while its signatures would still be present, which is a
situation where duplicate signatures can still happen.
2022-10-19 12:59:27 +02:00
Tom Krizek 7495deea3e Revive the stress system test
Ensure the port numbers are dynamically filled in with copy_setports.

Clarify test fail condition.

Make the stress test part of the default test suite since it doesn't
seem to run too long or interfere with other tests any more (the
original note claiming so is more than 20 years old).

Related !6883
2022-10-19 12:59:27 +02:00
Tom Krizek 235ae5f344 Revive dialup system test
Properly template the port number in config files with copy_setports.

The test takes two minutes on my machine which doesn't seem like a
proper justification to exclude it from the test suite, especially
considering we run these tests in parallel nowadays. The resource usage
doesn't seems significantly increased so it shouldn't interfere with
other system tests.

There also exists a precedent for longer running system tests that are
already part of the default system test suite (e.g. serve-stale takes
almost three minutes on the same machine).
2022-10-19 12:59:27 +02:00
Tom Krizek 1e7d832342 Make digdelv test work in different network envs
When a target server is unreachable, the varying network conditions may
cause different ICMP message (or no message). The host unreachable
message was discovered when attempting to run the test locally while
connected to a VPN network which handles all traffic.

Extend the dig output check with "host unreachable" message to avoid a
false negative test result in certain network environments.
2022-10-19 12:59:25 +02:00
Michal Nowak 3d968b4a4c Merge branch '3394-cve-2022-2795-test' into 'main'
Add tests for CVE-2022-2795

Closes #3394

See merge request isc-projects/bind9!6945
2022-10-19 10:31:56 +00:00
Michał KępieńandMichal Nowak 604d8f0b96 Add tests for CVE-2022-2795
Add a test ensuring that the amount of work fctx_getaddresses() performs
for any encountered delegation is limited: delegate example.net to a set
of 1,000 name servers in the redirect.com zone, the names of which all
resolve to IP addresses that nothing listens on, and query for a name in
the example.net domain, checking the number of times the findname()
function gets executed in the process; fail if that count is excessively
large.

Since the size of the referral response sent by ans3 is about 20 kB, it
cannot be sent back over UDP (EMSGSIZE) on some operating systems in
their default configuration (e.g. FreeBSD - see the
net.inet.udp.maxdgram sysctl).  To enable reliable reproduction of
CVE-2022-2795 (retry patterns vary across BIND 9 versions) and avoid
false positives at the same time (thread scheduling - and therefore the
number of fetch context restarts - vary across operating systems and
across test runs), extend bin/tests/system/resolver/ans3/ans.pl so that
it also listens on TCP and make "ns1" in the "resolver" system test
always use TCP when communicating with "ans3".

Also add a test (foo.bar.sub.tld1/TXT) that ensures the new limitations
imposed on the resolution process by the mitigation for CVE-2022-2795 do
not prevent valid, glueless delegation chains from working properly.
2022-10-19 11:53:08 +02:00
Artem Boldariev 64287e4889 Merge branch 'artem-tls-listener-shutdown-accept-crash-fix' into 'main'
[Backport] TLS Stream: handle successful TLS handshake after listener shutdown

See merge request isc-projects/bind9!6938
2022-10-18 15:58:14 +00:00
Artem Boldariev 09dcc914b4 TLS Stream: handle successful TLS handshake after listener shutdown
It was possible that accept callback can be called after listener
shutdown. In such a case the callback pointer equals NULL, leading to
segmentation fault. This commit fixes that.
2022-10-18 18:30:24 +03:00
Michal Nowak 9b8a72735b Merge branch '3493-compression-buffer-reuse-test' into 'main'
[CVE-2022-2881] test for growth of compressed pipelined responses

See merge request isc-projects/bind9!6933
2022-10-18 15:18:54 +00:00
Evan HuntandMichal Nowak 3c11fafadf test for growth of compressed pipelined responses
add a test to compare the Content-Length of successive compressed
messages on a single HTTP connection that should contain the same
data; fail if the size grows by more than 100 bytes from one query
to the next.
2022-10-18 17:16:00 +02:00
Matthijs Mekking c05034b906 Merge branch 'matthijs-fix-dnssec-signing-log-lovel' into 'main'
Change log level when doing rekey

See merge request isc-projects/bind9!6913
2022-10-18 14:25:19 +00:00
Matthijs Mekking a1d57fc8cb Change log level when doing rekey
This log happens when BIND checks the parental-agents if the DS has
been published. But if you don't have parental-agents set up, the list
of keys to check will be empty and the result will be ISC_R_NOTFOUND.
This is not an error, so change the log level to debug in this case.
2022-10-18 16:23:35 +02:00
Petr Špaček b43f0e0674 Merge branch 'pspacek/cookie-test-no-developer-fixup' into 'main'
Fix cookie system test for builds without --enable-developer

See merge request isc-projects/bind9!6904
2022-10-18 12:22:34 +00:00
Petr Špaček c3e7bed1ab Fix cookie system test for builds without --enable-developer
The "connecting via TCP" message comes from FCTXTRACE which is not
available on some builds.
2022-10-18 13:54:45 +02:00
Petr Špaček f2ed208db9 Merge branch 'pspacek/ci-no-developer-mode' into 'main'
Add CI job with --disable-developer

See merge request isc-projects/bind9!6930
2022-10-18 11:51:23 +00:00
Petr Špaček ddf46056ca Allow system tests to run under root user when inside CI
https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
says variable CI_SERVER="yes" is available in all versions of Gitlab.
2022-10-18 13:30:16 +02:00
Petr Špaček d6db5c5335 Build gcc:oraclelinux9:amd64 CI jobs with --disable-developer
Purpose of this is to guard against tests which rely on querytrace or
other optional features enabled by --enable-developer switch.
2022-10-18 13:30:15 +02:00
Ondřej Surý 5e3e76eda9 Merge branch 'ondrej-add-ISC_LIST,LINK_INITIALIZER' into 'main'
Add ISC_{LIST,LINK}_INITIALIZER for designated initializers

See merge request isc-projects/bind9!6928
2022-10-18 11:18:04 +00:00
Ondřej Surý 5e20c2ccfb Replace (void *)-1 with ISC_LINK_TOMBSTONE
Instead of having "arbitrary" (void *)-1 to define non-linked, add a
ISC_LINK_TOMBSTONE(type) macro that replaces the "magic" value with a
define.
2022-10-18 11:36:15 +02:00
Ondřej Surý cb3c36b8bf Add ISC_{LIST,LINK}_INITIALIZER for designated initializers
Since we are using designated initializers, we were missing initializers
for ISC_LIST and ISC_LINK, add them, so you can do

    *foo = (foo_t){ .list = ISC_LIST_INITIALIZER };

Instead of:

    *foo = (foo_t){ 0 };
    ISC_LIST_INIT(foo->list);
2022-10-18 11:36:15 +02:00
Artem Boldariev aaa50c5101 Merge branch 'artem-sync-multilayer-stoplistening' into 'main'
Synchronise stop listening operation for multi-layer transports

Closes #3606

See merge request isc-projects/bind9!6917
2022-10-18 09:32:25 +00:00
Artem Boldariev 5ab2c0ebb3 Synchronise stop listening operation for multi-layer transports
This commit introduces a primitive isc__nmsocket_stop() which performs
shutting down on a multilayered socket ensuring the proper order of
the operations.

The shared data within the socket object can be destroyed after the
call completed, as it is guaranteed to not be used from within the
context of other worker threads.
2022-10-18 12:06:00 +03:00
Arаm Sаrgsyаn 55a184c13f Merge branch '3584-placeholder' into 'main'
Add a CHANGES placeholder for [GL #3584]

See merge request isc-projects/bind9!6927
2022-10-18 08:51:46 +00:00
Aram Sargsyan 5d5b3f9d27 Add a CHANGES placeholder for [GL #3584] 2022-10-18 08:28:53 +00:00
Petr Špaček ad3270b1ee Merge branch 'pspacek/doc-nsupdate-server-gsstsig' into 'main'
Document that nsupdate ignores server command in GSS-TSIG mode

See merge request isc-projects/bind9!6878
2022-10-18 08:12:47 +00:00
Petr Špaček c8a38d70f0 Document that nsupdate ignores server command in GSS-TSIG mode
This behavior is present since introduction of GSS-TSIG support,
commit 289ae548d5.
2022-10-18 10:12:02 +02:00
Tony Finch 3b285ee9ad Merge branch 'fanf-deduplicate-file-line' into 'main'
De-duplicate __FILE__, __LINE__ plus some error reporting cleanup

See merge request isc-projects/bind9!6914
2022-10-17 13:17:57 +00:00
Tony Finch 2ffb582d2c CHANGES for [GL !6914]
[cleanup]	Less ceremonial UNEXPECTED_ERROR() and FATAL_ERROR()
		reporting macros. [GL !6914]
2022-10-17 13:43:59 +01:00
Tony Finch 26ed03a61e Include the function name when reporting unexpected errors
I.e. print the name of the function in BIND that called the system
function that returned an error. Since it was useful for pthreads
code, it seems worthwhile doing so everywhere.
2022-10-17 13:43:59 +01:00
Tony Finch a34a2784b1 De-duplicate some calls to strerror_r()
Specifically, when reporting an unexpected or fatal error.
2022-10-17 11:58:26 +01:00
Tony Finch ec50c58f52 De-duplicate __FILE__, __LINE__
Mostly generated automatically with the following semantic patch,
except where coccinelle was confused by #ifdef in lib/isc/net.c

@@ expression list args; @@
- UNEXPECTED_ERROR(__FILE__, __LINE__, args)
+ UNEXPECTED_ERROR(args)
@@ expression list args; @@
- FATAL_ERROR(__FILE__, __LINE__, args)
+ FATAL_ERROR(args)
2022-10-17 11:58:26 +01:00
Arаm Sаrgsyаn cf230dea7a Merge branch 'aram/cfg_print_duration-uninitialized-length' into 'main'
Fix a logical bug in cfg_print_duration()

See merge request isc-projects/bind9!6880
2022-10-17 09:15:13 +00:00
Aram Sargsyan fddaebb285 Handle large numbers when parsing/printing a duration
The isccfg_duration_fromtext() function is truncating large numbers
to 32 bits instead of capping or rejecting them, i.e. 64424509445,
which is 0xf00000005, gets parsed as 32-bit value 5 (0x00000005).

Fail parsing a duration if any of its components is bigger than
32 bits. Using those kind of big numbers has no practical use case
for a duration.

The isccfg_duration_toseconds() function can overflow the 32 bit
seconds variable when calculating the duration from its component
parts.

To avoid that, use 64-bit calculation and return UINT32_MAX if the
calculated value is bigger than UINT32_MAX. Again, a number this big
has no practical use case anyway.

The buffer for the generated duration string is limited to 64 bytes,
which, in theory, is smaller than the longest possible generated
duration string.

Use 80 bytes instead, calculated by the '7 x (10 + 1) + 3' formula,
where '7' is the count of the duration's parts (year, month, etc.), '10'
is their maximum length when printed as a decimal number, '1' is their
indicator character (Y, M, etc.), and 3 is two more indicators (P and T)
and the terminating NUL character.
2022-10-17 08:45:45 +00:00
Aram Sargsyan 190aab84d7 Add a CHANGES note for [GL !6880] 2022-10-17 08:45:34 +00:00
Aram Sargsyan dc55f1ebb9 Fix an off-by-one error in cfg_print_duration()
The cfg_print_duration() checks added previously in the 'duration_test'
unit test uncovered a bug in cfg_print_duration().

When calculating the current 'str' pointer of the generated text in the
buffer 'buf', it erroneously adds 1 byte to compensate for that part's
indicator character. For example, to add 12 minutes, it needs to add
2 + 1 = 3 characters, where 2 is the length of "12", and 1 is the length
of "M" (for minute). The mistake was that the length of the indicator
is already included in 'durationlen[i]', so there is no need to
calculate it again.

In the result of this mistake the current pointer can advance further
than needed and end up after the zero-byte instead of right on it, which
essentially cuts off any further generated text. For example, for a
5 minutes and 30 seconds duration, instead of having this:

    'P', 'T', '5', 'M', '3', '0', 'S', '\0'

The function generates this:

    'P', 'T', '5', 'M', '\0', '3', '0', 'S', '\0'

Fix the bug by adding to 'str' just 'durationlen[i]' instead of
'durationlen[i] + 1'.
2022-10-17 08:45:26 +00:00
Aram Sargsyan 39290bb7cd Test cfg_print_duration() in duration_test.c
Currently the 'duration_test' unit test checks only the
cfg_obj_asduration() function.

Extend the test so it checks also the reverse operation using the
cfg_print_duration() function, which is used in named-checkconf.
2022-10-17 08:45:18 +00:00
Aram Sargsyan 9440910187 Fix a logical bug in cfg_print_duration()
The cfg_print_duration() function prints a ISO 8601 duration value
converted from an array of integers, where the parts of the date and
time are stored.

durationlen[6], which holds the "seconds" part of the duration, has
a special case in cfg_print_duration() to ensure that when there are
no values in the duration, the result still can be printed as "PT0S",
instead of just "P", so it can be a valid ISO 8601 duration value.

There is a logical error in one of the two special case code paths,
when it checks that no value from the "date" part is defined, and no
"hour" or "minute" from the "time" part are defined.

Because of the error, durationlen[6] can be used uninitialized, in
which case the second parameter passed to snprintf() (which is the
maximum allowed length) can contain a garbage value.

This can not be exploited because the buffer is still big enough to
hold the maximum possible amount of characters generated by the "%u%c"
format string.

Fix the logical bug, and initialize the 'durationlen' array to zeros
to be a little safer from other similar errors.
2022-10-17 08:45:09 +00:00
Ondřej Surý a9e4e6658f Merge branch 'mnowak/fix-grep-3.8-warnings' into 'main'
Fix GNU Grep 3.8 warnings

See merge request isc-projects/bind9!6786
2022-10-17 07:09:16 +00:00
Michal NowakandOndřej Surý 759e8a6671 Add CI check for Grep warnings 2022-10-17 09:08:15 +02:00
Michal NowakandOndřej Surý 212c4de043 Replace fgrep and egrep with grep -F/-E
GNU Grep 3.8 reports the following warnings:

    egrep: warning: egrep is obsolescent; using grep -E
    fgrep: warning: fgrep is obsolescent; using grep -F
2022-10-17 09:08:15 +02:00
Michal NowakandOndřej Surý 65e91ef5e6 Remove stray backslashes
GNU Grep 3.8 reports several instances of stray backslashes in matching
patterns:

    grep: warning: stray \ before /
    grep: warning: stray \ before :
2022-10-17 09:08:15 +02:00
Ondřej Surý d04f053b49 Merge branch 'fanf-compress-smaller' into 'main'
Simplify and speed up DNS name compression

See merge request isc-projects/bind9!6517
2022-10-17 07:00:39 +00:00
Tony FinchandOndřej Surý 738c3f791c CHANGES note for [GL !6517]
[performance]	A new algorithm for DNS name compression based on a
		hash set of message offsets. Name compression is now
		more complete as well as being generally faster, and
		the implementation is less complicated and requires
		much less memory.
2022-10-17 08:45:44 +02:00
Tony FinchandOndřej Surý 7ab81eab1c A couple of compression microbenchmarks
The `render` benchmark loads some binary DNS message dumps and
repeatedly passes them to `dns_message_render`.

The `compress` benchmark loads a list of domain names and packs them
into 4KiB chunks using `dns_name_towire`.
2022-10-17 08:45:44 +02:00
Tony FinchandOndřej Surý 18a51c89f0 Test compression context hash set collisions
Check that names are correctly added and deleted in the compression
context. Use many names with differing numerical prefixes to make it
relatively easy to identify and debug problems.
2022-10-17 08:45:44 +02:00
Tony FinchandOndřej Surý 45b2d8938b Simplify and speed up DNS name compression
All we need for compression is a very small hash set of compression
offsets, because most of the information we need (the previously added
names) can be found in the message using the compression offsets.

This change combines dns_compress_find() and dns_compress_add() into
one function dns_compress_name() that both finds any existing suffix,
and adds any new prefix to the table. The old split led to performance
problems caused by duplicate names in the compression context.

Compression contexts are now either small or large, which the caller
chooses depending on the expected size of the message. There is no
dynamic resizing.

There is a behaviour change: compression now acts on all the labels in
each name, instead of just the last few.

A small benchmark suggests this is about 2x faster.
2022-10-17 08:45:44 +02:00
Artem Boldariev a00333d0d8 Merge branch 'artem-isc_nmsocket_set_tlsctx-loopmgr-fix' into 'main'
Fix isc_nmsocket_set_tlsctx() broken during loopmgr refactroing

See merge request isc-projects/bind9!6915
2022-10-16 21:50:51 +00:00
Artem Boldariev d62eb206f7 Fix isc_nmsocket_set_tlsctx()
During loop manager refactoring isc_nmsocket_set_tlsctx() was not
properly adapted. The function is expected to broadcast the new TLS
context for every worker, but this behaviour was accidentally broken.
2022-10-14 23:06:31 +03:00
Ondřej Surý 778cf872eb Merge branch 'ondrej-pthread_once-runtime-check' into 'main'
Improve reporting for pthread_once errors

See merge request isc-projects/bind9!6910
2022-10-14 14:40:31 +00:00
Ondřej Surý cedfc97974 Improve reporting for pthread_once errors
Replace all uses of RUNTIME_CHECK() in lib/isc/include/isc/once.h with
PTHEADS_RUNTIME_CHECK(), in order to improve error reporting for any
once-related run-time failures (by augmenting error messages with
file/line/caller information and the error string corresponding to
errno).
2022-10-14 16:39:21 +02:00
Tom Krizek 2ac48846f4 Merge branch 'tkrizek/remove-system-test-delzone' into 'main'
Remove system test delzone

See merge request isc-projects/bind9!6882
2022-10-14 14:37:39 +00:00
Tom Krizek 05180154d9 Remove system test delzone
There are multiple reasons to remove this test as obsolete:

- The test may not possibly work for over 2.5 years, since
  98b3b93791 removed the rndc.py python
  tool on which this test relies.
- It isn't part of the test suite either in CI or locally unless it is
  explicitly enabled. As a result, there are many issues which prevent
  the test from being executed caused by various refactoring efforts
  accumulated over time.
- Even if the test could be executed, it has no clear failure condition.
  If the python script(s) fail, the test still passes.
2022-10-14 16:35:20 +02:00
Ondřej Surý 2b8231dd3c Merge branch 'ondrej-refactor-isc_httpd' into 'main'
Rewrite isc_httpd using picohttpparser and isc_url_parse

See merge request isc-projects/bind9!6879
2022-10-14 10:23:21 +00:00
Ondřej Surý e13749f138 Add CHANGES note for [GL !6879] 2022-10-14 11:26:54 +02:00
Ondřej Surý cad2706cce Replace the statschannel truncated tests with two new tests
Now that the artificial limit on the recv buffer has been removed, the
current system test always fails because it tests if the truncation has
happened.

Add test that sending more than 10 headers makes the connection to
closed; and add test that sending huge HTTP request makes the connection
to be closed.
2022-10-14 11:26:54 +02:00
Ondřej Surý beecde7120 Rewrite isc_httpd using picohttpparser and isc_url_parse
Rewrite the isc_httpd to be more robust.

1. Replace the hand-crafted HTTP request parser with picohttpparser for
   parsing the whole HTTP/1.0 and HTTP/1.1 requests.  Limit the number
   of allowed headers to 10 (arbitrary number).

2. Replace the hand-crafted URL parser with isc_url_parse for parsing
   the URL from the HTTP request.

3. Increase the receive buffer to match the isc_netmgr buffers, so we
   can at least receive two full isc_nm_read()s.  This makes the
   truncation processing much simpler.

4. Process the received buffer from single isc_nm_read() in a single
   loop and schedule the sends to be independent of each other.

The first two changes makes the code simpler and rely on already
existing libraries that we already had (isc_url based on nodejs) or are
used elsewhere (picohttpparser).

The second two changes remove the artificial "truncation" limit on
parsing multiple request.  Now only a request that has too many
headers (currently 10) or is too big (so, the receive buffer fills up
without reaching end of the request) will end the connection.

We can be benevolent here with the limites, because the statschannel
channel is by definition private and access must be allowed only to
administrators of the server.  There are no timers, no rate-limiting, no
upper limit on the number of requests that can be served, etc.
2022-10-14 11:26:54 +02:00
Ondřej Surý 3a8884f024 Add picohttpparser.{c.h} from https://github.com/h2o/picohttpparser
PicoHTTPParser is a tiny, primitive, fast HTTP request/response parser.

Unlike most parsers, it is stateless and does not allocate memory by
itself. All it does is accept pointer to buffer and the output
structure, and setups the pointers in the latter to point at the
necessary portions of the buffer.
2022-10-14 11:26:54 +02:00
Petr Špaček a2318a85a4 Merge branch 'pspacek/git-blame-ignore-revs' into 'main'
Add list of meaningless commits to .git-blame-ignore-revs

See merge request isc-projects/bind9!6903
2022-10-13 16:02:33 +00:00
Petr Špaček 6af82aa83e Add list of meaningless commits to .git-blame-ignore-revs
Works nicely together with:
    git config --add blame.ignoreRevsFile .git-blame-ignore-revs

The list was generated by hand-picking from git log --oneline augmented
with:
    --author=tbox
    --grep=clang-format
    --grep=copyright
    --grep=reformat
    --grep=whitespace
plus
    git log --format='commit %H %s' --stat | grep -E 'commit|changed' | grep -B1 '[0-9][0-9][0-9] files changed'
plus some sanity checking.

Comments were added with:
    for COMMIT in $(cat .git-blame-ignore-revs)
        do git log -1 --format="# %s" "$COMMIT"
        echo $COMMIT
    done
2022-10-13 18:02:08 +02:00
Petr Špaček 4fc04b6011 Merge branch 'pspacek/dns-name-attributes-struct' into 'main'
Replace #define DNS_NAMEATTR_* with struct of booleans

See merge request isc-projects/bind9!6902
2022-10-13 15:22:57 +00:00
Petr Špaček 53b3ceacd4 Replace #define DNS_NAMEATTR_ with struct of bools
sizeof(dns_name_t) did not change but the boolean attributes are now
separated as one-bit structure members. This allows debuggers to
pretty-print dns_name_t attributes without any special hacks, plus we
got rid of manual bit manipulation code.
2022-10-13 17:04:02 +02:00
Petr ŠpačekandTony Finch 8a3aa8bda4 Fix latent bug in RBT node attributes handling
Originally RBT node stored three lowest bits from dns_name_t attributes.
This had a curious side-effect noticed by Tony Finch:

If you create an rbt node from a DYNAMIC name then the flag will be
propagated through dns_rbt_namefromnode() ... if you subsequently call
dns_name_free() it will try to isc_mem_put() a piece of an rbt node ...
but dns_name_free() REQUIRE()s that the name is dynamic so in the usual
case where rbt nodes are created from non-dynamic names, this kind of
code will fail an assertion.

This is a bug it dates back to june 1999 when NAMEATTR_DYNAMIC was
invented.

Apparently it does not happen often :-)
I'm planning to get rid of DNS_NAMEATTR_ definitions and bit operations,
so removal of this "three-bit-subset" assignment is a first step.

We can keep only the ABSOLUTE flag in RBT node and nothing else because
names attached to rbt nodes are always readonly: The internal node_name()
function always sets the NAMEATTR_READONLY when making a dns_name that
refers to the node's name, so the READONLY flag will be set in the name
returned by dns_rbt_namefromnode().

Co-authored-by: Tony Finch <fanf@isc.org>
2022-10-13 13:08:28 +02:00
Ondřej Surý dbc1166704 Merge branch 'artem-doth-reduce-listener-sockets-number' into 'main'
doth system test fixes - decrese the size of HTTP listener quota, increase transfer-in/out limits

Closes #3596

See merge request isc-projects/bind9!6898
2022-10-13 05:37:48 +00:00
Artem Boldariev 95a551de7b doth system test: increase transfers-in/out limits
Sometimes doth test could intermittently fail shortly after start due
to inability to complete a zone transfer in time. As it turned out, it
could happen due to transfers-in/out limits. Initially the defaults
were fine, but over time, especially when adding Strict/Mutual TLS, we
added more than 10 zones so it became possible to hit the limits.

This commit takes care of that by bumping the limits.
2022-10-12 21:52:52 +03:00
Artem Boldariev 354494cd10 doth system test - decrease HTTP listener quota size
This commit reduces the size of HTTP listener quota from 300 (default)
to 100 so that it would make hitting any global limits in case of
running multiple tests in parallel in multiple containers unlikely.

This way the need in opening many file descriptors of different
kinds (e.g. client side connections and pipes) gets significantly
reduced while the required code paths are still verified.
2022-10-12 21:46:39 +03:00
Ondřej Surý 2de8a8e8c7 Merge branch 'ondrej-restore-connrefused-for-udp_test' into 'main'
Restore ignoring ISC_R_CONNREFUSED in connect_read_cb

See merge request isc-projects/bind9!6899
2022-10-12 17:24:24 +00:00
Ondřej Surý ed37949d5f Restore ignoring ISC_R_CONNREFUSED in connect_read_cb
In ac4cc8443d, the ISC_R_CONNREFUSED was
removed in connect_read_cb, but it can actually happen in the udp_test:

    [ RUN      ] udp_recv_send
    connect_read_cb(0x7f2c2801a270, connection refused, (nil))
2022-10-12 19:21:42 +02:00
Ondřej Surý 07a9bf4a88 Merge branch '3595-dont-set-so_reuseport-on-outgoing-udp-sockets' into 'main'
The UDP connect socket should not set REUSEPORT_LB

See merge request isc-projects/bind9!6888
2022-10-12 13:38:41 +00:00
Ondřej Surý 8bddd8d357 Merge branch '3595-retry-on-timeout-in-udp_recv_one-and_udp_recv_two-unit-test' into 'main'
Retry on timeout in the UDP recv_one, udp_recv_two and double_read tests

See merge request isc-projects/bind9!6894
2022-10-12 13:36:31 +00:00
Ondřej Surý 076cdf7444 Gracefully handle ISC_R_SHUTTINGDOWN in udp__send_cb
The ISC_R_SHUTTINGDOWN should be handled the same as ISC_R_CANCELED in
the udp__send_cb(), as we might be sending the data while the
loopmgr/netmgr shutdown has been initiated.
2022-10-12 15:36:25 +02:00
Ondřej Surý af257140e6 Make sure the unit test listening and connecting ports are different
In rare circumstances, the UDP port for the listening socket and the UDP
port for the connecting socket might be the same.  Because we use the
"reuse" port socket option, this isn't caught when binding the socket,
and thus the connected client socket could send a datagram to itself,
completely bypassing the server.  This doesn't happen under normal
operation mode because `named` is listening on a privileged port (53),
and even if not, it doesn't usually talk to itself as the tests do.

Pick an arbitrary port for listening (9153-9156) that is outside the
ephemeral port range for the network manager related unit tests (except
the `doh_test).
2022-10-12 15:36:25 +02:00
Ondřej Surý b6b7a6886a Don't set load-balancing socket option on the UDP connect sockets
The isc_nm_udpconnect() erroneously set the reuse port with
load-balancing on the outgoing connected UDP sockets.  This socket
option makes only sense for the listening sockets.  Don't set the
load-balancing reuse port option on the outgoing UDP sockets.
2022-10-12 15:36:25 +02:00
Ondřej Surý d7cfb7c792 Retry on timeout in the UDP recv_one, recv_two and double_read tests
Since we are testing UDP on the localhost and the same interface, the
UDP datagrams can't get lost.  Change the connect read callback, so it
starts reading again on the timeout instead of just getting stuck, and
fail when any other result codes than ISC_R_SUCCESS and ISC_R_TIMEDOUT
are received because we don't expect them to happen in these simple
tests.
2022-10-12 15:33:58 +02:00
Ondřej Surý 946cf3396f Merge branch 'artem-clear-ssl-error-queue-for-dns-transports' into 'main'
TLS: clear error queue before doing I/O or calling SSL_get_error()

See merge request isc-projects/bind9!6892
2022-10-12 13:33:38 +00:00
Artem Boldariev 070d373c56 DoH unit test: remove broken remnants of slowdown logic
This commit removes broken remnants of unit test slowdown logic, which
caused unit test hangs on platforms susceptible to "too many open
files" error, notably OpenBSD.
2022-10-12 16:24:04 +03:00
Artem Boldariev eaebb92f3e TLS DNS: fix certificate verification error message reporting
This commit fixes TLS DNS verification error message reporting which
we probably broke during one of the recent networking code
refactorings.

This prevent e.g. dig from producing useful error messages related to
TLS certificates verification.
2022-10-12 16:24:04 +03:00
Artem Boldariev 6789b88d25 TLS: clear error queue before doing IO or calling SSL_get_error()
Ensure that TLS error is empty before calling SSL_get_error() or doing
SSL I/O so that the result will not get affected by prior error
statuses.

In particular, the improper error handling led to intermittent unit
test failure and, thus, could be responsible for some of the system
test failures and other intermittent TLS-related issues.

See here for more details:

https://www.openssl.org/docs/man3.0/man3/SSL_get_error.html

In particular, it mentions the following:

> The current thread's error queue must be empty before the TLS/SSL
> I/O operation is attempted, or SSL_get_error() will not work
> reliably.

As we use the result of SSL_get_error() to decide on I/O operations,
we need to ensure that it works reliably by cleaning the error queue.

TLS DNS: empty error queue before attempting I/O
2022-10-12 16:24:04 +03:00
Ondřej Surý 1c026f3286 Merge branch '3601-ignore-connection_reset-in-listen_send_cb' into 'main'
Ignore additional return codes in the netmgr unit tests

Closes #3601

See merge request isc-projects/bind9!6895
2022-10-12 13:19:03 +00:00
Ondřej Surý ac4cc8443d Ignore additional return codes in the netmgr unit tests
There was inconsistency in which error codes would get accepted and
ignored in the network manager unit test callbacks.  Add following
results, so we just detach the handle instead of causing assertion
failure:

* ISC_R_SHUTTINGDOWN - when the network manager is shutting down
* ISC_R_CANCELED - the socket has been shut down
* ISC_R_EOF - the (TCP) communication has ended on the other side
* ISC_R_CONNECTIONRESET - the TCP connection was reset

This should fix some of the spurious unit test failures.
2022-10-12 15:07:53 +02:00
Arаm Sаrgsyаn 981d6ef1c0 Merge branch '3574-cid-357292-improper-use-of-negative-value-in-tcp.c' into 'main'
Resolve "CID 357292: Improper use of negative value in lib/isc/netmgr/tcp.c"

Closes #3574

See merge request isc-projects/bind9!6851
2022-10-12 09:00:21 +00:00
Aram Sargsyan be95ba0119 Remove a superfluous check of sock->fd against -1
The check is left from when tcp_connect_direct() called isc__nm_socket()
and it was uncertain whether it had succeeded, but now isc__nm_socket()
is called before tcp_connect_direct(), so sock->fd cannot be -1.

    *** CID 357292:    (REVERSE_NEGATIVE)
    /lib/isc/netmgr/tcp.c: 309 in isc_nm_tcpconnect()
    303
    304     	atomic_store(&sock->active, true);
    305
    306     	result = tcp_connect_direct(sock, req);
    307     	if (result != ISC_R_SUCCESS) {
    308     		atomic_store(&sock->active, false);
    >>>     CID 357292:    (REVERSE_NEGATIVE)
    >>>     You might be using variable "sock->fd" before verifying that it is >= 0.
    309     		if (sock->fd != (uv_os_sock_t)(-1)) {
    310     			isc__nm_tcp_close(sock);
    311     		}
    312     		isc__nm_connectcb(sock, req, result, true);
    313     	}
    314
2022-10-12 08:21:35 +00:00
Ondřej Surý 5dbbc29632 Merge branch '3595-fix-the-intermittent-udp_test-failures' into 'main'
Handle double timeout in udp_cancel_read test

See merge request isc-projects/bind9!6889
2022-10-11 13:02:14 +00:00
Ondřej Surý 02c42a20b7 Handle double timeout in udp_cancel_read test
If sending took too long the isc_nm_read() could timeout twice, leading
to extra 'cread' counter in the udp_cancel_read test.  Increase the
cread counter only on ISC_R_EOF (canceled read) and deal with the
multiple ISC_R_TIMEOUTS gracefully.
2022-10-11 15:01:35 +02:00
Michał Kępień c61818f3cb Merge branch '3592-fix-startup-detection-after-restart-in-start.pl' into 'main'
Fix startup detection after restart in start.pl

Closes #3592

See merge request isc-projects/bind9!6881
2022-10-11 09:55:51 +00:00
Michał Kępień 18e20f95f6 Fix startup detection after restart in start.pl
The bin/tests/system/start.pl script waits until a "running" message is
logged by a given name server instance before attempting to send a
version.bind/CH/TXT query to it.  The idea behind this was to make the
script wait until named loads all the zones it is configured to serve
before telling the system test framework that a given server is ready to
use; this prevents the need to add boilerplate code that waits for a
specific zone to be loaded to each test expecting that.

The problem is that when it looks for "running" messages, the
bin/tests/system/start.pl script assumes that the existence of any such
message in the named.run file indicates that a given named instance has
already finished loading all zones.  Meanwhile, some system tests
restart all the named instances they use throughout their lifetime (some
even do that a few times), for example to run Python-based tests.  The
bin/tests/system/start.pl script handles such a scenario incorrectly: as
soon as it finds any "running" message in the named.run file it inspects
and it gets a response to a version.bind/CH/TXT query, it tells the
system test framework that a given server is ready to use, which might
not be true - it is possible that only the "version.bind" zone is loaded
at that point and the "running" message found was logged by a
previously-shutdown named instance. This triggers intermittent failures
for Python-based tests.

Fix by improving the logic that the bin/tests/system/start.pl script
uses to detect server startup: check how many "running" lines are
present in a given named.run file before attempting to start a named
instance and only proceed with version.bind/CH/TXT queries when the
number of "running" lines found in that named.run file increases after
the server is started.
2022-10-11 11:54:57 +02:00
Michał Kępień 9146b956ae Do not truncate ns2 logs in the "rrsetorder" test
In the "rrsetorder" system test, the ns2 named instance is restarted
without passing the --restart option to bin/tests/system/start.pl.  This
causes the log file for that named instance to be needlessly truncated.
Prevent this from happening by restarting the affected named instance
in the same way as all the other named instances used in system tests.
2022-10-11 11:54:57 +02:00
Michał Kępień d5fa1cb9dc Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.7' into 'main'
Set up version and release notes for BIND 9.19.7

See merge request isc-projects/bind9!6884
2022-10-10 21:36:36 +00:00
Michał Kępień 87bf9b342b Set up release notes for BIND 9.19.7 2022-10-10 23:17:49 +02:00
Michał Kępień 0a758ebc95 Update BIND version to 9.19.7-dev 2022-10-10 23:17:49 +02:00
Michał Kępień cb867d2ef0 Update BIND version for release 2022-10-10 09:00:58 +02:00
Michał Kępień 40432eae00 Add a CHANGES marker 2022-10-10 09:00:58 +02:00
Michał Kępień c5ac304ee7 Merge branch 'michal/prepare-documentation-for-bind-9.19.6' into 'v9_19_6-release'
Prepare documentation for BIND 9.19.6

See merge request isc-private/bind9!463
2022-10-07 11:04:14 +00:00
Michał Kępień f26a08b7f7 Add release note for GL #3587 2022-10-07 12:55:17 +02:00
Michał Kępień 26a8e9093d Reorder release notes 2022-10-07 12:55:17 +02:00
Michał Kępień dfc19673c9 Tweak and reword release notes 2022-10-07 12:55:17 +02:00
Michał Kępień 73686d18bf Prepare release notes for BIND 9.19.6 2022-10-07 12:55:17 +02:00
Petr Špaček d16e0c058b Merge branch '3554-improve-dnssec-policy-inline-signing-err-msg' into 'main'
Clarify new configuration incompabitility: dnssec-policy vs. inline-signing

See merge request isc-projects/bind9!6865
2022-10-06 08:27:08 +00:00
Petr Špaček 5589d0a49c Add Known Issue about config incompatibility 2022-10-06 10:26:33 +02:00
Petr Špaček 058c1744ba Clarify error message about missing inline-signing & dnssec-policy 2022-10-06 10:26:30 +02:00
Mark Andrews 00f4268804 Merge branch '3577-reloads-in-ixfr-system-test-happen-too-fast' into 'main'
Resolve "reloads in ixfr system test happen too fast"

Closes #3577

See merge request isc-projects/bind9!6855
2022-10-05 21:33:04 +00:00
Mark Andrews 491a8cfe96 Add sleeps to ixfr system test
ensure that at least a second has passed since a zone was last loaded
to prevent it accidentally being skipped as up to date.
2022-10-06 08:18:03 +11:00
Evan Hunt f2fa141668 Merge branch '3560-fix-view-resolver-layer-weak-references-violation' into 'main'
Resolve violation of weak referencing dns_view

Closes #3560

See merge request isc-projects/bind9!6848
2022-10-05 19:33:57 +00:00
Ondřej SurýandEvan Hunt 0dcbc6274b Record the 'edns-udp-size' in the view, not in the resolver
Getting the recorded value of 'edns-udp-size' from the resolver requires
strong attach to the dns_view because we are accessing `view->resolver`.
This is not the case in places (f.e. dns_zone unit) where `.udpsize` is
accessed.  By moving the .udpsize field from `struct dns_resolver` to
`struct dns_view`, we can access the value directly even with weakly
attached dns_view without the need to lock the view because `.udpsize`
can be accessed after the dns_view object has been shut down.
2022-10-05 11:59:36 -07:00
Ondřej SurýandEvan Hunt bff3025396 Resolve violation of weak referencing dns_view
The dns_view implements weak and strong reference counting.  When strong
reference counting reaches zero, the adb, ntatable and resolver objects
are shut down and detached.

In dns_zone and dns_nta the dns_view was weakly attached, but the
view->resolver reference was accessed directly leading to dereferencing
the NULL pointer.

Add dns_view_getresolver() method which attaches to view->resolver
object under the lock (if it still exists) ensuring the dns_resolver
will be kept referenced until not needed.
2022-10-05 11:59:36 -07:00
Michal Nowak 934a6a8b8f Merge branch 'mnowak/drop-flake8-ignore-lists' into 'main'
Drop flake8 ignore lists

See merge request isc-projects/bind9!6778
2022-10-05 16:05:41 +00:00
Michal Nowak f5d9fa6ea4 Drop flake8 ignore lists
flake8 is not used in BIND 9 CI and inline ignore lists are not needed
anymore.
2022-10-05 17:56:24 +02:00
Tony Finch eb5da6bbdb Merge branch '3580-coverity-constant-boolean-dead-code' into 'main'
Avoid dead code warning when using a constant boolean

Closes #3580

See merge request isc-projects/bind9!6862
2022-10-05 15:51:20 +00:00
Tony FinchandTony Finch 138908b211 Avoid dead code warning when using a constant boolean
The value of `sign_bit` is platform-dependent but constant at compile
time. Use a cast to convert the boolean `sign_bit` to 0 or 1 instead of
ternary `?:` because one branch of the conditional is dead code. (We
could leave out the cast to `size_t` but our style prefers to handle
booleans more explicitly, hence the `?:` that caused the issue.)

    *** CID 358310:  Possible Control flow issues  (DEADCODE)
    /lib/isc/resource.c: 118 in isc_resource_setlimit()
    112     		 * rlim_t, and whether rlim_t has a sign bit.
    113     		 */
    114     		isc_resourcevalue_t rlim_max = UINT64_MAX;
    115     		size_t wider = sizeof(rlim_max) - sizeof(rlim_t);
    116     		bool sign_bit = (double)(rlim_t)-1 < 0;
    117
    >>>     CID 358310:  Possible Control flow issues  (DEADCODE)
    >>>     Execution cannot reach the expression "1" inside this statement: "rlim_max >>= 8UL * wider + ...".
    118     		rlim_max >>= CHAR_BIT * wider + (sign_bit ? 1 : 0);
    119     		rlim_value = ISC_MIN(value, rlim_max);
    120     	}
    121
    122     	rl.rlim_cur = rl.rlim_max = rlim_value;
    123     	unixresult = setrlimit(unixresource, &rl);
2022-10-05 15:51:05 +00:00
Ondřej Surý 0e92878211 Merge branch 'ondrej/add-isc_mem_zero' into 'main'
Replace isc_mem_*_aligned(..., alignment) with isc_mem_*x(..., flags)

See merge request isc-projects/bind9!6398
2022-10-05 14:44:36 +00:00
Ondřej Surý 5878ff65ee Add CHANGES note for [GL !6398] 2022-10-05 16:44:05 +02:00
Ondřej Surý e18b6fb6a6 Use isc_mem_regetx() when appropriate
While refactoring the isc_mem_getx(...) usage, couple places were
identified where the memory was resized manually.  Use the
isc_mem_reget(...) that was introduced in [GL !5440] to resize the
arrays via function rather than a custom code.
2022-10-05 16:44:05 +02:00
Ondřej Surý c0598d404c Use designated initializers instead of memset()/MEM_ZERO for structs
In several places, the structures were cleaned with memset(...)) and
thus the semantic patch converted the isc_mem_get(...) to
isc_mem_getx(..., ISC_MEM_ZERO).  Use the designated initializer to
initialized the structures instead of zeroing the memory with
ISC_MEM_ZERO flag as this better matches the intended purpose.
2022-10-05 16:44:05 +02:00
Ondřej Surý c1d26b53eb Add and use semantic patch to replace isc_mem_get/allocate+memset
Add new semantic patch to replace the straightfoward uses of:

  ptr = isc_mem_{get,allocate}(..., size);
  memset(ptr, 0, size);

with the new API call:

  ptr = isc_mem_{get,allocate}x(..., size, ISC_MEM_ZERO);
2022-10-05 16:44:05 +02:00
Ondřej Surý dbf5672f32 Replace isc_mem_*_aligned(..., alignment) with isc_mem_*x(..., flags)
Previously, the isc_mem_get_aligned() and friends took alignment size as
one of the arguments.  Replace the specific function with more generic
extended variant that now accepts ISC_MEM_ALIGN(alignment) for aligned
allocations and ISC_MEM_ZERO for allocations that zeroes
the (re-)allocated memory before returning the pointer to the caller.
2022-10-05 16:44:05 +02:00
Tony Finch 4d5fd50f9a Merge branch '3582-coverity-bench-siphash' into 'main'
Suppress division by zero warning

Closes #3582

See merge request isc-projects/bind9!6863
2022-10-05 12:10:18 +00:00
Tony Finch cf715d488b Suppress division by zero warning
Coverity is optimistic that we might do thousands of hashes in less
than a microsecond.

    /tests/bench/siphash.c: 54 in main()
    48     			count++;
    49     		}
    50
    51     		isc_time_now_hires(&finish);
    52
    53     		us = isc_time_microdiff(&finish, &start);
    >>>     CID 358309:  Integer handling issues  (DIVIDE_BY_ZERO)
    >>>     In expression "count * 1000UL / us", division by expression "us" which may be zero has undefined behavior.
    54     		printf("%f us wide-lower len %3zu, %7llu kh/s (%llx)\n",
    55     		       (double)us / 1000000.0, len,
    56     		       (unsigned long long)(count * 1000 / us),
    57     		       (unsigned long long)sum);
    58     	}
    59
2022-10-05 12:31:42 +01:00
Petr Špaček 61b3dcc086 Merge branch '3572-fix-duplicate-link-anchor' into 'main'
Deduplicate link anchors in the ARM

See merge request isc-projects/bind9!6846
2022-10-05 09:44:15 +00:00
Petr Špaček 137e0f4e0e Remove manually defined anchors pointing to statement definitions
This is hopefully end of duplication. This batch did not cause clashes
in Sphinx but it was pointless nonetheless as we have auto-generated
anchors for all statements.
2022-10-05 11:36:22 +02:00
Tom KrizekandPetr Špaček ea2d213f34 Remove trailing whitespaces 2022-10-05 11:36:22 +02:00
Petr Špaček 9a7c2b370e Deduplicate link anchors in the ARM
Some statement names like "allow-query" had manually defined link anchor
_allow-query and also implicit anchor created by
.. namedconf:statement:: syntax. This causes warnings if a ambiguous
reference is made using :any:`allow-query` syntax.

Remove (hopefully all) manually defined anchors which pointed to
identical place as the implicit anchor. This allows :any: to work.

In rare cases where manual anchor points to descriptive text separated
from statement definition the reference was disamguated by replacing
:any:`notify` with :ref:`notify` (for manual anchor)
vs. :namedconf:ref:`notify` (for statement definition).

Please note that `options` statement is a trap: It is ambiguous even
without manual anchor because rndc.conf has its own `options`. Use
:namedconf:ref:`options` vs. :rndcconf:ref:`options` to select
appropriate target.
2022-10-05 11:36:19 +02:00
Mark Andrews 952e1cb454 Merge branch '3338-zero-system-test-add-forensics' into 'main'
Add additional forensics to zero system test

See merge request isc-projects/bind9!6295
2022-10-05 08:26:00 +00:00
Mark Andrews 285351d4b2 Add additional forensics to zero system test 2022-10-05 07:46:01 +00:00
Petr Špaček 6f6f925b9f Merge branch 'pspacek/tsan-ci-artifacts-fix' into 'main'
Fix TSAN artifact gathering in CI

See merge request isc-projects/bind9!6853
2022-10-05 07:43:56 +00:00
Petr Špaček 9559eb3b21 Fix TSAN artifact gathering in CI
Fixup for 2c3b2dabe9.

We forgot to update TSAN paths when moving all the unit tests to
/tests/.  Let's remove paths from find to make it less dependent on
exact location, and store all untracked files as we do in the normal
unit test template.

Related: !6243
2022-10-05 09:43:07 +02:00
Matthijs Mekking faba965871 Merge branch 'matthijs-refactor-serve-stale' into 'main'
Refactor serve-stale stale-answer-client-timeout 0

See merge request isc-projects/bind9!6845
2022-10-05 07:15:27 +00:00
Matthijs Mekking 0681b15225 If refresh stale RRset times out, start stale-refresh-time
The previous commit failed some tests because we expect that if a
fetch fails and we have stale candidates in cache, the
stale-refresh-time window is started. This means that if we hit a stale
entry in cache and answering stale data is allowed, we don't bother
resolving it again for as long we are within the stale-refresh-time
window.

This is useful for two reasons:
- If we failed to fetch the RRset that we are looking for, we are not
  hammering the authoritative servers.

- Successor clients don't need to wait for stale-answer-client-timeout
  to get their DNS response, only the first one to query will take
  the latency penalty.

The latter is not useful when stale-answer-client-timeout is 0 though.

So this exception code only to make sure we don't try to refresh the
RRset again if it failed to do so recently.
2022-10-05 08:20:48 +02:00
Matthijs Mekking 64d51285d5 Reuse recursion type code for refresh stale RRset
Refreshing a stale RRset is similar to prefetching an RRset, so
reuse the existing code. When refreshing an RRset we need to clear
all db options related to serve-stale so that stale RRsets in cache
are ignored during the refresh.

We no longer need to set the "nodetach" flag, because the refresh
fetch is now a "fetch and forget". So we can detach from the client
in the query_send().

This code will break some serve-stale test cases, this will be fixed
in the successor commit.

TODO: add explanation why the serve-stale test cases fail.
2022-10-05 08:20:48 +02:00
Matthijs Mekking 5fb8e555bc Add new recursion type for refreshing stale RRset
Refreshing a stale RRset is similar to a prefetch query, so we can
refactor this code to use the new recursion types introduced in !5883.
2022-10-05 08:20:48 +02:00
Ondřej Surý d4df60179a Merge branch 'ondrej-implement-case-insensitive-siphash-2-4' into 'main'
Add a case-insensitive option directly to siphash 2-4 implementation

See merge request isc-projects/bind9!6789
2022-10-04 09:03:00 +00:00
Ondřej Surý c14a4ac763 Add a case-insensitive option directly to siphash 2-4 implementation
Formerly, the isc_hash32() would have to change the key in a local copy
to make it case insensitive.  Change the isc_siphash24() and
isc_halfsiphash24() functions to lowercase the input directly when
reading it from the memory and converting the uint8_t * array to
64-bit (respectively 32-bit numbers).
2022-10-04 10:32:40 +02:00
Tony FinchandOndřej Surý de10d697ab A simple siphash benchmark
To see the effect of adding a case-insentitive option.
2022-10-04 10:32:40 +02:00
Mark Andrews 0f78fbc461 Merge branch '3544-add-dohpath-parsing-to-svbc' into 'main'
Resolve "Add dohpath parsing to SVCB"

Closes #3544

See merge request isc-projects/bind9!6774
2022-10-04 04:30:04 +00:00
Mark Andrews 5f07fe8cbb Use strnstr implementation from FreeBSD if not provided by OS 2022-10-04 14:21:41 +11:00
Mark Andrews 2f3441b40a Add release note for [GL #3544] 2022-10-04 14:21:41 +11:00
Mark Andrews 335b397e15 Add CHANGES note for [GL #3544] 2022-10-04 14:21:41 +11:00
Mark Andrews 6d561d3886 Add support for 'dohpath' to SVCB (and HTTPS)
dohpath is specfied in draft-ietf-add-svcb-dns and has a value
of 7.  It must be a relative path (start with a /), be encoded
as UTF8 and contain the variable dns ({?dns}).
2022-10-04 14:21:41 +11:00
Tony Finch 34605e9772 Merge branch '3549-isc-resource-ub' into 'main'
Avoid signed integer overflow in isc_resource_setlimit()

Closes #3549

See merge request isc-projects/bind9!6788
2022-10-03 11:38:20 +00:00
Tony Finch 4e37a6f77a Avoid signed integer overflow in isc_resource_setlimit()
On systems with signed rlim_t the old code calculated its maximum
value by shifting 1 into the sign bit, which is undefined behaviour.
Avoid the bug by using an unsigned shift.
2022-10-03 11:37:17 +00:00
Ondřej Surý 1279d2dee9 Merge branch 'ondrej-increase-the-time-to-wait-for-servers-to-gracefully-shutdown' into 'main'
Be more patient when stopping servers in the system tests

See merge request isc-projects/bind9!6847
2022-09-30 15:38:47 +00:00
Ondřej Surý d971472321 Be more patient when stopping servers in the system tests
When the TCP test is run on the busy server, the server might take a
while to wind the server down because it might still be processing all
that 300k invalid XFR requests.

Increate the rncd wait time to 120 seconds, the SIGTERM time to 300
seconds, and reduce the time to wait for ans servers from 1200 second
to just 120 seconds.
2022-09-30 17:12:44 +02:00
Ondřej Surý 3b01b436a2 Merge branch '3571-fix-data-race-in-dns_nta' into 'main'
Don't stop timer from dns__nta_shutdown()

Closes #3571

See merge request isc-projects/bind9!6844
2022-09-30 14:18:29 +00:00
Ondřej Surý 01f0f9dcdc Don't stop timer from dns__nta_shutdown()
The dns__nta_shutdown() could be run from different threads and it was
accessing nta->timer unlocked.  Don't check and stop the timer from
dns__nta_shutdown() directly, but leave it for the async callback.
2022-09-30 15:24:20 +02:00
Ondřej Surý 9beb68513b Merge branch '3555-refactor-isc_ratelimiter-API' into 'main'
Refactor isc_ratelimiter API

Closes #3555

See merge request isc-projects/bind9!6842
2022-09-30 13:23:31 +00:00
Ondřej Surý 477eb22c12 Refactor isc_ratelimiter API
Because the dns_zonemgr_create() was run before the loopmgr was started,
the isc_ratelimiter API was more complicated that it had to be.  Move
the dns_zonemgr_create() to run_server() task which is run on the main
loop, and simplify the isc_ratelimiter API implementation.

The isc_timer is now created in the isc_ratelimiter_create() and
starting the timer is now separate async task as is destroying the timer
in case it's not launched from the loop it was created on.  The
ratelimiter tick now doesn't have to create and destroy timer logic and
just stops the timer when there's no more work to do.

This should also solve all the races that were causing the
isc_ratelimiter to be left dangling because the timer was stopped before
the last reference would be detached.
2022-09-30 10:36:30 +02:00
Ondřej Surý f7fc48a2ba Add isc_ratelimiter API unit tests
The isc_ratelimiter API was missing unit tests.

Add a new set of unit tests for the isc_ratelimiter API.
2022-09-30 10:36:30 +02:00
Ondřej Surý 09b50d2237 Fix small problems in the isc_ratelimiter 2022-09-30 09:50:17 +02:00
Ondřej Surý 1e2ededb07 Add missing DbC check for name##_detach in ISC_REFCOUNT_IMPL macro
The detach function in the ISC_REFCOUNT_IMPL macro was missing DbC
checks, add them.
2022-09-30 09:50:17 +02:00
Mark Andrews b242790e1d Merge branch '3569-dns-message-checksig-create-test-key-directory' into 'main'
Resolve "dns_message_checksig under oss_fuzz is not seeing the data files"

Closes #3569

See merge request isc-projects/bind9!6840
2022-09-30 02:42:18 +00:00
Mark Andrews 1849a8a526 Add CHANGES note for [GL #3569] 2022-09-30 02:19:52 +00:00
Mark Andrews 033057ba9d Create a key directory in /tmp
Access to the source tree is not available with oss_fuzz.  Have
fuzz/dns_message_checksig build and populate a key directory for
the fuzzer to use.  This contains a key pair and a zone file which
has the public key from the key pair.  Clean it up on shutdown.
2022-09-30 02:19:52 +00:00
Ondřej Surý 39ae4a145b Merge branch 'ondrej-remove-debug-print-from-run_server' into 'main'
Remove debugging fprintf from run_server()

See merge request isc-projects/bind9!6843
2022-09-29 12:23:11 +00:00
Ondřej Surý 36cdeb7656 Remove debugging fprintf from run_server()
In the loopmgr branch, we forgot the scissors^Hdebugging output in the
patient^Hnamed, remove it.
2022-09-29 14:22:58 +02:00
Tony Finch 2ffeb0248b Merge branch 'fanf-free-non-null' into 'main'
Improve DBC in isc_mem_free

See merge request isc-projects/bind9!6839
2022-09-29 10:07:46 +00:00
Tony Finch a4930e1969 Improve DBC in isc_mem_free
Unlike standard free(), isc_mem_free() is not a no-op when passed a
NULL pointer. For size accounting purposes it calls sallocx(), which
crashes when passed a NULL pointer. To get more helpful diagnostics,
REQUIRE() that the pointer is not NULL so that when the programmer
makes a mistake they get a backtrace that shows what went wrong.
2022-09-29 10:07:34 +00:00
Ondřej Surý 05d60071a7 Merge branch '3534-make-the-isc_nm_udp_send-on-shutdown-callback-asynchronous' into 'main'
Call the isc__nm_udp_send() callbacks asynchronously on shutdown

Closes #3534

See merge request isc-projects/bind9!6828
2022-09-29 10:04:40 +00:00
Ondřej Surý b4a43bf2f2 Add developer documentation on the netmgr callbacks
Extra care must be taken when executing the callbacks to prevent the
deadlocks on the caller's side.  Add a paragraph that addresses when we
can and when we cannot call the callbacks directly.
2022-09-29 11:12:15 +02:00
Ondřej Surý 173c352452 Call the isc__nm_udp_send() callbacks asynchronously on shutdown
The isc__nm_udp_send() callback would be called synchronously when
shutting down or when the socket has been closed.  This could lead to
double locking in the calling code and thus those callbacks needs to be
called asynchronously.
2022-09-29 11:06:58 +02:00
Arаm Sаrgsyаn cd32969138 Merge branch '3512-xot-breaks-ddns-update-forwarding' into 'main'
Resolve "XoT breaks DDNS update forwarding"

Closes #3512

See merge request isc-projects/bind9!6710
2022-09-28 10:28:05 +00:00
Aram Sargsyan 504529dfa9 Add a release note for [GL #3512] 2022-09-28 09:36:24 +00:00
Aram Sargsyan aa4319f263 Add a CHANGES note for [GL #3512] 2022-09-28 09:36:24 +00:00
Aram Sargsyan ae4296729c Test dynamic update forwarding when using a TLS-enabled primary
Add several test cases in the 'upforwd' system test to make sure
that different scenarios of Dynamic DNS update forwarding are
tested, in particular when both the original and forwarded requests
are over Do53, or DoT, or they use different transports.
2022-09-28 09:36:24 +00:00
Aram Sargsyan 3d7103bd21 Fix dynamic update forwarding when using a TLS-enabled primary
Now that the 'dns_request' supports using TLS transport, implement
dynamic update forwarding using DoT when the primary server is
configured to use a TLS transport.

Previously, when using such configuration, the dynamic update forwarding
feature was broken.
2022-09-28 09:01:05 +00:00
Mark Andrews 445aeee58d Merge branch '3562-assign-default-value-to-suffix' into 'main'
Resolve "suffix may be used before being assigned in qmin/ans3/ans.py"

Closes #3562

See merge request isc-projects/bind9!6811
2022-09-28 00:09:28 +00:00
Mark Andrews 432064f63c Suffix may be used before it is assigned a value
CID 350722 (#5 of 7): Bad use of null-like value (FORWARD_NULL)
        12. invalid_operation: Invalid operation on null-like value suffix.
    145        r.authority.append(
    146            dns.rrset.from_text(
    147                "icky.ptang.zoop.boing." + suffix,
    148                1,
    149                IN,
    150                NS,
    151                "a.bit.longer.ns.name." + suffix,
    152            )
    153        )
2022-09-27 23:47:12 +00:00
Mark Andrews edc804b9b8 Merge branch '3551-missing-rsa_free-call-in-opensslrsa_verify2' into 'main'
Resolve "Missing RSA_free call in opensslrsa_verify2"

Closes #3551

See merge request isc-projects/bind9!6810
2022-09-27 23:46:26 +00:00
Mark Andrews 1e3680193a Add CHANGES note for [GL #3551] 2022-09-28 09:25:13 +10:00
Mark Andrews a47235f4f5 Check BN_dup results in rsa_check 2022-09-28 09:24:34 +10:00
Mark Andrews 483c5a1978 Free 'n' on error path in rsa_check 2022-09-28 09:24:34 +10:00
Mark Andrews db70c30213 Check that 'e' and 'n' are allocated in opensslrsa_fromdns 2022-09-28 09:24:34 +10:00
Mark Andrews 5603cd69d1 Check that 'e' and 'n' are non-NULL in opensslrsa_todns 2022-09-28 09:24:34 +10:00
Mark Andrews a2b51ca6ac Free 'rsa' if 'e' is NULL in opensslrsa_verify2 2022-09-28 09:24:34 +10:00
Ondřej Surý 1f670f4b69 Merge branch '3559-provide-custom-isc_mem-based-allocators-for-external-libraries' into 'main'
Use custom isc_mem based allocator for libuv, OpenSSL, and libxml2

Closes #3559

See merge request isc-projects/bind9!6807
2022-09-27 15:55:09 +00:00
Ondřej Surý be3a159b54 Add CHANGES note for [GL #3559] 2022-09-27 17:53:04 +02:00
Ondřej Surý 3b31f7f563 Add autoconf option to enable memory leak detection in libraries
There's a known memory leak in the engine_pkcs11 at the time of writing
this and it interferes with the named ability to check for memory leaks
in the OpenSSL memory context by default.

Add an autoconf option to explicitly enable the memory leak detection,
and use it in the CI except for pkcs11 enabled builds.  When this gets
fixed in the engine_pkc11, the option can be enabled by default.
2022-09-27 17:53:04 +02:00
Ondřej Surý d1cc847ab0 Check the libuv, OpenSSL and libxml2 memory context on exit
As we can't check the deallocations done in the library memory contexts
by default because it would always fail on non-clean exit (that happens
on error or by calling exit() early), we just want to enable the checks
to be done on normal exit.
2022-09-27 17:10:42 +02:00
Ondřej Surý e537fea861 Use custom isc_mem based allocator for libxml2
The libxml2 library provides a way to replace the default allocator with
user supplied allocator (malloc, realloc, strdup and free).

Create a memory context specifically for libxml2 to allow tracking the
memory usage that has originated from within libxml2.  This will provide
a separate memory context for libxml2 to track the allocations and when
shutting down the application it will check that all libxml2 allocations
were returned to the allocator.

Additionally, move the xmlInitParser() and xmlCleanupParser() calls from
bin/named/main.c to library constructor/destructor in libisc library.
2022-09-27 17:10:42 +02:00
Ondřej Surý 236d4b7739 Use custom isc_mem based allocator for OpenSSL
The OpenSSL library provides a way to replace the default allocator with
user supplied allocator (malloc, realloc, and free).

Create a memory context specifically for OpenSSL to allow tracking the
memory usage that has originated from within OpenSSL.  This will provide
a separate memory context for OpenSSL to track the allocations and when
shutting down the application it will check that all OpenSSL allocations
were returned to the allocator.
2022-09-27 17:10:42 +02:00
Ondřej Surý a32d06dd42 Use custom isc_mem based allocator for libuv
The libuv library provides a way to replace the default allocator with
user supplied allocator (malloc, realloc, calloc and free).

Create a memory context specifically for libuv to allow tracking the
memory usage that has originated from within libuv.  This requires
libuv >= 1.38.0 which provides uv_library_shutdown() function that
assures no more allocations will be made.
2022-09-27 17:10:42 +02:00
Ondřej Surý a30e75db86 Check for working __builtin_mul_overflow() implementation
Instead of using generic HAVE_BUILTIN_OVERFLOW, we need to check whether
the overflow functions actually work as there was a bug in GCC that it
would not detect mul overflow when compiled with `-m32` option without
optimizations and the bug was fixed only for GCC 6.5+ and 7.3+/8+.

For further details see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82274
2022-09-27 17:10:42 +02:00
Ondřej Surý 2d2022a509 Make the debugging flags local to the memory context
Previously, the isc_mem_debugging would be single global variable that
would affect the behavior of the memory context whenever it would be
changed which could be after some allocation were already done.

Change the memory debugging options to be local to the memory context
and immutable, so all allocations within the same memory context are
treated the same.
2022-09-27 17:10:41 +02:00
Ondřej Surý 56f9c886aa Merge branch '3567-bump-the-minimal-libuv-version-to-1.34.0' into 'main'
Bump the libuv requirement to libuv >= 1.34.0

Closes #3567

See merge request isc-projects/bind9!6826
2022-09-27 15:09:53 +00:00
Ondřej Surý 178e0317a6 Add CHANGES and release note for [GL #3567] 2022-09-27 17:09:11 +02:00
Ondřej Surý 0086ebf3fc Bump the libuv requirement to libuv >= 1.34.0
By bumping the minimum libuv version to 1.34.0, it allows us to remove
all libuv shims we ever had and makes the code much cleaner.  The
up-to-date libuv is available in all distributions supported by BIND
9.19+ either natively or as a backport.
2022-09-27 17:09:10 +02:00
Ondřej Surý d5bead54c0 Drop Ubuntu 18.04 bionic from the CI
The Ubuntu 18.04 bionic will go EOL in April 2023 before the next stable
BIND 9 release, so we can drop this for the next stable BIND 9 release.
2022-09-27 17:09:10 +02:00
Ondřej Surý 7238c85c88 Drop Debian buster from the CI
The Debian buster is official EOL and in the LTS mode, so we can drop
this for the next stable BIND 9 release.
2022-09-27 17:09:10 +02:00
Matthijs Mekking 444461e9b1 Merge branch 'matthijs-dnssec-guide-dnssec-policy-requires-inline-signing' into 'main'
Add dnssec-policy inline-signing requirement to documentation

See merge request isc-projects/bind9!6823
2022-09-27 15:08:03 +00:00
Matthijs Mekking 18d230a584 Add inline-signing to config examples
Add 'inline-signing yes;' to configuration examples to have working
copy paste configurations.
2022-09-27 17:06:30 +02:00
Matthijs Mekking 5d454a7158 Update inline-signing requirement to ARM
This change was made in !6403, but the appropriate documentation
changes were not applied to the ARM.
2022-09-27 17:06:30 +02:00
Matthijs Mekking 09522c8d73 Add inline-signing requirement to DNSSEC Guide
This change was made in !6403, but the appropriate documentation
changes were not applied to the DNSSEC Guide.
2022-09-27 17:06:30 +02:00
Petr Špaček 489320e961 Merge branch '3541-have-named-v-report-supported-algorithms' into 'main'
Report supported crypto algorithms

Closes #3541

See merge request isc-projects/bind9!6771
2022-09-27 14:55:11 +00:00
Petr Špaček c138a8aa59 Add release note for new crypto algorithm logging 2022-09-27 16:54:39 +02:00
Petr Špaček c648e280e4 Document list of crypto algorithms in named -V output 2022-09-27 16:54:39 +02:00
Mark AndrewsandPetr Špaček d34ecdb366 Deduplicate string formating 2022-09-27 16:54:39 +02:00
Mark AndrewsandPetr Špaček e876de442e Add CHANGES entry for [GL #3541] 2022-09-27 16:54:39 +02:00
Mark AndrewsandPetr Špaček 3156d36495 silence scan-build false positive 2022-09-27 16:54:39 +02:00
Mark AndrewsandPetr Špaček cb1515e71f Report algorithms supported by named at startup 2022-09-27 16:54:39 +02:00
Mark AndrewsandPetr Špaček b308f866c0 Have 'named -V' report supported algorithms
These cover DNSSEC, DS, HMAC and TKEY algorithms.
2022-09-27 16:54:39 +02:00
Mark AndrewsandPetr Špaček 151cc2fff9 Replace alg_totext with dst_hmac_algorithm_totext
The new library function will be reused by subsequent commits.
2022-09-27 16:54:39 +02:00
Mark AndrewsandPetr Špaček 09f7e0607a Convert DST_ALG defines to enum and group HMAC algorithms
The HMACs and GSSAPI are just using unallocated values.
Moving them around shouldn't cause issues.
Only the dnssec system test knew the internal number in use for hmacmd5.
2022-09-27 16:54:36 +02:00
Arаm Sаrgsyаn a84c422fc8 Merge branch '3513-cid-356329-error-handling-in-dnssec-signzone.c' into 'main'
Resolve "CID 356329: Error handling issues in bin/dnssec/dnssec-signzone.c"

Closes #3513

See merge request isc-projects/bind9!6714
2022-09-27 14:34:23 +00:00
Aram Sargsyan 4509c4f1bd Use the return value of isc_task_create()
Improve the error handling by checking the isc_task_create()
function's return value.

CID 356329:

    /bin/dnssec/dnssec-signzone.c: 3732 in main()
    3726     	if (directory == NULL) {
    3727     		directory = ".";
    3728     	}
    3729
    3730     	isc_managers_create(&mctx, ntasks, &loopmgr, &netmgr, &taskmgr);
    3731
    >>>     CID 356329:  Error handling issues  (CHECKED_RETURN)
    >>>     Calling "isc__task_create" without checking return value (as is done elsewhere 16 out of 18 times).
    3732     	isc_task_create(taskmgr, &write_task, 0);
    3733
    3734     	result = dst_lib_init(mctx, engine);
    3735     	if (result != ISC_R_SUCCESS) {
    3736     		fatal("could not initialize dst: %s",
    3737
2022-09-27 12:22:34 +00:00
Mark Andrews eb7b068bf8 Merge branch '3557-catalog-zone-check-key-names' into 'main'
Resolve "Catalog zone processing failed to detect TSIG key changes for primaries"

Closes #3557

See merge request isc-projects/bind9!6806
2022-09-27 12:17:08 +00:00
Mark Andrews eacf41a20a Add release note for [GL #3557] 2022-09-27 21:54:02 +10:00
Mark Andrews 0774dacf2d Add CHANGES note for [GL #3557] 2022-09-27 21:54:02 +10:00
Mark Andrews 176e172210 Check that changing the TSIG key is successful
Switch the primary to require 'next_key' for zone transfers then
update the catalog zone to say to use 'next_key'.  Next update the
zones contents then check that those changes are seen on the
secondary.
2022-09-27 21:54:02 +10:00
Mark Andrews 9172bd9b5a Check that primary key names have not changed
When looking for changes in a catalog zone member zone we need to
also check if the TSIG key name associated with a primary server
has be added, removed or changed.
2022-09-27 21:54:02 +10:00
Petr Špaček 75424ec23a Merge branch 'pspacek/fix-dns_message_checksig-out-of-tree' into 'main'
Fix dns_message_checksig fuzzer

Closes #3565

See merge request isc-projects/bind9!6822
2022-09-27 11:22:56 +00:00
Ondřej SurýandPetr Špaček 16377100ae Fix stack-use-after-scope in dns_message_checksig test
Previously stack with buffer for test dns message went out of scope
before the message was processed. For fuzz testing its better to avoid
allocation, so let's avoid allocations completely and use simplest
possible static buffer.

Fixes: #3565
2022-09-27 13:06:01 +02:00
Petr Špaček 4108d79c9a Fix dns_message_checksig in out-of-tree setup
Hardcoded path was missing FUZZDIR prefix.

Related: !5923
2022-09-27 11:21:42 +02:00
Petr Špaček d102c59b96 Detect errors in fuzzer initialization
Incomplete initialization typically causes mysterious failures later on,
so let's err out early.
2022-09-27 11:21:38 +02:00
Michał Kępień 547f15ff11 Merge branch 'mnowak/add-fedora-36' into 'main'
Add Fedora 36

See merge request isc-projects/bind9!6297
2022-09-27 07:39:31 +00:00
Michal NowakandMichał Kępień a313c49a3b Add Fedora 36 2022-09-27 09:37:09 +02:00
Evan Hunt df51d22726 Merge branch '3553-static-buffer-functions' into 'main'
change ISC__BUFFER macros to inline functions

See merge request isc-projects/bind9!6801
2022-09-27 07:23:06 +00:00
Evan Hunt 1926ddc987 change ISC__BUFFER macros to inline functions
previously, when ISC_BUFFER_USEINLINE was defined, macros were
used to implement isc_buffer primitives (isc_buffer_init(),
isc_buffer_region(), etc). these macros were missing the DbC
assertions for those primitives, which made it possible for
coding errors to go undetected.

adding the assertions to the macros caused compiler warnings on
some platforms. therefore, this commit converts the ISC__BUFFER
macros to static inline functions instead, with assertions included,
and eliminates the non-inline implementation from buffer.c.

the --enable-buffer-useinline configure option has been removed.
2022-09-26 23:49:27 -07:00
Petr Špaček c42d980d4a Merge branch 'bug/main/doc-arm-rhel9' into 'main'
Compatibility for building ARM on older sphinx

See merge request isc-projects/bind9!6815
2022-09-26 15:15:27 +00:00
Petr MenšíkandPetr Špaček 3db7e241d2 Simplify allowing warnings during ARM build
RHEL8 Sphinx does not support all features used in ARM building. But
with few emitted warnings it can build the documentation fine. Simplify
warnings acceptance by allowing make doc SPHINX_W=''.
2022-09-26 17:09:56 +02:00
Petr MenšíkandPetr Špaček bc6c6b1184 Compatibility for building ARM on older sphinx
Make documentation building successful even on RHEL9 sphinx 3.4.3. It
does not like case-insensitive matching of terms, so provide lowercase
text description with Uppercase word reference.
2022-09-26 17:09:51 +02:00
Petr Špaček 12bce9e69b Merge branch 'ondrej-add-dns_message_checktsig-fuzzer' into 'main'
Add dns_message_checksig() fuzzer

See merge request isc-projects/bind9!5923
2022-09-26 14:30:16 +00:00
Petr Špaček 983822abcf Add seed to reproduce issue memory leak in dns_message_checktsig
Related: #3547
2022-09-26 16:29:36 +02:00
Mark AndrewsandPetr Špaček 6237273205 Add CHANGES notes for [GL !5923] 2022-09-26 16:29:35 +02:00
Mark AndrewsandPetr Špaček 805e2ba31d Add the ability to dig to specify the signing time 2022-09-26 16:28:23 +02:00
Mark AndrewsandPetr Špaček 4d248ee78e Allow dig to SIG(0) sign a message 2022-09-26 16:28:23 +02:00
Mark AndrewsandPetr Špaček c127a2aefc Add a SIG(0) request seed 2022-09-26 16:28:23 +02:00
Mark AndrewsandPetr Špaček 3c28608c9f Add TSIG reply seed 2022-09-26 16:28:23 +02:00
Mark AndrewsandPetr Špaček f3d47bc8e0 Add TSIG request seed 2022-09-26 16:28:23 +02:00
Ondřej SurýandPetr Špaček 4da0180ba2 Add dns_message_checksig() fuzzer
dns_message_checksig is called in a number of scenarios

	* on requests and responses
	* on multiple opcodes
	* with and without signatures
	* with TSIG signatures
	* with SIG(0) signatures
	* with and without configured TSIG keys
	* with and without KEY records being present
	* signing performed now, in the future and in the past

we use the first two octets of the seed to configure the calling
environment with the remainder of the seed being the rdata of the
TSIG/SIG(0) record.
2022-09-26 16:28:23 +02:00
Ondřej SurýandPetr Špaček 3e85d8c3d6 Add the ability specify the signing / verification time
When fuzzing it is useful for all signing operations to happen
at a specific time for reproducability.  Add two variables to
the message structure (fuzzing and fuzztime) to specify if a
fixed time should be used and the value of that time.
2022-09-26 16:28:12 +02:00
Ondřej Surý 7ea6796a3e Merge branch 'ondrej-use-uv_random' into 'main'
Switch the CSPRNG function from RAND_bytes() to uv_random()

See merge request isc-projects/bind9!6803
2022-09-26 13:32:41 +00:00
Ondřej Surý b4e131ac77 Add CHANGES note for [GL !6803] 2022-09-26 15:13:11 +02:00
Ondřej Surý 1baed21688 Switch the CSPRNG function from RAND_bytes() to uv_random()
The RAND_bytes() implementation differs between the OpenSSL versions and
uses the system entropy only for seeding its internal CSPRNG.  The
uv_random() on the other hand uses the system provided CSPRNG.

Switch from RAND_bytes() to uv_random() to use system provided CSPRNG.
2022-09-26 15:13:11 +02:00
Petr Špaček 126c9c7419 Merge branch '3547-dns_message_checksig-leak-fix' into 'main'
Fix memory leak in dns_message_checksig() - SIG(0) sigs

Closes #3547

See merge request isc-projects/bind9!6787
2022-09-26 09:55:40 +00:00
Mark AndrewsandPetr Špaček d6ad56bd9e Stop passing mctx to dns_rdata_tostruct as it is unnecessary for SIG
dns_rdata_tostruct doesn't need a mctx passed to it for SIG (the signer
is already expanded at this point). About the only time when mctx is
needed is when the structure is to be used after the rdata has been
destroyed.
2022-09-26 10:30:57 +02:00
Petr Špaček 69256b3553 Fix memory leak in dns_message_checksig() - SIG(0) sigs
Impact should be visible only in tests or tools because named never
uses view == NULL, which is a necessary condition to trigger this leak.
2022-09-26 10:30:51 +02:00
Arаm Sаrgsyаn d1508a13cb Merge branch '1781-nsupdate-dot' into 'main'
Implement DoT support for nsupdate

Closes #1781

See merge request isc-projects/bind9!6752
2022-09-23 16:10:05 +00:00
Aram Sargsyan 34f06fd2b5 Add a release note for [GL #1781] 2022-09-23 13:27:44 +00:00
Aram Sargsyan 7ea4e4a1ce Add a CHANGES note for [GL #1781] 2022-09-23 13:27:44 +00:00
Aram Sargsyan bd8299d7b5 Document nsupdate options related to DoT
Add documentation for the newly implemented DoT feature of the
nsupdate program.
2022-09-23 13:27:44 +00:00
Aram Sargsyan f2bb80d6ae Extend the nsupdate system test with DoT-related checks
Add a simple test PKI based on the existing one in the doth test.

Check ephemeral, forward-secrecy, and forward-secrecy-mutual-tls
TLS configurations with different scenarios.
2022-09-23 13:23:49 +00:00
Aram Sargsyan 60f1a73754 Fix a typo in doth system test's CA.cfg
The comments in CA.cfg file serve as a good tutorial for setting up
a simple PKI for a system test. There is a typo in one of the presented
commands, which results in openssl not exiting with an error message
instead of generating a certificate.

Fix the typo.
2022-09-23 13:23:49 +00:00
Aram Sargsyan 13000c28c2 Implement DoT support for nsupdate
Implement DNS-over-TLS support for nsupdate. Use DiG's DoT
implementation as a model for the newly added features.
2022-09-23 13:23:49 +00:00
Mark Andrews 73cc9a3232 Merge branch 'bug/main/sha1-disabled-fedora-rhbz2122841' into 'main'
Engine pkcs11 cannot work with OSSL_PARAM on OpenSSL 3.0

See merge request isc-projects/bind9!6711
2022-09-23 03:50:50 +00:00
Mark Andrews e27b063f67 Add release note for [GL !6711] 2022-09-23 13:18:29 +10:00
Mark Andrews 54916b4e45 Add a CHANGES note for [GL !6711] 2022-09-23 13:18:28 +10:00
Mark Andrews 979062ee5d Report how named was built 2022-09-23 13:17:55 +10:00
Mark Andrews 9b13dd7b4d Build against OpenSSL 3.0 in OpenSSL 1.1.0 compatibility mode 2022-09-23 13:17:55 +10:00
Michal NowakandMark Andrews 3dec2deebc Let Debian sid image leverage PKCS#11 with OpenSSL 3 2022-09-23 13:17:55 +10:00
Mark Andrews 6d668b8c34 Update reference to point to doc/arm/build.inc.rst 2022-09-23 13:17:55 +10:00
Mark Andrews f32c52c5ca Document -DOPENSSL_API_COMPAT=10100 in OPTIONS.md 2022-09-23 13:17:55 +10:00
Petr MenšíkandMark Andrews 6c55ea17c6 Remove engine related parts for OpenSSL 3.0
OpenSSL just cannot work with mixing ENGINE_* api mixed with OSSL_PARAM
builders. But it can be built in legacy mode, where deprecated but still
working API would be used.

It can work under OpenSSL 3.0, but only if using legacy code paths
matching OpenSSL 1.1 calls and functions.

Remove fromlabel processing by OpenSSL 3.0 only functions. They can
return later with a proper provider support for pkcs11.
2022-09-23 13:17:55 +10:00
Petr MenšíkandMark Andrews f92950bb64 Do not use OSSL_PARAM when engine API is compiled
OpenSSL has deprecated many things in version 3.0. If pkcs11 engine
should work then no builder from OpenSSL 3.0 API can be used.

Allow switching to OpenSSL 1.1 like calls even on OpenSSL 3.0 when
OPENSSL_API_COMPAT=10100 is defined. It would still compile and allow
working keys loading from the engine passed on command line.
2022-09-23 13:17:53 +10:00
Petr MenšíkandMark Andrews 71a8f1e7cd Add ENGINE_init and ENGINE_finish calls
According to manual page of ENGINE_init, it should be called explicitly
before any key operations happens. Make it active whole lifetime.
2022-09-23 13:15:16 +10:00
Petr Špaček 5bfec15ad4 Merge branch 'pspacek/fix-out-of-tree-junit' into 'main'
Improve JUnit test status generator for Gitlab CI

See merge request isc-projects/bind9!6166
2022-09-22 14:16:05 +00:00
Petr Špaček 8d095550a8 Unify Python interpreter used by TSAN and JUnit helpers
Reportedly we don't have python2-enabled TSAN builds, so we can remove
one more hardcoded python3 call from .gitlab-ci.yaml.
2022-09-22 15:20:26 +02:00
Petr Špaček c46ad4aec2 Fix JUnit test status generator for out-of-tree system tests
- Use separate paths for tests results and test script
- For tarball tests include the conversion script in the `make dist`
2022-09-22 15:20:23 +02:00
Ondřej Surý e5ff78dfbd Merge branch 'ondrej-loopmgr-cleanup-tcp-implementation' into 'main'
Cleanup the asychronous code in the TCP implementation

See merge request isc-projects/bind9!6703
2022-09-22 12:58:32 +00:00
Ondřej SurýandArtem Boldariev fffd444440 Cleanup the asychronous code in the stream implementations
After the loopmgr work has been merged, we can now cleanup the TCP and
TLS protocols a little bit, because there are stronger guarantees that
the sockets will be kept on the respective loops/threads.  We only need
asynchronous call for listening sockets (start, stop) and reading from
the TCP (because the isc_nm_read() might be called from read callback
again.

This commit does the following changes (they are intertwined together):

1. Cleanup most of the asynchronous events in the TCP code, and add
   comments for the events that needs to be kept asynchronous.

2. Remove isc_nm_resumeread() from the netmgr API, and replace
   isc_nm_resumeread() calls with existing isc_nm_read() calls.

3. Remove isc_nm_pauseread() from the netmgr API, and replace
   isc_nm_pauseread() calls with a new isc_nm_read_stop() call.

4. Disable the isc_nm_cancelread() for the streaming protocols, only the
   datagram-like protocols can use isc_nm_cancelread().

5. Add isc_nmhandle_close() that can be used to shutdown the socket
  earlier than after the last detach.  Formerly, the socket would be
  closed only after all reading and sending would be finished and the
  last reference would be detached.  The new isc_nmhandle_close() can
  be used to close the underlying socket earlier, so all the other
  asynchronous calls would call their respective callbacks immediately.

Co-authored-by: Ondřej Surý <ondrej@isc.org>
Co-authored-by: Artem Boldariev <artem@isc.org>
2022-09-22 14:51:15 +02:00
Michał Kępień 62813df44b Merge branch '1967-prevent-generating-broken-glueless-referrals' into 'main'
Prevent generating broken glueless referrals

Closes #1967

See merge request isc-projects/bind9!4122
2022-09-22 12:23:22 +00:00
Michał Kępień 07721836a4 Add CHANGES and release notes for [GL #1967] 2022-09-22 14:03:17 +02:00
Michał Kępień 68a004501a Ensure required cached glue is rendered
When looking for required glue, dns_message_rendersection() only
processes the first rdataset associated with the first name added to the
ADDITIONAL section.  If the DNS_RDATASETATTR_REQUIRED attribute is set
for an rdataset which is located somewhere else (i.e. the name it is
associated with is preceded by another name in the ADDITIONAL section),
it will not be honored, i.e. the TC bit will not be set even if the
rdataset does not fit into the response.

Check the attributes of each processed rdataset while appending names to
a referral response based on a glue cache entry.  If a given rdataset is
marked with DNS_RDATASETATTR_REQUIRED, make sure the name it is
associated with is added to the response at the beginning of the
ADDITIONAL section, not its end.

Note that using ISC_LIST_PREPEND() instead of ISC_LIST_APPEND() is not
necessary when associating the rdataset with its owner name because the
dns_name_t structures are initialized just before the glue rdatasets are
associated with them and therefore they are empty at that point, which
means no other (non-required) rdataset can precede the glue rdatasets
within the dns_name_t structure owning them.
2022-09-22 14:03:17 +02:00
Michał Kępień d977eae211 Mark required glue during glue cache processing
If an NS RRset at the parent side of a delegation point only contains
in-bailiwick NS records, at least one glue record should be included in
every referral response sent for such a delegation point or else clients
will need to send follow-up queries in order to determine name server
addresses.  In certain edge cases (when the total size of a referral
response without glue records was just below to the UDP packet size
limit), named failed to adhere to that rule by sending non-truncated,
glueless referral responses.

Fix the problem by marking all in-bailiwick NS records processed by
glue_nsdname_cb() (the dns_rdataset_additionaldata() callback used by
RBTDB code while iterating over an NS RRset when dns_rdataset_addglue()
is called) with the DNS_RDATASETATTR_REQUIRED flag.  Note that for
simplicity, glue RRsets for all in-bailiwick NS records are marked this
way, even though dns_message_rendersection() only checks the attributes
for the first rdataset associated with the first name added to the
ADDITIONAL section.
2022-09-22 14:03:17 +02:00
Michał Kępień 1814349374 Add tests for broken glueless referrals
If an NS RRset at the parent side of a delegation point only contains
in-bailiwick NS records, at least one glue record should be included in
every referral response sent for such a delegation point or else clients
will need to send follow-up queries in order to determine name server
addresses.  In certain edge cases (when the total size of a referral
response without glue records was just below to the UDP packet size
limit), named failed to adhere to that rule by sending non-truncated,
glueless referral responses.

Add tests attempting to trigger that bug in several different scenarios,
covering all possible combinations of the following factors:

  - type of zone (signed, unsigned),
  - glue record type (A, AAAA, both).
2022-09-22 14:03:17 +02:00
Michał Kępień 791d26b99e Clean up the "glue" system test
Bring the "glue" system test up to speed with other system tests: add
check numbering, ensure test artifacts are preserved upon failure,
improve error reporting, make the test fail upon unexpected errors,
address ShellCheck warnings.
2022-09-22 14:03:17 +02:00
Tony Finch ea57da8717 Merge branch '3548-without-system-jemalloc' into 'main'
A more helpful error when --without-jemalloc is impossible

Closes #3548

See merge request isc-projects/bind9!6796
2022-09-22 08:40:02 +00:00
Tony Finch f0e79458be A more helpful error when --without-jemalloc is impossible
When jemalloc is the system allocator (on FreeBSD and NetBSD), trying
to build --without-jemalloc caused an obscure compiler error. Instead,
complain at configure time that --without-jemalloc cannot work. (It
needs to remain an error because it is vexing when configure quietly
ignores an explicit direction.)
2022-09-22 08:39:47 +00:00
Ondřej Surý c7e2263ec0 Merge branch '3202-convert-isc_timer-to-use-uv_loop' into 'main'
Resolve "Convert the isc_timer API to use isc_nm loops"

Closes #3202 and #3532

See merge request isc-projects/bind9!6763
2022-09-22 08:21:35 +00:00
Ondřej Surý e2043768b6 Add CHANGES note for [GL #3202] 2022-09-22 09:46:25 +02:00
Ondřej Surý 8d7f173e7c Add more unit tests for isc_timer
Add more tests that deal with rescheduling and restarting the existing
timer and measure that the timer fired at the expected intervals.
2022-09-22 09:46:25 +02:00
Ondřej SurýandEvan Hunt 6797ca49cf Wait for the telemetry check to finish
Instead of expecting that telemetry check has already finished,
wait for it for maximum of three seconds, because named is run with
-tat=3, so the telemetry check must happen with 3 second window.

Co-authored-by: Evan Hunt <each@isc.org>
2022-09-22 09:45:54 +02:00
Ondřej SurýandEvan Hunt 5319d4f6c5 Require isc_timer to be manipulated on the timer loop
Each isc_timer needs to be created, started and destroyed on the current
loop.  The isc_timer_stop() can be run on any loop, but when run from
different loop than the one associated with the timer, the request to
stop the timer will be recorded in atomic variable and the underlying
uv_timer_t will be stopped on next uv_timer_t callback call.  This
allows any thread to stop the timer.
2022-09-21 14:25:33 -07:00
Ondřej SurýandEvan Hunt 5a473b305d Create the negative trust anchor timer on the current loop
Instead of always creating the trust anchor timer (dns_nta_t) on the
main loop, create the timer on the current loop and associate each
dns_nta_t object to the loop it was created on.  This simplifies the
timer handling as everything is run on the associated loop.

During the change, the dns_nta_t structure was renamed to dns__nta_t
and changed to be fully internal to the nta.c compilation unit, and the
dns_ntatable_t structure was made opaque.  This required no change to
code using the API as dns_nta_t never had any external users and the
dns_ntatable_t was properly accessed only by using function calls.
2022-09-21 14:25:33 -07:00
Ondřej SurýandEvan Hunt a93882b50c Create the response policy zones update timer on demand
Instead of creating the response policy zone deferred update timer when
creating the response policy zone object, create it on demand on the
current loop and destroy it as soon as the timer has finished its job.
There's a side-effect - the processing of the response policy zone
update is now done on the current loop - previously, it was always on
the main loop.
2022-09-21 14:25:33 -07:00
Ondřej SurýandEvan Hunt 1c7295af46 Create the catalog zones update timer on demand
Instead of creating the catalog zone deferred update timer when creating
the catalog zone object, create it on demand on the current loop and
destroy it as soon as the timer has finished its job.  There's a
side-effect - the processing of the catalog zone update is now done on
the current loop - previously, it was always on the main loop.
2022-09-21 14:25:33 -07:00
Ondřej SurýandEvan Hunt a56f9d5061 Create the spillattimer when needed and destroy it early
Instead of creating dns_resolver .spillattimer when the dns_resolver_t
object is created, create it on the current loop as needed and destroy
it as soon as the timer has finished its job.  This avoids the need to
manipulate the timer from a different thread.
2022-09-21 14:25:33 -07:00
Ondřej SurýandEvan Hunt f16c46173c Create the fetch context timer on the matching thread
In the dns_resolver API, delay creating the fetch context timer, so it
is created on the thread/loop associated to the fetch context.
2022-09-21 14:25:33 -07:00
Ondřej SurýandEvan Hunt 76be9a329a Create the zone timers on the zone->loop
Instead of creating the zone timers at the zone creation time (which
could be any thread), create the zone timer from the isc_loop that has
beena assigned to the zone (zone->loop);
2022-09-21 14:25:33 -07:00
Ondřej SurýandEvan Hunt 869c6d77a2 Convert isc_ratelimiter API to use on-loop timers
In preparation for the on-loop timers, the isc_ratelimiter API was
converted to use the timer on main loop and start and stop the timer
asynchronously on the main loop.
2022-09-21 14:25:33 -07:00
Ondřej SurýandEvan Hunt 27d1e498b8 Add isc_timer_async_destroy() helper function
As it sometimes happens that the object using isc_timer_t is destroyed
via detaching all the references with no guarantee that the last thread
will be matching thread, add a helper isc_timer_async_destroy() function
that stops the timer and runs the destroy function via isc_async_run()
on the matching thread.
2022-09-21 14:25:33 -07:00
Evan Hunt 3a735998bc Merge branch '3553-httpd-cleanup' into 'main'
additional code cleanups in httpd.c

See merge request isc-projects/bind9!6798
2022-09-21 19:53:50 +00:00
Evan Hunt 4b7248545e additional code cleanups in httpd.c
- use isc_buffer functions when appropriate, rather than converting
  to and from isc_region unnecessarily
- use the zlib total_out value instead of calculating it
- use c99 struct initialization
2022-09-21 11:45:12 -07:00
Tony Finch 7f4889e159 Merge branch 'fanf-random-init-fuzz' into 'main'
Ensure the first random number is non-zero when fuzzing

See merge request isc-projects/bind9!6794
2022-09-21 15:02:04 +00:00
Tony Finch 4b9af22830 Ensure the first random number is non-zero when fuzzing
In fuzzing mode, `isc_random` uses a fixed seed for reproducibility.
The particular seed chosen happened to produce zero as its first
number, however commit bd251de0 introduced an initialization check in
`random_test` that required it to be non-zero. This change adjusts the
seed to avoid spurious test failures.

Also, remove the temporary variable that was used for initialization
because it did not match the type of the thread-local seed array.
2022-09-21 12:47:26 +01:00
Michał Kępień 2ee16067c5 Merge tag 'v9_19_5'
BIND 9.19.5
2022-09-21 13:04:58 +02:00
Arаm Sаrgsyаn b574904041 Merge branch '3529-tls-transport-support-in-dns_request-and-dns_dispatch' into 'main'
Resolve "Implement TLS transport support for dns_request"

Closes #3529

See merge request isc-projects/bind9!6751
2022-09-19 17:14:18 +00:00
Aram Sargsyan f113bc8142 Add CHANGES note for [GL #3529] 2022-09-19 16:36:29 +00:00
Aram Sargsyan 91a0595019 Test TLS transport in dispatch_test.c
Add a new check in dispatch_test.c unit test to confirm that sending
and receiving data using TLS transport works.
2022-09-19 16:36:28 +00:00
Aram Sargsyan 90959f6166 Implement TLS transport support for dns_request and dns_dispatch
This change prepares ground for sending DNS requests using DoT,
which, in particular, will be used for forwarding dynamic updates
to TLS-enabled primaries.
2022-09-19 16:36:28 +00:00
Aram Sargsyan 881747218b Convert xfrin.c:get_create_tlsctx() into a library function
In order to make xfrin.c:get_create_tlsctx() reusable, move the function
into transport.c, and make changes into its prototype to not use the
'dns_xfrin_ctx_t' type, thus making it more universal.

This change prepares ground for adding transport support into the
dispatch manager.

Also, move the typedefs for 'dns_transport_t' and 'dns_transport_list_t'
from transport.h into types.h.
2022-09-19 15:50:06 +00:00
Ondřej Surý 1d153a8db4 Merge branch 'ondrej-move-random-number-re-seeding-out-of-the-hot-path' into 'main'
Move random number re-seeding out of the hot path

See merge request isc-projects/bind9!6173
2022-09-19 14:47:38 +00:00
Tony FinchandOndřej Surý bd251de035 Move random number re-seeding out of the hot path
Instead of checking if we need to re-seed for every isc_random call,
seed the random number generator in the libisc global initializer
and the per-thread initializer.
2022-09-19 16:27:12 +02:00
Ondřej Surý de75595575 Merge branch 'ondrej-unsigned-to-unsigned_int' into 'main'
Add semantic patch to use 'unsigned int' instead of 'unsigned'

See merge request isc-projects/bind9!6741
2022-09-19 14:02:00 +00:00
Ondřej Surý f6e4f620b3 Use the semantic patch to do the unsigned -> unsigned int change
Apply the semantic patch on the whole code base to get rid of 'unsigned'
usage in favor of explicit 'unsigned int'.
2022-09-19 15:56:02 +02:00
Ondřej Surý 7e74e441a5 Add semantic patch to use 'unsigned int' instead of 'unsigned'
Add a very simple patch to enforce usage of 'unsigned int' instead of
just 'unsigned' for the consistency through the whole source code.
2022-09-19 15:52:08 +02:00
Ondřej Surý 28dfa9adcc Merge branch '3510-disable-stringop-overread' into 'main'
Disable stringop-overread with gcc-11+ Address Sanitizer

Closes #3510

See merge request isc-projects/bind9!6747
2022-09-19 13:51:16 +00:00
Ondřej Surý eae4947cc5 Disable stringop-overread with gcc-11+ Address Sanitizer
When Address Sanitizer is enabled in gcc-11+, number of false positives
might appear like this:

    netmgr/udp.c: In function 'isc__nm_udp_send':
    netmgr/udp.c:729:13: warning: 'uv_udp_send' reading 16 bytes from a region of size 8 [-Wstringop-overread]
      729 |         r = uv_udp_send(&uvreq->uv_req.udp_send, &sock->uv_handle.udp,
	  |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      730 |                         &uvreq->uvbuf, 1, sa, udp_send_cb);
          |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    netmgr/udp.c:729:13: note: referencing argument 3 of type 'const uv_buf_t[0]'
    In file included from ./include/isc/uv.h:17,
                     from ./include/isc/barrier.h:31,
                     from netmgr/udp.c:17:
    /usr/include/uv.h:711:15: note: in a call to function 'uv_udp_send'
      711 | UV_EXTERN int uv_udp_send(uv_udp_send_t* req,
          |               ^~~~~~~~~~~

Disable the warning globally in the autoconf, instead of just locally in
a single CI job, as it might affect people outside our GitLab CI.
2022-09-19 15:50:29 +02:00
Ondřej Surý 60e5d75bf1 Merge branch 'ondrej-netmgr-simplify-uv_close' into 'main'
Reorder the uv_close() calls to close the socket immediately

See merge request isc-projects/bind9!6704
2022-09-19 12:43:39 +00:00
Ondřej Surý b1026dd4c1 Add missing isc_refcount_destroy() for isc__nmsocket_t
The destructor for the isc__nmsocket_t was missing call to the
isc_refcount_destroy() on the reference counter, which might lead to
spurious ThreadSanitizer data race warnings if we ever change the
acquire-release memory order in the isc_refcount_decrement().
2022-09-19 14:38:56 +02:00
Ondřej Surý 9b8d432403 Reorder the uv_close() calls to close the socket immediately
Simplify the closing code - during the loopmgr implementation, it was
discovered that the various lists used by the uv_loop_t aren't FIFO, but
LIFO.  See doc/dev/libuv.md for more details.

With this knowledge, we can close the protocol handles (uv_udp_t and
uv_tcp_t) and uv_timer_t at the same time by reordering the uv_close()
calls, and thus making sure that after calling the
isc__nm_stoplistening(), the code will not issue any additional callback
calls (accept, read) on the socket that stopped listening.

This might help with the TLS and DoH shutting down sequence as described
in the [GL #3509] as we now stop the reading, stop the timer and call
the uv_close() as earliest as possible.
2022-09-19 14:38:56 +02:00
Ondřej Surý 23800ecd86 Add developer note for the libuv quirks 2022-09-19 14:38:56 +02:00
Ondřej Surý 88f6f30c3d Merge branch '3545-prevent-unexpected-client-read-callbacks' into 'main'
Prevent unexpected UDP client read callbacks

Closes #3545

See merge request isc-projects/bind9!6777
2022-09-19 12:38:04 +00:00
Ondřej Surý 845d7ef69b Add CHANGES note for [GL #3545] 2022-09-19 14:16:07 +02:00
Ondřej Surý 014da8599f Improve the udp_shutdown_read and udp_cancel_read tests
In the udp_shutdown_read unit test, delay the isc_loopmgr_shutdown() to
the send callback, and in the udp_cancel_read test wait for a single
timed out test, then read again, send an UDP packet and cancel the read
from the send callback.
2022-09-19 14:16:07 +02:00
Ondřej Surý eac8bc5c1a Prevent unexpected UDP client read callbacks
The network manager UDP code was misinterpreting when the libuv called
the udp_recv_cb with nrecv == 0 and addr == NULL -> this doesn't really
mean that the "stream" has ended, but the libuv indicates that the
receive buffer can be freed.  This could lead to assertion failure in
the code that calls isc_nm_read() from the network manager read callback
due to the extra spurious callbacks.

Properly handle the extra callback calls from the libuv in the client
read callback, and refactor the UDP isc_nm_read() implementation to be
synchronous, so no datagram is lost between the time that we stop the
reading from the UDP socket and we restart it again in the asychronous
udpread event.

Add a unit test that tests the isc_nm_read() call from the read
callback to receive two datagrams.
2022-09-19 12:20:41 +02:00
Evan Hunt 94b32f2e0b Merge branch '3522-update-detach' into 'main'
fix an incorrect detach in update processing

Closes #3522

See merge request isc-projects/bind9!6722
2022-09-15 18:33:51 +00:00
Evan Hunt fdc35928eb CHANGES for [GL #3522] 2022-09-15 10:34:25 -07:00
Evan Hunt 00e0758e12 fix an incorrect detach in update processing
when processing UDPATE requests, hold the request handle until
we either drop the request or respond to it.
2022-09-15 10:33:42 -07:00
Michal Nowak 9f7a514e49 Merge branch '3427-tcp-system-test-bump-socket.create_connection-timeout' into 'main'
Bump socket.create_connection() timeout to 10 seconds

Closes #3427

See merge request isc-projects/bind9!6757
2022-09-15 10:19:51 +00:00
Michal Nowak 658cae9fad Bump socket.create_connection() timeout to 10 seconds
The tcp Pytest on OpenBSD fairly reliably fails when receive_tcp()
on a socket is attempted:

    >           (response, rtime) = dns.query.receive_tcp(sock, timeout())

    tests-tcp.py:50:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    /usr/local/lib/python3.9/site-packages/dns/query.py:659: in receive_tcp
        ldata = _net_read(sock, 2, expiration)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    sock = <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
    count = 2, expiration = 1662719959.8106785

        def _net_read(sock, count, expiration):
            """Read the specified number of bytes from sock.  Keep trying until we
            either get the desired amount, or we hit EOF.
            A Timeout exception will be raised if the operation is not completed
            by the expiration time.
            """
            s = b''
            while count > 0:
                try:
    >               n = sock.recv(count)
    E               socket.timeout: timed out

This is because the socket is already closed.

Bump the socket connection timeout to 10 seconds.
2022-09-15 11:13:36 +02:00
Ondřej Surý 1362ffed1f Merge branch '3542-gracefuly-handle-cancelled-http-read-during-sending' into 'main'
Handle canceled read during sending data over stats channel

Closes #3542

See merge request isc-projects/bind9!6773
2022-09-15 08:57:19 +00:00
Ondřej Surý e29563173b Add CHANGES and release note for [GL #3542] 2022-09-15 10:29:58 +02:00
Ondřej Surý 6869c98d36 Provide stronger wording about the security of statistics channel
Add more text about the importance of properly securing the statistics
channel and what is and what is not considered a security vulnerability.
2022-09-15 10:29:38 +02:00
Ondřej Surý 6562227cc8 Handle canceled read during sending data over stats channel
An assertion failure would be triggered when the TCP connection
is canceled during sending the data back to the client.

Don't require the state to be `RECV` on non successful read to
gracefully handle canceled TCP connection during the SEND state of the
HTTPD channel.
2022-09-15 10:29:37 +02:00
Petr Špaček 0ffa8d1a9c Merge branch '1176-add-support-for-sd_notify-interface-to-better-integrate-on-linux' into 'main'
Add support for reporting status via sd_notify()

Closes #1176

See merge request isc-projects/bind9!5514
2022-09-15 08:17:20 +00:00
Ondřej SurýandPetr Špaček 1eb848d71a Add CHANGES and release note for [GL #1176] 2022-09-15 10:12:50 +02:00
Ondřej SurýandPetr Špaček 52b62b7890 Add support for reporting status via sd_notify()
sd_notify() may be called by a service to notify the service manager
about state changes. It can be used to send arbitrary information,
encoded in an environment-block-like string. Most importantly, it can be
used for start-up completion notification.

Add libsystemd check to autoconf script and when the library is detected
add calls to sd_notify() around the server->reload_status changes.

Co-authored-by: Petr Špaček <pspacek@isc.org>
2022-09-15 10:12:15 +02:00
Petr Špaček 0b7f082060 Merge branch 'pspacek/log-no-recursion-reason' into 'main'
Log reasons why ACL denied recursion or cache peek

See merge request isc-projects/bind9!6669
2022-09-15 07:40:17 +00:00
Evan HuntandPetr Špaček a2bbe578bf Add tests for the new log messages with refusal reason
Update the allow-query test to check for the new log messages.
2022-09-15 06:50:57 +02:00
Petr Špaček 67c3a3439b CHANGES note for [GL !6669] 2022-09-15 06:50:55 +02:00
Petr Špaček fdf7456643 Log reason why cache peek is not available
Log which ACL caused RD=0 query into cache to be refused.
Expected performance impact is negligible.
2022-09-15 06:50:13 +02:00
Petr Špaček 95fc05c454 Log reason why recursion is not available
Log which ACL caused RA=0 condition.
Expected performance impact is negligible.
2022-09-15 06:50:13 +02:00
Mark Andrews 5c5f6964ff Merge branch '3525-key-id-clashes-across-algorithms-cause-problems-with-statistics' into 'main'
Resolve "key id clashes across algorithms cause problems with statistics"

Closes #3525

See merge request isc-projects/bind9!6745
2022-09-15 01:04:17 +00:00
Mark Andrews 91488a9b6d Add a release note for [GL #3525] 2022-09-15 09:09:35 +10:00
Mark Andrews b15309e10d Add a CHANGES note for [GL #3525] 2022-09-15 08:44:28 +10:00
Mark Andrews b1ef1ded69 Emit key algorithm + key id in dnssec signing statsistics
If there was a collision of key id across algorithms it was not
possible to determine where counter applies to which algorithm for
xml statistics while for json only one of the values was emitted.
The key names are now "<algorithm-number>+<id>" (e.g. "8+54274").
2022-09-15 08:42:45 +10:00
Evan Hunt 491ead7820 Merge branch 'each-remove-resolve' into 'main'
remove 'resolve' test binary

See merge request isc-projects/bind9!6733
2022-09-14 17:20:52 +00:00
Evan Hunt d99076ede4 remove 'resolve' test binary
the 'resolve' binary was added for testing dns_client as part of
the export library. the export libraries are no longer supported,
and tests using 'delv' provide the same coverage, so 'resolve' can
be removed now.
2022-09-14 10:17:06 -07:00
Evan Hunt e73317d4f3 Merge branch 'each-cleanup-dns_request' into 'main'
remove dns_request_create()

See merge request isc-projects/bind9!6753
2022-09-14 17:14:01 +00:00
Evan Hunt ebf7b31aa3 merge dns_request_createvia() into dns_request_create()
dns_request_create() was a front-end to dns_request_createvia() that
was only used by test binaries. dns_request_createvia() has been
renamed to dns_request_create(), and the test programs that formerly
used dns_request_create() have been updated to use the new parameters.
2022-09-14 09:51:08 -07:00
Evan Hunt 05c1d2d365 Merge branch '3399-random-device-ancient' into 'main'
flag "random-device" as ancient

Closes #3399

See merge request isc-projects/bind9!6769
2022-09-14 16:41:15 +00:00
Evan Hunt 0cc6c9f0b8 CHANGES for [GL #3399] 2022-09-14 09:36:58 -07:00
Evan Hunt 9730f21f83 flag "random-device" as ancient
the "random-device" option was made non-functional in 9.13. this commit
removes it from the configuration parser; setting it is now an error.
2022-09-14 09:36:58 -07:00
Tony Finch fade14c809 Merge branch '3537-idna-test' into 'main'
Fix dig idna test on Debian 10 "buster"

Closes #3537

See merge request isc-projects/bind9!6767
2022-09-14 12:39:08 +00:00
Tony Finch 5c1aed2881 Fix dig idna test on Debian 10 "buster"
The test expected `xn--ah-` to be treated as a syntax error (punycode
requires letters after the last hyphen) but libidn2 on buster
converted the label to `ah` instead. To avoid this bug, change the
invalid label to `xn--0000h` which translates to an out-of-range
unicode codepoint (beyond the maximum value) which is corectly
trated as invalid in older libidn2.
2022-09-14 11:59:42 +01:00
Tony Finch 83f27b6f3b Merge branch '3536-out-of-tree' into 'main'
Fix out-of-tree tests

Closes #3536

See merge request isc-projects/bind9!6766
2022-09-14 10:23:29 +00:00
Tony Finch 2a0b81d6da Fix out-of-tree tests
The change to `testsock.pl` in commit 258a896a broke the system
tests in out-of-tree builds because `ifconfig.sh.in` is not
copied to the worktree. Use `ifconfig.sh` instead.
2022-09-14 10:02:58 +01:00
Mark Andrews 44235cd2cf Merge branch '2295-add-the-ability-to-specify-that-a-server-supports-cookies' into 'main'
Resolve "Add the ability to specify that a server supports COOKIES."

Closes #2295

See merge request isc-projects/bind9!4410
2022-09-14 01:36:42 +00:00
Mark Andrews b22df206d4 Add CHANGES and release notes for [GL #2295] 2022-09-13 12:07:13 +10:00
Mark Andrews 9d893d55e0 Check "require-cookie yes;" triggers TCP fallback on no cookie 2022-09-13 12:07:13 +10:00
Mark Andrews 7751e5e039 Add server clause require-cookie
Specifies if an UDP response requires a DNS COOKIE or not.
Fallback to TCP if not present and not TSIG signed.
2022-09-13 12:07:13 +10:00
Evan Hunt 00e3c8fe1a Merge branch '3520-rndc-shutdown-hang' into 'main'
prevent a possible shutdown hang in rndc

See merge request isc-projects/bind9!6734
2022-09-12 20:34:32 +00:00
Evan Hunt 9683439d73 prevent a possible shutdown hang in rndc
In rndc_recvdone(), if 'sends' was not 0, then 'recvs' was not
decremented, in which case isc_loopmgr_shutdown() was never reached,
which could cause a hang. (This has not been observed to happen, but
the code was incorrect on examination.)
2022-09-12 13:14:19 -07:00
Tony Finch b5b147864f Merge branch 'fanf-tolower' into 'main'
De-duplicate `tolower()`

See merge request isc-projects/bind9!6516
2022-09-12 12:08:06 +00:00
Tony Finch 022bb06264 CHANGES note for [GL !6516]
[cleanup]	Move the duplicated ASCII case conversion tables to
		isc_ascii where they can be shared, and replace the
		various hot-path tolower() loops with calls to new
		isc_ascii implementations.
2022-09-12 12:23:39 +01:00
Tony Finch 68029bfc9d Tests and benchmark for isc_ascii
The test is to verify basic functionality. The benchmark compares a
number of alternative tolower() implementations on large and small
strings.
2022-09-12 12:23:39 +01:00
Tony Finch 21a383a8fd General-purpose unrolled ASCII tolower() loops
When converting a string to lower case, the compiler is able to
autovectorize nicely, so a nice simple implementation is also very
fast, comparable to memcpy().

Comparisons are more difficult for the compiler, so we convert eight
bytes at a time using "SIMD within a register" tricks. Experiments
indicate it's best to stick to simple loops for shorter strings and
the remainder of long strings.
2022-09-12 12:18:57 +01:00
Tony Finch 27a561273e Consolidate some ASCII tables in isc/ascii and isc/hex
There were a number of places that had copies of various ASCII
tables (case conversion, hex and decimal conversion) that are intended
to be faster than the ctype.h macros, or avoid locale pollution.

Move them into libisc, and wrap the lookup tables with macros that
avoid the ctype.h gotchas.
2022-09-12 12:18:57 +01:00
Tony Finch db3590e0b7 Merge branch '3519-macos-tests' into 'main'
System test fixes for macOS

Closes #3519

See merge request isc-projects/bind9!6719
2022-09-12 11:14:27 +00:00
Tony Finch d8053785b0 Skip the xfer test when Net::DNS is too old
This allows the system tests to run to completion on macOS
without requiring extra modules from CPAN.
2022-09-12 12:13:04 +01:00
Tony Finch 258a896a0c The system tests are using another IP address
Reduce the number of places that know about the number of IP addresses
required by the system tests, by changing `testsock.pl` to read the
`max` from `ifconfig.sh.in`. This should make the test runner fail
early with a clear message when the interfaces have been set up by an
obsolete script.

Add comments to cross-reference `ifconfig.sh.in`, `testsock.pl`, and
`org.isc.bind.system` to make it easier to remember what needs
updating when an IP address is added.
2022-09-12 12:13:04 +01:00
Tony Finch eb68baffd9 Merge branch '3527-dig-idna-relaxed' into 'main'
More lenient IDNA processing in dig

Closes #3527

See merge request isc-projects/bind9!6738
2022-09-12 11:09:38 +00:00
Tony Finch ac487af09e CHANGES and release note for [GL #3527]
[func]		When an international domain name is not valid, DiG will
		now pass it through unchanged, instead of stopping with
		an error message. [GL #3527]
2022-09-12 11:42:02 +01:00
Tony Finch f820ef49bf More lenient IDNA processing in dig
If there are any problems with IDN processing, DiG will now quietly
handle the name as if IDN were disabled. This means that international
query names are rendered verbatim on the wire, and ACE names are
printed raw without conversion to UTF8.

If you want to check the syntax of international domain names,
use the `idn2` utility.
2022-09-12 11:40:08 +01:00
Tony Finch 8b9dba53dd Merge branch '3528-catz-test-faster' into 'main'
Speed up the `catz` system test

Closes #3528

See merge request isc-projects/bind9!6742
2022-09-12 10:31:10 +00:00
Tony Finch cdfe8f23c2 Speed up the catz system test
Do not delay sending NOFIFY messages, and allow catalog zones to
update every second instead of every 5 seconds.
2022-09-12 11:30:09 +01:00
Tony Finch 2ae81024df Merge branch '3531-initialize-struct-server' into 'main'
Ensure that named_server_t is properly initialized

Closes #3531

See merge request isc-projects/bind9!6755
2022-09-12 10:12:42 +00:00
Tony Finch 7b71b1020f Ensure that named_server_t is properly initialized
There was a ubsan error reporting an invalid value for interface_auto
(a boolean value cannot be 190) because it was not initialized. To
avoid this problem happening again, ensure the whole of the server
structure is initialized to zero before setting the (relatively few)
non-zero elements.
2022-09-12 10:35:39 +01:00
Michał Kępień 37cdd6b51d Merge branch '3534-fix-error-reporting-for-posix-threads-functions' into 'main'
Fix error reporting for POSIX Threads functions

See merge request isc-projects/bind9!6756
2022-09-09 18:28:07 +00:00
Michał Kępień 3b1c80fd0f Fix error reporting for POSIX Threads functions
Commit 3608abc8fa inadvertently carried
over a mistake in logging pthread_cond_init() errors to the
ERRNO_CHECK() preprocessor macro: instead of passing the value returned
by a given pthread_*() function to strerror_r(), ERRNO_CHECK() passes
the errno variable to strerror_r().  This causes bogus error reports
because POSIX Threads API functions do not set the errno variable.

Fix by passing the value returned by a given pthread_*() function
instead of the errno variable to strerror_r().  Since this change makes
the name of the affected macro (ERRNO_CHECK()) confusing, rename the
latter to PTHREADS_RUNTIME_CHECK().  Also log the integer error value
returned by a given pthread_*() function verbatim to rule out any
further confusion in runtime error reporting.
2022-09-09 20:25:47 +02:00
Michał Kępień a1ae24d9ae Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.6' into 'main'
Set up version and release notes for BIND 9.19.6

See merge request isc-projects/bind9!6758
2022-09-09 18:23:08 +00:00
Michał Kępień 3239875a8a Set up release notes for BIND 9.19.6 2022-09-09 19:56:43 +02:00
Michał Kępień fa610c0d1b Update BIND version to 9.19.6-dev 2022-09-09 19:56:43 +02:00
Michał Kępień 5b2fed25f4 Update BIND version for release 2022-09-08 14:00:21 +02:00
Michał Kępień e46709eb07 Add a CHANGES marker 2022-09-08 14:00:21 +02:00
Michał Kępień c4dd168b38 Merge branch 'michal/prepare-documentation-for-bind-9.19.5' into 'security-main'
Prepare documentation for BIND 9.19.5

See merge request isc-private/bind9!458
2022-09-08 11:58:18 +00:00
Michał Kępień 41fdb42e9c Add release note for GL #3410 2022-09-08 12:45:56 +02:00
Michał Kępień ef5e0641c3 Tweak and reword release notes 2022-09-08 12:45:56 +02:00
Michał Kępień 849563797e Prepare release notes for BIND 9.19.5 2022-09-08 12:45:56 +02:00
Michał Kępień dd91276106 Merge branch '3487-eddsa-verify-leak' into 'security-main'
[CVE-2022-38178] eddsa verify leak

See merge request isc-private/bind9!422
2022-09-08 09:29:18 +00:00
Mark AndrewsandMichał Kępień e6cb1de20b Add release note for [GL #3487] 2022-09-08 11:27:31 +02:00
Mark AndrewsandMichał Kępień b3277f2e10 Add CHANGES note for [GL #3487] 2022-09-08 11:27:31 +02:00
Mark AndrewsandMichał Kępień 6ddb480a84 Free ctx on invalid siglen 2022-09-08 11:27:31 +02:00
Michał Kępień b101f27615 Merge branch '3517-serve-stale-client-timeout-0-cname-crash' into 'security-main'
[CVE-2022-3080] Fix serve-stale-client-timeout 0 CNAME crash

See merge request isc-private/bind9!443
2022-09-08 09:25:51 +00:00
Matthijs MekkingandMichał Kępień 97c6c3712e Add release notes for #3517 2022-09-08 11:24:37 +02:00
Matthijs MekkingandMichał Kępień e394902965 Add CHANGES entry for 3517 2022-09-08 11:24:37 +02:00
Matthijs MekkingandMichał Kępień d939d2ecde Only refresh RRset once
Don't attempt to resolve DNS responses for intermediate results. This
may create multiple refreshes and can cause a crash.

One scenario is where for the query there is a CNAME and canonical
answer in cache that are both stale. This will trigger a refresh of
the RRsets because we encountered stale data and we prioritized it over
the lookup. It will trigger a refresh of both RRsets. When we start
recursing, it will detect a recursion loop because the recursion
parameters will eventually be the same. In 'dns_resolver_destroyfetch'
the sanity check fails, one of the callers did not get its event back
before trying to destroy the fetch.

Move the call to 'query_refresh_rrset' to 'ns_query_done', so that it
is only called once per client request.

Another scenario is where for the query there is a stale CNAME in the
cache that points to a record that is also in cache but not stale. This
will trigger a refresh of the RRset (because we encountered stale data
and we prioritized it over the lookup).

We mark RRsets that we add to the message with
DNS_RDATASETATTR_STALE_ADDED to prevent adding a duplicate RRset when
a stale lookup and a normal lookup conflict with each other. However,
the other non-stale RRset when following a CNAME chain will be added to
the message without setting that attribute, because it is not stale.

This is a variant of the bug in #2594. The fix covered the same crash
but for stale-answer-client-timeout > 0.

Fix this by clearing all RRsets from the message before refreshing.
This requires the refresh to happen after the query is send back to
the client.
2022-09-08 11:24:37 +02:00
Michał Kępień d6faec60b1 Merge branch '3491-security-fix-openssl-dh-memory-leaks' into 'security-main'
[CVE-2022-2906] Fix memory leaks in DH code

See merge request isc-private/bind9!426
2022-09-08 09:22:32 +00:00
Aram SargsyanandMichał Kępień 113e949b34 Add release note for [GL #3491] 2022-09-08 11:20:34 +02:00
Aram SargsyanandMichał Kępień 5b5f2353d4 Add CHANGES note for [GL #3491] 2022-09-08 11:20:34 +02:00
Aram SargsyanandMichał Kępień 73d6bbff4e Fix memory leaks in DH code
When used with OpenSSL v3.0.0+, the `openssldh_compare()`,
`openssldh_paramcompare()`, and `openssldh_todns()` functions
fail to cleanup the used memory on some error paths.

Use `DST_RET` instead of `return`, when there is memory to be
released before returning from the functions.
2022-09-08 11:20:34 +02:00
Michał Kępień 3d2cf90390 Merge branch '3493-confidential-compression-buffer-reuse' into 'security-main'
[CVE-2022-2881] compression buffer was not reused correctly

See merge request isc-private/bind9!425
2022-09-08 09:18:27 +00:00
Evan HuntandMichał Kępień 430ee6c427 CHANGES and release notes for CVE-2022-2881 [GL #3493] 2022-09-08 11:15:52 +02:00
Evan HuntandMichał Kępień 47e9fa981e compression buffer was not reused correctly
when the compression buffer was reused for multiple statistics
requests, responses could grow beyond the correct size. this was
because the buffer was not cleared before reuse; compressed data
was still written to the beginning of the buffer, but then the size
of used region was increased by the amount written, rather than set
to the amount written. this caused responses to grow larger and
larger, potentially reading past the end of the allocated buffer.
2022-09-08 11:15:52 +02:00
Michał Kępień 2cffc5b849 Merge branch '3394-security-cve-2022-2795-mitigation' into 'security-main'
[CVE-2022-2795] Bound the amount of work performed for delegations

See merge request isc-private/bind9!431
2022-09-08 09:13:53 +00:00
Michał Kępień 672072812c Add release note for GL #3394 2022-09-08 11:11:30 +02:00
Michał Kępień e802beedfc Add CHANGES entry for GL #3394 2022-09-08 11:11:30 +02:00
Michał Kępień 3a44097fd6 Bound the amount of work performed for delegations
Limit the amount of database lookups that can be triggered in
fctx_getaddresses() (i.e. when determining the name server addresses to
query next) by setting a hard limit on the number of NS RRs processed
for any delegation encountered.  Without any limit in place, named can
be forced to perform large amounts of database lookups per each query
received, which severely impacts resolver performance.

The limit used (20) is an arbitrary value that is considered to be big
enough for any sane DNS delegation.
2022-09-08 11:11:30 +02:00
Michał Kępień 529425b89d Merge branch 'michal/add-placeholder-entries-to-CHANGES' into 'main'
Add placeholder entries to CHANGES

See merge request isc-projects/bind9!6750
2022-09-08 08:55:46 +00:00
Michał Kępień 29ed170ba0 Add placeholder entries to CHANGES
Add placeholders for the following issues:

  - [GL #3394]
  - [GL #3487]
  - [GL #3491]
  - [GL #3493]
  - [GL #3517]
2022-09-08 10:42:01 +02:00
Michał Kępień 5fdff51785 Merge branch '3459-rrl-wildcard-handling' into 'main'
Make RRL code treat all QNAMEs subject to wildcard processing as the same name

Closes #3459

See merge request isc-projects/bind9!6744
2022-09-08 07:35:43 +00:00
Aram SargsyanandMichał Kępień 0b0cf12741 Add CHANGES and release notes for [GL #3459] 2022-09-08 09:15:30 +02:00
Aram SargsyanandMichał Kępień 89c2032421 Document RRL processing for wildcard names
All valid wildcard domain names are interpreted as the zone's origin
name concatenated to the "*" name.
2022-09-08 09:15:30 +02:00
Aram SargsyanandMichał Kępień baa9698c9d Fix RRL responses-per-second bypass using wildcard names
It is possible to bypass Response Rate Limiting (RRL)
`responses-per-second` limitation using specially crafted wildcard
names, because the current implementation, when encountering a found
DNS name generated from a wildcard record, just strips the leftmost
label of the name before making a key for the bucket.

While that technique helps with limiting random requests like
<random>.example.com (because all those requests will be accounted
as belonging to a bucket constructed from "example.com" name), it does
not help with random names like subdomain.<random>.example.com.

The best solution would have been to strip not just the leftmost
label, but as many labels as necessary until reaching the suffix part
of the wildcard record from which the found name is generated, however,
we do not have that information readily available in the context of RRL
processing code.

Fix the issue by interpreting all valid wildcard domain names as
the zone's origin name concatenated to the "*" name, so they all will
be put into the same bucket.
2022-09-08 09:15:30 +02:00
Matthijs Mekking 089fcfbcbd Merge branch 'matthijs-fix-intermittent-inline-system-test-failure' into 'main'
Fix intermittent inline system test failure

See merge request isc-projects/bind9!6708
2022-09-07 15:10:56 +00:00
Matthijs Mekking 8b71cbd09c Update inline system test, zone 'retransfer3.'
The zone 'retransfer3.' tests whether zones that 'rndc signing
-nsec3param' requests are queued even if the zone is not loaded.

The test assumes that if 'rndc signing -list' shows that the zone is
done signing with two keys, and there are no NSEC3 chains pending, the
zone is done handling the '-nsec3param' queued requests. However, it
is possible that the 'rndc signing -list' command is received before
the corresponding privatetype records are added to the zone (the records
that are used to retrieve the signing status with 'rndc signing').

This is what happens in test failure
https://gitlab.isc.org/isc-projects/bind9/-/jobs/2722752.

The 'rndc signing -list retransfer3' is thus an unreliable check.
It is simpler to just remove the check and wait for a certain amount
of time and check whether ns3 has re-signed the zone using NSEC3.
2022-09-07 16:24:14 +02:00
Michał Kępień 77f5341730 Merge branch '3508-fix-building-without-doh-support' into 'main'
Fix building without DoH support

Closes #3508

See merge request isc-projects/bind9!6737
2022-09-07 11:21:57 +00:00
Michał Kępień 4c49068531 Fix building with --disable-doh
Commit b69e783164 inadvertently caused
builds using the --disable-doh switch to fail, by putting the
declaration of the isc__nm_async_settlsctx() function inside an #ifdef
block that is only evaluated when DNS-over-HTTPS support is enabled.
This results in the following compilation errors being triggered:

    netmgr/netmgr.c:2657:1: error: no previous prototype for 'isc__nm_async_settlsctx' [-Werror=missing-prototypes]
     2657 | isc__nm_async_settlsctx(isc__networker_t *worker, isc__netievent_t *ev0) {
          | ^~~~~~~~~~~~~~~~~~~~~~~

Fix by making the declaration of the isc__nm_async_settlsctx() function
in lib/isc/netmgr/netmgr-int.h visible regardless of whether
DNS-over-HTTPS support is enabled or not.
2022-09-07 12:50:08 +02:00
Michał Kępień d8644930b4 Test the --disable-doh switch in GitLab CI
Use the --disable-doh switch for all Ubuntu 22.04 builds in GitLab CI to
immediately flag any code changes that would break such builds.
2022-09-07 12:50:08 +02:00
Evan Hunt 7fec4505da Merge branch 'each-interface-magic' into 'main'
when creating an interface, set magic before linking

See merge request isc-projects/bind9!6735
2022-09-07 04:47:09 +00:00
Evan Hunt 8c01662048 when creating an interface, set magic before linking
set the magic number in a newly-created interface object
before appending it to mgr->interfaces in order to prevent
a possible assertion.
2022-09-06 17:12:14 -07:00
Mark Andrews 5267a25b17 Merge branch '3364-various-coverity-issues-after-dns_message_gettemp-cleanup' into 'main'
Resolve "Various Coverity issues after dns_message_gettemp* cleanup"

Closes #3364

See merge request isc-projects/bind9!6588
2022-09-06 15:25:39 +00:00
Mark Andrews 785d021d00 Remove dead code
*** CID 352817:  Control flow issues  (DEADCODE) /lib/ns/xfrout.c: 1568 in sendstream()
    1562
    1563     	/* Advance lasttsig to be the last TSIG generated */
    1564     	CHECK(dns_message_getquerytsig(msg, xfr->mctx, &xfr->lasttsig));
    1565
    1566     failure:
    1567     	if (msgname != NULL) {
    >>>     CID 352817:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach this statement: "if (msgrds != NULL) {
      if ...".
    1568     		if (msgrds != NULL) {
    1569     			if (dns_rdataset_isassociated(msgrds)) {
    1570     				dns_rdataset_disassociate(msgrds);
    1571     			}
    1572     			dns_message_puttemprdataset(msg, &msgrds);
    1573     		}
2022-09-06 12:47:08 +00:00
Mark Andrews 5805457d9d Remove dead code
*** CID 352816:  Control flow issues  (DEADCODE) /lib/ns/query.c: 8443 in query_dns64()
    8437     cleanup:
    8438     	if (buffer != NULL) {
    8439     		isc_buffer_free(&buffer);
    8440     	}
    8441
    8442     	if (dns64_rdata != NULL) {
    >>>     CID 352816:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach this statement: "dns_message_puttemprdata(cl...".
    8443     		dns_message_puttemprdata(client->message, &dns64_rdata);
    8444     	}
    8445
    8446     	if (dns64_rdataset != NULL) {
    8447     		dns_message_puttemprdataset(client->message, &dns64_rdataset);
    8448     	}
2022-09-06 12:47:08 +00:00
Mark Andrews 3ef734e0f5 Remove dead code
*** CID 352812:  Control flow issues  (DEADCODE) /lib/ns/query.c: 8584 in query_filter64()
    8578     cleanup:
    8579     	if (buffer != NULL) {
    8580     		isc_buffer_free(&buffer);
    8581     	}
    8582
    8583     	if (myrdata != NULL) {
    >>>     CID 352812:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach this statement: "dns_message_puttemprdata(cl...".
    8584     		dns_message_puttemprdata(client->message, &myrdata);
    8585     	}
    8586
    8587     	if (myrdataset != NULL) {
    8588     		dns_message_puttemprdataset(client->message, &myrdataset);
    8589     	}
2022-09-06 12:47:08 +00:00
Mark Andrews 8e5a7e8bac Silence REVERSE_INULL
Remove unnecessary != NULL checks

    *** CID 352809:  Null pointer dereferences  (REVERSE_INULL) /lib/dns/message.c: 4654 in dns_message_buildopt()
    4648     	if (rdata != NULL) {
    4649     		dns_message_puttemprdata(message, &rdata);
    4650     	}
    4651     	if (rdataset != NULL) {
    4652     		dns_message_puttemprdataset(message, &rdataset);
    4653     	}
    >>>     CID 352809:  Null pointer dereferences  (REVERSE_INULL)
    >>>     Null-checking "rdatalist" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    4654     	if (rdatalist != NULL) {
    4655     		dns_message_puttemprdatalist(message, &rdatalist);
    4656     	}
    4657     	return (result);
    4658     }
    4659
2022-09-06 12:47:08 +00:00
Mark Andrews 24710beaff Remove dead code in xfrin.c
also removed unnecessary 'msg != NULL' check

   *** CID 352815:  Control flow issues  (DEADCODE) /lib/dns/xfrin.c: 1363 in xfrin_send_request()
   1357     	isc_nmhandle_attach(send_xfr->handle, &xfr->sendhandle);
   1358     	isc_refcount_increment0(&send_xfr->sends);
   1359     	isc_nm_send(xfr->handle, &region, xfrin_send_done, send_xfr);
   1360
   1361     failure:
   1362     	if (qname != NULL) {
   >>>     CID 352815:  Control flow issues  (DEADCODE)
   >>>     Execution cannot reach this statement: "dns_message_puttempname(msg...".
   1363     		dns_message_puttempname(msg, &qname);
   1364     	}
   1365     	if (qrdataset != NULL) {
   1366     		dns_message_puttemprdataset(msg, &qrdataset);
   1367     	}
   1368     	if (msg != NULL) {

   *** CID 352819:  Control flow issues  (DEADCODE) /lib/dns/xfrin.c: 1366 in xfrin_send_request()
   1360
   1361     failure:
   1362     	if (qname != NULL) {
   1363     		dns_message_puttempname(msg, &qname);
   1364     	}
   1365     	if (qrdataset != NULL) {
   >>>     CID 352819:  Control flow issues  (DEADCODE)
   >>>     Execution cannot reach this statement: "dns_message_puttemprdataset...".
   1366     		dns_message_puttemprdataset(msg, &qrdataset);
   1367     	}
   1368     	if (msg != NULL) {
   1369     		dns_message_detach(&msg);
   1370     	}
   1371     	if (soatuple != NULL) {
2022-09-06 12:47:08 +00:00
Arаm Sаrgsyаn 4dc37589c4 Merge branch '3518-libxml2-deprecated-functions' into 'main'
Do not use libxml2 deprecated functions

Closes #3518

See merge request isc-projects/bind9!6727
2022-09-06 09:42:01 +00:00
Aram Sargsyan 87920661b1 Add CHANGES note for [GL #3518] 2022-09-06 08:55:07 +00:00
Aram Sargsyan a5d412d924 Do not use libxml2 deprecated functions
The usage of xmlInitThreads() and xmlCleanupThreads() functions in
libxml2 is now marked as deprecated, and these functions will be made
private in the future.

Use xmlInitParser() and xmlCleanupParser() instead of them.
2022-09-06 08:55:07 +00:00
Arаm Sаrgsyаn 6c0560f014 Merge branch 'aram/isc_nm_listentlsdns-error-path-bugfix' into 'main'
Fix isc_nm_listentlsdns() error path bug

See merge request isc-projects/bind9!6728
2022-09-06 08:25:39 +00:00
Aram Sargsyan 2f11e48f0d Fix isc_nm_listentlsdns() error path bug
The isc_nm_listentlsdns() function erroneously calls
isc__nm_tcpdns_stoplistening() instead of isc__nm_tlsdns_stoplistening()
when something goes wrong, which can cause an assertion failure.
2022-09-05 14:58:52 +00:00
Ondřej Surý 7067f30510 Merge branch '3485-dig-fallback-to-idna2003' into 'main'
Allow fallback to IDNA2003 processing

Closes #3485

See merge request isc-projects/bind9!6699
2022-09-05 08:36:48 +00:00
Ondřej Surý 0fe7acb4e6 Add CHANGES and release note for [GL #3485] 2022-09-05 10:35:09 +02:00
Ondřej Surý 87de726f5c Enable the IDNA2003 domain names in the idna system test
Allow the IDNA2003 tests to succeed after the fallback to IDNA2003 was
implemented.
2022-09-05 10:34:49 +02:00
Ondřej Surý 10923f9d87 Allow fallback to IDNA2003 processing
In several cases where IDNA2008 mappings do not exist whereas IDNA2003
mappings do, dig was failing to process the suplied domain name.  Take a
backwards compatible approach, and convert the domain to IDNA2008 form,
and if that fails try the IDNA2003 conversion.
2022-09-05 10:34:49 +02:00
Arаm Sаrgsyаn b5d5c383a7 Merge branch '3515-mctx-attach-detach-for-isc_mempool_t' into 'main'
Add mctx attach/detach when creating/destroying a memory pool

Closes #3515

See merge request isc-projects/bind9!6712
2022-09-02 09:02:38 +00:00
Aram Sargsyan 362ead8d85 Add CHANGES note for [GL #3515] 2022-09-02 08:16:44 +00:00
Aram Sargsyan e97c3eea95 Add mctx attach/detach when creating/destroying a memory pool
This should make sure that the memory context is not destroyed
before the memory pool, which is using the context.
2022-09-02 08:16:17 +00:00
Arаm Sаrgsyаn 774a0277a0 Merge branch '3514-cid-356328-deadcode-in-server.c' into 'main'
Resolve "CID 356328: Control flow issues (DEADCODE) in bin/named/server.c"

Closes #3514

See merge request isc-projects/bind9!6713
2022-09-02 08:14:46 +00:00
Aram Sargsyan 7ce1f3d872 Use the return value of isc_portset_create()
There is an omission of assigning the return value coming from the
isc_portset_create() function to the result variable.

CID 356328:

    /bin/named/server.c: 8756 in load_configuration()
    8750     			      "creating UDP/IPv4 port set: %s",
    8751     			      isc_result_totext(result));
    8752     		goto cleanup_bindkeys_parser;
    8753     	}
    8754     	isc_portset_create(named_g_mctx, &v6portset);
    8755     	if (result != ISC_R_SUCCESS) {
    >>>     CID 356328:  Control flow issues  (DEADCODE)
    >>>     Execution cannot reach this statement: "isc_log_write(named_g_lctx,...".
    8756     		isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
    8757     			      NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
    8758     			      "creating UDP/IPv6 port set: %s",
    8759     			      isc_result_totext(result));
    8760     		goto cleanup_v4portset;
    8761     	}
2022-09-02 07:40:27 +00:00
Evan Hunt 4bc0db5ed2 Merge branch '3511-quote-yaml-addresses' into 'main'
quote addresses in YAML output

Closes #3511

See merge request isc-projects/bind9!6702
2022-08-31 23:16:32 +00:00
Evan Hunt f72bf1375a CHANGES for [GL #3511] 2022-08-31 15:32:37 -07:00
Evan Hunt 66eaf6bb73 quote addresses in YAML output
YAML strings should be quoted if they contain colon characters.
Since IPv6 addresses do, we now quote the query_address and
response_address strings in all YAML output.
2022-08-31 15:32:24 -07:00
Evan Hunt aba940dd90 Merge branch '3501-dnstap-response' into 'main'
dnstap query_message field was erroneously set with responses

Closes #3501

See merge request isc-projects/bind9!6701
2022-08-31 22:22:44 +00:00
Evan Hunt fea9751f13 CHANGES for [GL #3501] 2022-08-31 11:33:54 -07:00
Evan Hunt 3ccfff8ab6 dnstap query_message field was erroneously set with responses
The dnstap query_message field was in some cases being filled in
with response messages, along with the response_message field.
The query_message field should only be used when logging requests,
and the response_message field only when logging responses.
2022-08-31 11:33:25 -07:00
Arаm Sаrgsyаn 692975746f Merge branch '3410-rpz-extended-errors' into 'main'
RPZ Extended DNS Error Codes

Closes #3410

See merge request isc-projects/bind9!6700
2022-08-31 09:21:11 +00:00
Aram Sargsyan 0f9d645582 Add CHANGES note for [GL #3410] 2022-08-31 08:56:03 +00:00
Aram Sargsyan 7eda1aba76 Document RPZ Extended DNS Error (EDE) code configuration option
Add information about the 'ede' option for response policy zones.
2022-08-31 08:56:03 +00:00
Aram Sargsyan 5e4e303ffa Add system tests for RPZ EDE codes
Check the new configuration option's syntax using the 'checkconf' system
test.

Check if the new option works by parsing DiG's output in the 'rpz'
system test.
2022-08-31 08:56:03 +00:00
Aram Sargsyan 83395f4cfb Set the extended DNS error code for RPZ-modified queries
When enabled through a configuration option, set the configured EDE code
for the modified queries.
2022-08-31 08:56:03 +00:00
Aram Sargsyan 77f12ecba7 Add extended DNS error configuration option for RPZ zones
Implement the configuration option with its checking and parsing parts.

The option should be later used by BIND to set an extended error
code (EDE) for the queries modified in the result of RPZ processing.
2022-08-31 08:56:03 +00:00
Arаm Sаrgsyаn 77024e6ad6 Merge branch 'aram/rpz-doc-update' into 'main'
Update RPZ documentation in ARM

See merge request isc-projects/bind9!6705
2022-08-31 08:52:35 +00:00
Aram Sargsyan 0fbd07ac22 Update RPZ documentation
The RPZ documentation section with response policy rules and actions
is incomplete.

Add information about the 'RPZ-CLIENT-IP' rule, and 'TCP-Only' and
'DROP' actions.
2022-08-29 14:04:03 +00:00
Ondřej Surý 7bf8a7ab1b Merge branch 'ondrej-add-isc-loopmgr' into 'main'
Separate the event loop handling into a separate layer

Closes #3508

See merge request isc-projects/bind9!6040
2022-08-26 08:08:42 +00:00
Evan HuntandOndřej Surý 92526facb1 CHANGES and release note for [GL #3508] 2022-08-26 09:09:25 +02:00
Ondřej Surý 718e92c31a Clear the callbacks when isc_nm_stoplistening() is called
When we are closing the listening sockets, there's a time window in
which the TCP connection could be accepted although the respective
stoplistening function has already returned to control to the caller.
Clear the accept callback function early, so it doesn't get called when
we are not interested in the incoming connections anymore.
2022-08-26 09:09:25 +02:00
Ondřej Surý 4d07768a09 Remove the isc_app API
The isc_app API is no longer used and has been removed.
2022-08-26 09:09:25 +02:00
Ondřej Surý 37a1be5acc Split netmgr_test into separate per-transport unit tests
The netmgr_test unit test has been subdivided into tcp_test,
tcpdns_test, tls_test, tlsdns_test, and udp_test components.
These have been updated to use the new loopmgr.
2022-08-26 09:09:25 +02:00
Ondřej Surý b69e783164 Update netmgr, tasks, and applications to use isc_loopmgr
Previously:

* applications were using isc_app as the base unit for running the
  application and signal handling.

* networking was handled in the netmgr layer, which would start a
  number of threads, each with a uv_loop event loop.

* task/event handling was done in the isc_task unit, which used
  netmgr event loops to run the isc_event calls.

In this refactoring:

* the network manager now uses isc_loop instead of maintaining its
  own worker threads and event loops.

* the taskmgr that manages isc_task instances now also uses isc_loopmgr,
  and every isc_task runs on a specific isc_loop bound to the specific
  thread.

* applications have been updated as necessary to use the new API.

* new ISC_LOOP_TEST macros have been added to enable unit tests to
  run isc_loop event loops. unit tests have been updated to use this
  where needed.
2022-08-26 09:09:24 +02:00
Ondřej Surý 49b149f5fd Update isc_timer to use isc_loopmgr
* isc_timer was rewritten using the uv_timer, and isc_timermgr_t was
  completely removed; isc_timer objects are now directly created on the
  isc_loop event loops.

* the isc_timer API has been simplified. the "inactive" timer type has
  been removed; timers are now stopped by calling isc_timer_stop()
  instead of resetting to inactive.

* isc_manager now creates a loop manager rather than a timer manager.

* modules and applications using isc_timer have been updated to use the
  new API.
2022-08-25 17:17:07 +02:00
Ondřej Surý 84c90e223f New event loop handling API
This commit introduces new APIs for applications and signal handling,
intended to replace isc_app for applications built on top of libisc.

* isc_app will be replaced with isc_loopmgr, which handles the
  starting and stopping of applications. In isc_loopmgr, the main
  thread is not blocked, but is part of the working thread set.
  The loop manager will start a number of threads, each with a
  uv_loop event loop running. Setup and teardown functions can be
  assigned which will run when the loop starts and stops, and
  jobs can be scheduled to run in the meantime. When
  isc_loopmgr_shutdown() is run from any the loops, all loops
  will shut down and the application can terminate.

* signal handling will now be handled with a separate isc_signal unit.
  isc_loopmgr only handles SIGTERM and SIGINT for application
  termination, but the application may install additional signal
  handlers, such as SIGHUP as a signal to reload configuration.

* new job running primitives, isc_job and isc_async, have been added.
  Both units schedule callbacks (specifying a callback function and
  argument) on an event loop. The difference is that isc_job unit is
  unlocked and not thread-safe, so it can be used to efficiently
  run jobs in the same thread, while isc_async is thread-safe and
  uses locking, so it can be used to pass jobs from one thread to
  another.

* isc_tid will be used to track the thread ID in isc_loop worker
  threads.

* unit tests have been added for the new APIs.
2022-08-25 12:24:29 +02:00
Ondřej Surý a26862e653 Simplify the isc_event API
The ev_tag field was never used, and has now been removed.
2022-08-25 12:24:25 +02:00
Mark Andrews 87a6dac92e Merge branch '3505-missing-isc_mutex_destroy' into 'main'
Resolve "missing isc_mutex_destroy"

Closes #3505

See merge request isc-projects/bind9!6696
2022-08-24 07:00:17 +00:00
Mark Andrews 9b7af9d85c Call isc_mutex_destroy(&lasttime_mx); 2022-08-24 16:41:55 +10:00
Matthijs Mekking 29ae5e82ff Merge branch '3500-nsec3-missing-detach-node' into 'main'
nsec3.c: Add a missing dns_db_detachnode() call

Closes #3500

See merge request isc-projects/bind9!6692
2022-08-23 10:03:28 +00:00
Matthijs Mekking a98f993da8 Add CHANGES entry for #3500
There is no need for a release because this case was nearly impossible
to trigger (except for when 'sig-signing-type' was set to 0).
2022-08-23 11:04:00 +02:00
Matthijs Mekking e633398010 nsec3.c: Add a missing dns_db_detachnode() call
There is one case in 'dns_nsec3_activex()' where it returns but forgets
to detach the db node. Add the missing 'dns_db_detachnode()' call.

This case only triggers if 'sig-signing-type' (privatetype) is set to 0
(which by default is not), or if the function is called with 'complete'
is set to 'true' (which at this moment do not exist).
2022-08-23 11:01:31 +02:00
Matthijs Mekking ae14334083 Merge branch '3486-checkconf-dnssec-policy-nsec3-incompatible-algorithm' into 'main'
Graceful dnssec-policy transition from NSEC only to NSEC3

Closes #3486

See merge request isc-projects/bind9!6647
2022-08-22 14:37:07 +00:00
Matthijs Mekking 1c5bbac508 Fix nsec3 system test issues
The wait_for_zone_is_signed function was never called, which could lead
to test failures due to timing issues (where a zone was not fully signed
yet, but the test was trying to verify the zone).

Also add two missing set_nsec3param calls to ensure the ITERATIONS
value is set for these test cases.
2022-08-22 16:36:17 +02:00
Matthijs Mekking 4f2a15b52a Add change entry and release note for #3486
News worthy.
2022-08-22 15:55:47 +02:00
Matthijs Mekking 6e534c1cd1 Add test case for #3486
Add two scenarios where we change the dnssec-policy from using RSASHA1
to something with NSEC3.

The first case should work, as the DS is still in hidden state and we
can basically do anything with DNSSEC.

The second case should fail, because the DS of the predecessor is
published and we can't immediately remove the predecessor DNSKEY. So
in this case we should keep the NSEC chain for a bit longer.

Add two more scenarios where we change the dnssec-policy from using
NSEC3 to something NSEC only. Both should work because there are no
restrictions on using NSEC when it comes to algorithms, but in the
cases where the DS is published we can't bluntly remove the predecessor.

Extend the nsec3 system test by also checking the DNSKEY RRset for the
expected DNSKEY records. This requires some "kasp system"-style setup
for each test (setting key properties and key states). Also move the
dnssec-verify check inside the check_nsec/check_nsec3 functions because
we will have to do that every time.
2022-08-22 15:55:47 +02:00
Matthijs Mekking 501dc87d75 Wait with NSEC3 during a DNSSEC policy change
When doing a dnssec-policy reconfiguration from a zone with NSEC only
keys to a zone that uses NSEC3, figure out to wait with building the
NSEC3 chain.

Previously, BIND 9 would attempt to sign such a zone, but failed to
do so because the NSEC3 chain conflicted with existing DNSKEY records
in the zone that were not compatible with NSEC3.

There exists logic for detecting such a case in the functions
dnskey_sane() (in lib/dns/zone.c) and check_dnssec() (in
lib/ns/update.c). Both functions look very similar so refactor them
to use the same code and call the new function (called
dns_zone_check_dnskey_nsec3()).

Also update the dns_nsec_nseconly() function to take an additional
parameter 'diff' that, if provided, will be checked whether an
offending NSEC only DNSKEY will be deleted from the zone. If so,
this key will not be considered when checking the zone for NSEC only
DNSKEYs. This is needed to allow a transition from an NSEC zone with
NSEC only DNSKEYs to an NSEC3 zone.
2022-08-22 15:55:46 +02:00
Matthijs Mekking 856c0e78a9 Test checkconf NSEC3 and incompatible algorithm
The check code for this already exists, but was untested.
2022-08-19 17:00:10 +02:00
Arаm Sаrgsyаn a308418d4a Merge branch '3463-httpd.c-non-empty-post-requests-bugfix' into 'main'
Fix statistics channel multiple request processing with non-empty HTTP bodies

Closes #3463

See merge request isc-projects/bind9!6597
2022-08-19 08:32:41 +00:00
Aram Sargsyan dc9b0ea6a6 Add pipelined POST requests check in the statschannel system test
Use `nc` to check that multiple POST requests with non-empty HTTP
body are serviced normally by the statistics channel.
2022-08-19 08:11:44 +00:00
Aram Sargsyan 3e28d364f6 Replace expr commands with $((expression)) shell constucts
Update the "statschannel" system test to use the $((expression))
shell constucts instead of executing the `expr` program.
2022-08-19 08:11:44 +00:00
Aram Sargsyan 9885306d9a Add CHANGES not for [GL #3463] 2022-08-19 08:11:42 +00:00
Aram Sargsyan 8c4cdd9b21 Fix statistics channel multiple request processing with non-empty bodies
When the HTTP request has a body part after the HTTP headers, it is
not getting processed and is being prepended to the next request's data,
which results in an error when trying to parse it.

Improve the httpd.c:process_request() function with the following
additions:

1. Require that HTTP POST requests must have Content-Length header.
2. When Content-Length header is set, extract its value, and make sure
   that it is valid and that the whole request's body is received before
   processing the request.
3. Discard the request's body by consuming Content-Length worth of data
   in the buffer.
2022-08-19 08:10:54 +00:00
Aram Sargsyan 86b8e62106 Enhance the have_header() function to find the HTTP header's value
Add a new `const char **fvalue` parameter to the httpd.c:have_header()
function which, when set, will point to the found header's value.
2022-08-19 08:10:54 +00:00
Mark Andrews 1c19a6aae8 Merge branch 'bug/main/delv-cfg_parser_reset' into 'main'
Reset bind.keys parser after error on file

See merge request isc-projects/bind9!6468
2022-08-19 05:15:14 +00:00
Mark Andrews dc8fcbf013 Add CHANGES entry for [GL !6468] 2022-08-19 14:55:26 +10:00
Petr MenšíkandMark Andrews 65d7427b17 Reset parser before parsing of internal trust anchor
It might be reused if /etc/bind.keys exists, but failed correct parsing.
Release traces of previous parsing attempt of different data.
2022-08-19 14:36:47 +10:00
Mark Andrews 866664d79c Merge branch '3499-duration-c-66-6-warning-array-subscript-is-of-type-char-on-netbsd-9' into 'main'
Resolve "duration.c:66:6: warning: array subscript is of type 'char' on NetBSD 9"

Closes #3499

See merge request isc-projects/bind9!6685
2022-08-19 02:28:45 +00:00
Mark Andrews ea13820023 Silence negative array index warning with toupper
Cast to (unsigned char).
2022-08-19 11:16:00 +10:00
Michal Nowak ee72d4f2f0 Merge branch 'mnowak/freebsd-13.1' into 'main'
Add FreeBSD 13.1

See merge request isc-projects/bind9!6656
2022-08-18 15:28:21 +00:00
Michal Nowak cfee4ce4f6 Add FreeBSD 13.1 2022-08-18 17:11:14 +02:00
Artem Boldariev 0c8dee7ec3 Merge branch 'artem-dig-http-plain-get-post-support-fix' into 'main'
DIG: fix handling of +http-plain-get and +http-plain-post options

See merge request isc-projects/bind9!6672
2022-08-18 11:22:25 +00:00
Artem Boldariev 26a66d095c Modify CHANGES (+http-plain-{get, post} support fix in dig)
This commit modifies the CHANGES file to mention that +http-plain-get
and +http-plain-post options support in dig was fixed.
2022-08-18 13:43:00 +03:00
Artem Boldariev 0c6b1f8e8f Modify the doth system test to verify HTTP method usage
Before the commit some checks in the system test would try to verify
that different HTTP methods can be used and are functional. However,
until recently, it was not possible to tell from the output which
method was in fact used, so it turned out that +http-plain-get option
is broken.

This commit add the additional checks to prevent that from happening
in the future.
2022-08-18 13:34:22 +03:00
Artem Boldariev bd29705a9f DIG: mark HTTP GET method in output
This commit makes dig mark the usage of HTTP(S) GET protocol usage in
its output.
2022-08-18 13:34:22 +03:00
Artem Boldariev b2f2fed65b DIG: fix handling of +http-plain-{get, post} options
Support for parsing +http-plain-get and +http-plain-post options was
broken. This commit fixes that.
2022-08-18 13:34:21 +03:00
Michal Nowak ffcee7c5b7 Merge tag 'v9_19_4'
BIND 9.19.4
2022-08-18 11:29:56 +02:00
Arаm Sаrgsyаn 7b7a052378 Merge branch '3491-placeholder' into 'main'
Add placeholder for [GL #3491]

See merge request isc-projects/bind9!6679
2022-08-18 09:12:34 +00:00
Aram Sargsyan 809dd3298c Add placeholder for [GL #3491] 2022-08-18 09:07:52 +00:00
Mark Andrews c64fe6e3ae Merge branch '3494-dnssec-awk-test-is-not-precise-enough' into 'main'
Resolve "DNSSEC awk test is not precise enough"

Closes #3494

See merge request isc-projects/bind9!6668
2022-08-18 03:41:17 +00:00
Mark Andrews 8fe2876297 Improve awk tests to prevent false negatives
The old code could incorrectly match "INSOA" in the RRSIG rdata
when looking for the SOA record.
2022-08-18 02:56:57 +00:00
Michal Nowak 786552e890 Merge branch 'mnowak/coverity-scan-2022.06' into 'main'
Use Coverity Scan 2022.06

See merge request isc-projects/bind9!6670
2022-08-17 13:55:20 +00:00
Michal Nowak fd74334bc0 Use Coverity Scan 2022.06 2022-08-17 10:34:14 +02:00
Michal Nowak bac62ab62a Merge branch 'mnowak/openbsd-7.1' into 'main'
Add OpenBSD 7.1

See merge request isc-projects/bind9!6663
2022-08-16 15:01:20 +00:00
Michal Nowak 593bed4ed0 Add OpenBSD 7.1 2022-08-16 16:30:00 +02:00
Arаm Sаrgsyаn 924be16b88 Merge branch '3489-cid-355779-dynbuf-cannot-be-null' into 'main'
Fix CID 355779: dynbuf cannot be NULL

Closes #3489

See merge request isc-projects/bind9!6652
2022-08-16 08:15:35 +00:00
Aram Sargsyan 2e01162258 Refactor tkey.c:buildquery() error handling
After an earlier code cleanup, `dns_rdatalist_tordataset()` always
succeeds, so the `RETERR` error handling macro below the function
call was removed. After that change the `dynbuf` variable can never
be `NULL` in the error handling code path under the `failure` label.

    *** CID 355779:  Null pointer dereferences  (REVERSE_INULL)
    /lib/dns/tkey.c: 997 in buildquery()
    991                 dns_message_puttempname(msg, &aname);
    992         }
    993         if (question != NULL) {
    994                 dns_rdataset_disassociate(question);
    995                 dns_message_puttemprdataset(msg, &question);
    996         }
    >>>     CID 355779:  Null pointer dereferences  (REVERSE_INULL)
    >>>     Null-checking "dynbuf" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
    997         if (dynbuf != NULL) {
    998                 isc_buffer_free(&dynbuf);
    999         }
    1000        return (result);
    1001     }
    1002

Refactor the `buildquery()` function to simplify its error handling.
2022-08-16 07:36:12 +00:00
Arаm Sаrgsyаn 5604d942fb Merge branch '3492-fix-tkey.c-buildquery-cleanup' into 'main'
Fix tkey.c:buildquery() function's error handling

Closes #3492

See merge request isc-projects/bind9!6661
2022-08-16 07:15:09 +00:00
Aram Sargsyan 144fcc387a Add CHANGES note for [GL #3492] 2022-08-15 11:45:18 +00:00
Aram Sargsyan d38931f397 Fix tkey.c:buildquery() function's error handling
Add the missing cleanup code.
2022-08-15 11:44:53 +00:00
Matthijs Mekking cf7efbb3dd Merge branch '3381-dnssec-policy-explicit-inline-signing' into 'main'
dnssec-policy now requires inline-signing

Closes #3385

See merge request isc-projects/bind9!6403
2022-08-15 10:20:49 +00:00
Matthijs Mekking fece593403 Add change and release note for #3381
Because folks want to know.
2022-08-15 11:44:20 +02:00
Matthijs Mekking d447b1b58c Remove implicit inline-signing code
Remove the code that sets implicit inline-signing on zones using
dnssec-policy.
2022-08-15 11:44:20 +02:00
Matthijs Mekking d62439e2ec Update system tests
Update checkconf and kasp related system tests after requiring
inline-signing.
2022-08-15 11:44:20 +02:00
Matthijs Mekking fa1d24c03a dnssec-policy now requires inline-signing
Having implicit inline-signing set for dnssec-policy when there is no
update policy is confusing, so lets make this explicit.
2022-08-15 10:05:39 +02:00
Mark Andrews 505d8fa1ee Merge branch 'marka-placeholder' into 'main'
Add placeholders for [GL #3487]

See merge request isc-projects/bind9!6659
2022-08-15 00:30:47 +00:00
Mark Andrews 4906beef98 Add placeholders for [GL #3487] 2022-08-15 10:26:27 +10:00
Evan Hunt 1f8cba67e3 Merge branch '3488-prevent-adb-dump-race' into 'main'
Lock the address entry bucket when dumping ADB namehook

Closes #3488, #3424, and #3425

See merge request isc-projects/bind9!6655
2022-08-12 22:20:01 +00:00
Evan Hunt e79be4bd8a Lock the address entry bucket when dumping ADB namehook
When dumping an ADB address entry associated with a name,
the name bucket lock was held, but the entry bucket lock was
not; this could cause data races when other threads were updating
address entry info. (These races are probably not operationally
harmful, but they triggered TSAN error reports.)
2022-08-12 14:47:50 -07:00
Michal Nowak 86c0241376 Merge branch '3348-move-pkcs11-interface-test-to-debian' into 'main'
Move OpenSSL-based PKCS#11 interface job to Debian "bullseye"

Closes #3348

See merge request isc-projects/bind9!6322
2022-08-11 18:31:02 +00:00
Michal Nowak ab6a3f9868 Move OpenSSL-based PKCS#11 interface job to Debian "bullseye"
Fedora 36 uses OpenSSL 3.0.2 by default, but the OpenSSL engine API
which we use for PKCS#11 is deprecated in OpenSSL 3.0.0. For the
keyfromlabel system test to work operating system with OpenSSL 1.1 needs
to be used.
2022-08-11 18:07:39 +02:00
Michal Nowak 9aa40a735e Merge branch '3458-reintroduce-without-cmocka-and-without-gssapi' into 'main'
Configure Ubuntu 18.04 "bionic" without cmocka and GSS-API

Closes #3458

See merge request isc-projects/bind9!6631
2022-08-11 15:56:50 +00:00
Michal Nowak c0d997e5c4 Configure Ubuntu 18.04 "bionic" without cmocka and GSS-API
--without-cmocka and --without-gssapi ./configure options have been lost
when Debian 9 "stretch" was dropped from the CI. This reintroduces them,
albeit to a slightly different platform.
2022-08-11 14:38:11 +02:00
Michal Nowak c3777ac51c Merge branch 'mnowak/fix-mkeys-to-work-with-DEFAULT_ALGORITHM-properly' into 'main'
Fix mkeys to work with DEFAULT_ALGORITHM properly

See merge request isc-projects/bind9!6646
2022-08-10 12:05:50 +00:00
Mark AndrewsandMichal Nowak 286061fc54 Fix mkeys to work with DEFAULT_ALGORITHM properly
Stop using a RSASHA1 fixed key in ns3's named.conf as the
trusted key and instead compute a broken digest from the
real digest to use in trusted-keys.
2022-08-10 12:46:06 +02:00
Evan Hunt 46f095a42a Merge branch '3483-memstat-assertion' into 'main'
fix overflow error in mem_putstats()

Closes #3483

See merge request isc-projects/bind9!6641
2022-08-09 18:20:11 +00:00
Evan Hunt 9d9bd3ace2 fix overflow error in mem_putstats()
an integer overflow could cause an assertion failure when
freeing memory.
2022-08-09 10:59:43 -07:00
Michal Nowak 870d01ce29 Merge branch 'mnowak/add-oracle-linux-9' into 'main'
Add Oracle Linux 9

See merge request isc-projects/bind9!6581
2022-08-09 14:43:29 +00:00
Mark AndrewsandMichal Nowak 5830aa9dc6 kasp: stop using RSASHA1 unless necessary for the test
Moves tests from being RSASHA1 based to RSASHA256 based where possible
and split out the remaining RSASHA1 based tests so that they are not
run on OS's that don't support RSASHA1.
2022-08-09 16:22:19 +02:00
Mark AndrewsandMichal Nowak 4fd6d09330 keymgr2kasp: use FIPS compliant algorithms and key sizes
migrate-nomatch-alglen: switched to RSASHA256 instead of RSASHA1
and the key size now changes from 2048 bits to 3072 bits instead
of 1024 bits to 2048 bits.

migrate-nomatch-algnum: switched to RSASHA256 instead of RSASHA1
as initial algorithm and adjusted mininum key size to 2048 bits.

rsasha256: adjusted minimum key size to 2048 bits.
2022-08-09 16:22:19 +02:00
Mark AndrewsandMichal Nowak 591c087cbf dnssec/signer/general: Replace RSASHA1 keys with RSASHA512 keys
RSASHA1 is verify only in FIPS mode. Use RSASHA256 instead.
2022-08-09 16:22:19 +02:00
Mark AndrewsandMichal Nowak c468e9e466 Check if RSASHA1 is supported by the OS 2022-08-09 16:22:19 +02:00
Mark AndrewsandMichal Nowak 19dda1fb93 autosign: use FIPS compatible algorithms and key sizes
The nsec-only.example zone was not converted as we use it to
test nsec-only DNSSEC algorithms to nsec3 conversion failure.
The subtest is skipped in fips mode.

Update "checking revoked key with duplicate key ID" test
to use FIPS compatible algorithm.
2022-08-09 16:22:19 +02:00
Mark AndrewsandMichal Nowak a2597319b0 rsabigexponent: convert the test from RSASHA1 to RSASHA256
RSASHA1 is not supported on some platforms.
2022-08-09 16:22:19 +02:00
Michal Nowak 3c9fcc8327 Add Oracle Linux 9 2022-08-09 16:22:18 +02:00
Mark AndrewsandMichal Nowak 7c9d4e99d4 notify: remove duplicate test number 2022-08-09 15:45:12 +02:00
Mark AndrewsandMichal Nowak 3e9a2c8a7f mkeys: use $() instead of back quotes 2022-08-09 15:45:11 +02:00
Arаm Sаrgsyаn a59eda3fe7 Merge branch '3467-dns_rdatalist_tordataset-can-not-fail' into 'main'
dns_rdatalist_tordataset() and dns_rdatalist_fromrdataset() can not fail

Closes #3467

See merge request isc-projects/bind9!6622
2022-08-09 11:51:07 +00:00
Aram Sargsyan 7539b70fc6 Add CHANGES note for [GL #3467] 2022-08-09 08:21:10 +00:00
Aram Sargsyan ccde7313b8 Update "dns" unit test's test data .gitignore file
Add master18.data to .gitignore.
2022-08-09 08:19:51 +00:00
Aram Sargsyan c51b052827 dns_rdatalist_tordataset() and dns_rdatalist_fromrdataset() can not fail
Clean up dns_rdatalist_tordataset() and dns_rdatalist_fromrdataset()
functions by making them return void, because they cannot fail.

Clean up other functions that subsequently cannot fail.
2022-08-09 08:19:51 +00:00
Matthijs Mekking c537c3e838 Merge branch '2982-servfail-servestale-duplicate-queries' into 'main'
Don't enable serve-stale on duplicate queries

Closes #2982

See merge request isc-projects/bind9!6628
2022-08-09 07:33:07 +00:00
Matthijs Mekking d6ea003990 Add release note and change entry for #2982
News worthy.
2022-08-09 09:14:53 +02:00
Matthijs Mekking c5b71e2472 Don't enable serve-stale on duplicate queries
When checking if we should enable serve-stale, add an early out case
when the result is an error signalling a duplicate query or a query
that would be dropped.
2022-08-09 09:13:53 +02:00
Arаm Sаrgsyаn 82a71a1601 Merge branch '3478-dig-lookup-reference-counting-bug' into 'main'
DiG: fix lookup reference counting bug

Closes #3478

See merge request isc-projects/bind9!6635
2022-08-08 11:42:53 +00:00
Aram Sargsyan bc5e472484 Add CHANGES note for [GL #3478] 2022-08-08 10:47:44 +00:00
Aram Sargsyan d7e5c23a81 DiG: fix lookup reference counting bug
When DiG finishes its work with a lookup (due to success or error), it
calls the clear_current_lookup() function, which decreases the lookup's
reference count. That decrease action is the counterpart of the initial
creation of the reference counter, so this function was designed in such
a way that it should decrease the reference count only once, when there
are no more active queries in the lookup.

The way it checks whether there are any active queries is by looking
at the queries list of the lookup object - if it's NULL then there are
no active queries. But that is not always true - the cancel_lookup()
function, when canceling the queries one by one, also removes them
from the lookup's list, but in NSSEARCH mode, when the queries are
working in parallel, some of those queries can be still active. And
when their recv_done() callback gets called, it sees that the lookup
has been canceled, calls clear_current_lookup(), which decreases the
reference count every time for each query that was still active
(because ISC_LIST_HEAD(lookup->q) is NULL) and results in a reference
counting error.

Fix the issue by introducing a new "cleared" property for the lookup,
which will ensure that the clear_current_lookup() function does its
job only once per lookup.
2022-08-08 10:47:44 +00:00
Matthijs Mekking cd4a536a69 Merge branch '3479-mysql-is-not-ldap' into 'main'
Fix mysql bindings

Closes #3479

See merge request isc-projects/bind9!6636
2022-08-08 07:45:23 +00:00
Matthijs Mekking b47e41db74 Fix mysql bindings
There was a copy paste error in the Makefile of the mysql dlz modules,
instead of setting the MYSQL_LIBS, LDAP_LIBS where set. This caused
the mysql bindings not to be generated.
2022-08-05 11:43:00 +02:00
Michał Kępień 672972bb56 Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.5' into 'main'
Set up version and release notes for BIND 9.19.5

See merge request isc-projects/bind9!6632
2022-08-05 06:40:34 +00:00
Michał Kępień 255629769e Set up release notes for BIND 9.19.5 2022-08-05 06:56:30 +02:00
Michał Kępień 0841080ce4 Update BIND version to 9.19.5-dev 2022-08-05 06:56:30 +02:00
Michał Kępień 63279dc661 Update BIND version for release 2022-08-04 23:29:55 +02:00
Michał Kępień 53c43541aa Add a CHANGES marker 2022-08-04 23:29:55 +02:00
Michał Kępień 72a979cd8d Merge branch 'michal/prepare-documentation-for-bind-9.19.4' into 'v9_19_4-release'
Prepare documentation for BIND 9.19.4

See merge request isc-private/bind9!418
2022-08-04 21:28:46 +00:00
Michał Kępień 7e7007a6c4 Tweak and reword release notes 2022-08-04 23:13:22 +02:00
Michał Kępień 4b0ac154a0 Prepare release notes for BIND 9.19.4 2022-08-04 23:13:22 +02:00
Michał Kępień cbb662607c Fix option name in the release note for GL #3140 2022-08-04 23:13:22 +02:00
Artem Boldariev 7126ed59db Merge branch 'tls-fix-readpaused-usage' into 'main'
TLS: do not ignore readpaused flag in certain circumstances

See merge request isc-projects/bind9!6627
2022-08-02 14:26:14 +00:00
Artem Boldariev 32565d0d65 TLS: do not ignore readpaused flag in certain circumstances
In some circumstances generic TLS code could have resumed data reading
unexpectedly on the TCP layer code. Due to this, the behaviour of
isc_nm_pauseread() and isc_nm_resumeread() might have been
unexpected. This commit fixes that.

The bug does not seems to have real consequences in the existing code
due to the way the code is used. However, the bug could have lead to
unexpected behaviour and, at any rate, makes the TLS code behave
differently from the TCP code, with which it attempts to be as
compatible as possible.
2022-08-02 14:02:01 +03:00
Arаm Sаrgsyаn b2395f5644 Merge branch 'aram/fetches-per-zone-improve-log-message' into 'main'
Differentiate between initial and cumulative fetch limit logging

See merge request isc-projects/bind9!6607
2022-08-01 15:21:10 +00:00
Aram Sargsyan 1690af761b Differentiate between initial and cumulative fetch limit logging
Cumulative fetch limit logging happens on an event of a dropped
fetch if 60 seconds have been passed since the previous log message.
This change makes the log message different for the initial event
and for the later cumulative events to provide more useful information
to the system administrator.
2022-08-01 14:42:27 +00:00
Arаm Sаrgsyаn 1f306f9a8a Merge branch '3461-fetches-per-zone-final-log-message' into 'main'
Resolve "Do a better job of logging when fetches-per-zone is triggered"

Closes #3461

See merge request isc-projects/bind9!6595
2022-08-01 14:33:42 +00:00
Aram Sargsyan 50d57a7551 Add CHANGES and release notes for [GL #3461] 2022-08-01 13:49:46 +00:00
Aram Sargsyan 8cfacc6fe1 Improve fetch limit logging
When initially hitting the `fetches-per-zone` value, a log message
is being generated for the event of dropping the first fetch, then
any further log events occur only when another fetch is being dropped
and 60 seconds have been passed since the last logged message.

That logic isn't ideal because when the counter of the outstanding
fetches reaches zero, the structure holding the counters' values will
get deleted, and the information about the dropped fetches accumulated
during the last minute will not be logged.

Improve the fcount_logspill() function to makie sure that the final
values are getting logged before the counter object gets destroyed.
2022-08-01 13:46:41 +00:00
Petr Špaček 0f6a6b9a70 Merge branch 'ron-tags-3' into 'main'
Add tags and short descriptions to all configuration statements

See merge request isc-projects/bind9!6592
2022-07-29 17:00:19 +00:00
Petr Špaček 9b3710987b Add last missing tags, finishing touches 2022-07-29 18:56:04 +02:00
Suzanne GoldlustandPetr Špaček f9a5f389ed Add descriptions of each tag 2022-07-29 18:56:04 +02:00
Suzanne GoldlustandPetr Špaček 20d01ca2e3 Text edits to Statements and Statements by Tag sections 2022-07-29 18:56:04 +02:00
Suzanne GoldlustandPetr Špaček e14201a2f6 Reorder Statements and Statements by Tag sections 2022-07-29 18:56:04 +02:00
Suzanne GoldlustandPetr Špaček fc272863c6 Rephrase parental-agents description 2022-07-29 18:56:04 +02:00
Suzanne GoldlustandPetr Špaček 7dcdeba117 Add short description for plugin statement 2022-07-29 18:56:04 +02:00
Suzanne GoldlustandPetr Špaček 75ab5f81a4 Add tag and short description for dyndb statement 2022-07-29 18:56:04 +02:00
Suzanne GoldlustandPetr Špaček a8294e7af4 Add tags and short descriptions for dlz and search statements 2022-07-29 18:56:04 +02:00
Suzanne GoldlustandPetr Špaček 017008c407 Add tag and short description for catalog-zones statement 2022-07-29 18:56:04 +02:00
Suzanne GoldlustandPetr Špaček a470a6545f Add short descriptions and some tags to statements through line 1766 2022-07-29 18:56:00 +02:00
Arаm Sаrgsyаn ac97d8de98 Merge branch '3471-dig-add-qid-into-usage-summary' into 'main'
DiG: document +qid=<num> option in the usage summary

Closes #3471

See merge request isc-projects/bind9!6618
2022-07-28 10:16:24 +00:00
Aram Sargsyan 244bf0b3e4 DiG: document +qid=<num> option in the usage summary
The +qid=<num> option, which sets the outgoing query ID, was missing
from the usage summary printed using `dig -h` command.
2022-07-28 09:08:13 +00:00
Mark Andrews 3b4b974df8 Merge branch 'marka-set-suffix-in-ans.py' into 'main'
Ensure suffix is always valid in bin/tests/system/qmin/ans4/ans.py (CID 350722)

See merge request isc-projects/bind9!6593
2022-07-27 16:24:02 +00:00
Mark Andrews 8a15577334 Ensure suffix is always valid in bin/tests/system/qmin/ans4/ans.py
initalise suffix to ""

    170        r.answer.append(
    171            dns.rrset.from_text(
    172                lqname + suffix, 1, IN, NS, "a.bit.longer.ns.name." + suffix
    173            )
    174        )
    175        r.flags |= dns.flags.AA
           15. Condition endswith(lqname, "icky.ptang.zoop.boing."), taking true branch.
    176    elif endswith(lqname, "icky.ptang.zoop.boing."):
           CID 350722 (#7 of 7): Bad use of null-like value (FORWARD_NULL)
           16. invalid_operation: Invalid operation on null-like value suffix.
    177        r.authority.append(
    178            dns.rrset.from_text(
    179                "icky.ptang.zoop.boing." + suffix,
    180                1,
    181                IN,
    182                SOA,
    183                "ns2." + suffix + " hostmaster.arpa. 2018050100 1 1 1 1",
    184            )
    185        )
2022-07-27 15:55:25 +00:00
Artem Boldariev a8679ccd51 Merge branch 'artem-tls-streamdns-fixes-part2' into 'main'
TLS-related fixes from Stream DNS and Loop Manager branches

See merge request isc-projects/bind9!6616
2022-07-26 12:08:48 +00:00
Artem Boldariev c52c691b18 TLS: fix double resumption in isc__nm_tls_resumeread()
This commit fixes an obvious error in isc__nm_tls_resumeread() so that
read cannot be resumed twice.
2022-07-26 14:25:59 +03:00
Artem Boldariev 5d450cd0ba TLS: clear 'errno' when handling SSL status
Sometimes tls_do_bio() might be called when there is no new data to
process (most notably, when resuming reads), in such a case internal
TLS session state will remain untouched and old value in 'errno' will
alter the result of SSL_get_error() call, possibly making it to return
SSL_ERROR_SYSCALL. This value will be treated as an error, and will
lead to closing the connection, which is not what expected.
2022-07-26 14:25:59 +03:00
Mark Andrews 6f15cace5e Merge branch '3469-auto-disable-rsasha1-and-nsec3rsasha1-when-not-supported-by-the-os' into 'main'
Resolve "Auto disable RSASHA1 and NSEC3RSASHA1 when not supported by the OS"

Closes #3469

See merge request isc-projects/bind9!6606
2022-07-25 14:57:48 +00:00
Mark Andrews 0d31135ca2 Add release note for [GL #3469] 2022-07-25 10:32:48 -04:00
Mark Andrews 5bbbecc88a CHANGES note for [GL #3469] 2022-07-25 10:32:47 -04:00
Mark Andrews edfbe5c30f Check that we can verify a signature at initialisation time
Fedora 33 doesn't support RSASHA1 in future mode.  There is no easy
check for this other than by attempting to perform a verification
using known good signatures.  We don't attempt to sign with RSASHA1
as that would not work in FIPS mode.  RSASHA1 is verify only.

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

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

Closes #3462

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

Closes #3419

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

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

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

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

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

Closes #3407

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Closes #2918

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

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

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

See merge request isc-projects/bind9!6535
2022-07-18 16:26:16 +00:00
Greg ChoulesandPetr Špaček 4d21939e99 Document qname-minimization off equals disabled 2022-07-18 18:22:01 +02:00
Suzanne GoldlustandPetr Špaček bb2bce539f Fix http block short description 2022-07-18 18:21:42 +02:00
Suzanne GoldlustandPetr Špaček 762359788b Add headings for server, logging, zone, and view statements 2022-07-18 18:16:33 +02:00
Suzanne GoldlustandPetr Špaček 7c5a0ec540 Add tags/short descriptions for the "view" category 2022-07-18 18:16:33 +02:00
Suzanne GoldlustandPetr Špaček cc2e144371 Add tags/short descriptions for "zone" category 2022-07-18 18:16:33 +02:00
Suzanne GoldlustandPetr Špaček 51a41ec7ef Add tags/short descriptions for "logging" category 2022-07-18 18:10:44 +02:00
Suzanne GoldlustandPetr Špaček 3ab858d828 Add tags and short descriptions for tag "server" 2022-07-18 18:10:44 +02:00
Michał Kępień b2c0b56d64 Merge branch 'michal/run-a-short-respdiff-test-for-all-merge-requests' into 'main'
Run a short respdiff test for all merge requests

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

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

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

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

However, this was fixed in OpenSSL 0.9.7h:
https://github.com/openssl/openssl/commit/6ec8e63af6c1835a8b222350dbabf7bb2ace094f

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

That seems to be referring to this OpenSSL change, which indeed fixed it
for RSA but not others:
https://github.com/openssl/openssl/commit/bb617a9646d95d0454edda995518f370172390e9

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

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

Closes #3453

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

Closes #3443

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

Make the style of the relevant paragraph more in line with the next one
and split its contents up into an unordered list of options for improved
readability.
2022-07-15 10:23:03 +02:00
Evan Hunt dde669f546 Merge branch '3456-dispatch-connect-race' into 'main'
remove unnecessary assertion in dns_dispatch_connect()

Closes #3456

See merge request isc-projects/bind9!6573
2022-07-15 02:26:41 +00:00
Evan Hunt e1c81f9b1b remove unnecessary assertion in dns_dispatch_connect()
When a thread calls dns_dispatch_connect() on an unconnected TCP socket
it sets `tcpstate` from `DNS_DISPATCHSTATE_NONE` to `_CONNECTING`.
Previously, it then INSISTed that there were no pending connections
before calling isc_nm_tcpdnsconnect().

If a second thread called dns_dispatch_connect() during that window
of time, it could add a pending connection to the list, and trigger
an assertion failure.

This commit removes the INSIST since the condition is actually
harmless.
2022-07-14 16:31:01 -07:00
Ondřej Surý 84c353b5cf Merge branch 'ondrej-fix-timing-error-in-statistics-system-test' into 'main'
Wait for TCP connection refused in the statistics system test

See merge request isc-projects/bind9!6580
2022-07-14 20:33:16 +00:00
Ondřej SurýandEvan Hunt d1433da524 Wait for TCP connection refused in the statistics system test
The statistics system test makes a query to foo.info to check for the
pending connections because the ans4 doesn't respond to the query.

This might or might not (depending on exact timing) increment the failed
TCP connection counter when the query is retried over TCP because ans4
doesn't listen on the TCP.

Wait for the 'connection refused' in the ns3 log file to be able to
count the exactly 1 failed TCP connection.
2022-07-14 13:08:29 -07:00
Ondřej Surý 6b15eb45df Merge branch '3451-handle-transient-TCP-connect-EADDRINUSE-on-BSDs' into 'main'
Handle the transient TCP connect() failures on FreeBSD

Closes #3451 and #3452

See merge request isc-projects/bind9!6562
2022-07-14 19:38:33 +00:00
Ondřej Surý 6e71fd2a88 Add CHANGES note for [GL #3451] 2022-07-14 14:34:53 +02:00
Ondřej Surý 3e10d3b45f Cleanup the STATID_CONNECT and STATID_CONNECTFAIL stat counters
The STATID_CONNECT and STATID_CONNECTFAIL statistics were used
incorrectly. The STATID_CONNECT was incremented twice (once in
the *_connect_direct() and once in the callback) and STATID_CONNECTFAIL
would not be incremented at all if the failure happened in the callback.

Closes: #3452
2022-07-14 14:34:53 +02:00
Ondřej Surý a280855f7b Handle the transient TCP connect() failures on FreeBSD
On FreeBSD (and perhaps other *BSD) systems, the TCP connect() call (via
uv_tcp_connect()) can fail with transient UV_EADDRINUSE error.  The UDP
code already handles this by trying three times (is a charm) before
giving up.  Add a code for the TCP, TCPDNS and TLSDNS layers to also try
three times before giving up by calling uv_tcp_connect() from the
callback two more time on UV_EADDRINUSE error.

Additionally, stop the timer only if we succeed or on hard error via
isc__nm_failed_connect_cb().
2022-07-14 14:20:10 +02:00
Mark Andrews 08af14a475 Merge branch '3448-redundant-assignment-of-clistenon-in-bin-named-server-c' into 'main'
Resolve "Redundant assignment of clistenon in bin/named/server.c"

Closes #3448

See merge request isc-projects/bind9!6560
2022-07-14 01:14:14 +00:00
Mark Andrews ee9ec0052e Remove redundant assignment of 'clistenon = NULL' 2022-07-14 00:24:37 +00:00
Evan Hunt 965279479e Merge branch '3454-check-putstr' into 'main'
check putstr return values

Closes #3454

See merge request isc-projects/bind9!6574
2022-07-14 00:23:17 +00:00
Evan HuntandMark Andrews 9372baac27 check putstr return values
The calls to putstr() in named_server_fetchlimit() were not checked
for failure.
2022-07-14 00:04:39 +00:00
Mark Andrews 132b62614b Merge branch '3447-lib-dns-tkey-c-free_namelist-should-be-disassociating-associated-rdatatsets' into 'main'
Resolve "lib/dns/tkey.c:free_namelist should be disassociating associated rdatatsets"

Closes #3447

See merge request isc-projects/bind9!6556
2022-07-14 00:03:38 +00:00
Mark Andrews b38a5d895f disassociate rdatasets when cleaning up
free_namelist could be passed names with associated rdatasets
when handling errors.  These need to be disassociated before
calling dns_message_puttemprdataset.
2022-07-13 23:43:39 +00:00
Mark Andrews f80b7e0006 Merge branch '3449-kasp-system-test-failed-to-log-some-zones-during-setup' into 'main'
Resolve "kasp system test failed to log some zones during setup"

Closes #3449

See merge request isc-projects/bind9!6561
2022-07-13 23:42:38 +00:00
Mark Andrews eb5e5edf82 kasp: add missing logging during setup
Some zones where not being logged when just DNSSEC keys where being
generated in system test setup phase.  Add logging for these zones.
2022-07-13 23:19:39 +00:00
Michał Kępień 204ead4c31 Merge branch '3054-3-improve-reporting-for-pthreads-errors' into 'main'
[3/3] Improve reporting for pthreads errors

Closes #3054

See merge request isc-projects/bind9!6572
2022-07-13 13:05:11 +00:00
Michał Kępień 34a804d956 Merge branch '3054-2-enable-tracking-pthreads-objects' into 'main'
[2/3] Enable tracking pthreads objects

See merge request isc-projects/bind9!6571
2022-07-13 13:03:59 +00:00
Michał Kępień 3ea3af37a4 Merge branch '3054-1-misc-pthreads-cleanups' into 'main'
[1/3] Miscellaneous pthreads cleanups

See merge request isc-projects/bind9!6570
2022-07-13 13:01:32 +00:00
Michał Kępień b67ff4728f Improve reporting for barrier errors
uv_barrier_init() errors are currently ignored.  Use UV_RUNTIME_CHECK()
to catch them and to improve error reporting for any uv_barrier_init()
run-time failures (by augmenting error messages with file/line
information and the error string corresponding to the value returned).
2022-07-13 13:19:32 +02:00
Michał Kępień 5bc7ce41b7 Detect pthreads object leaks during respdiff tests
Set the ISC_TRACK_PTHREADS_OBJECTS preprocessor macro when preparing a
build of BIND 9 for respdiff testing and pass the -m command-line option
to respdiff.sh in order to enable automatic identification of memory
leaks during respdiff tests.
2022-07-13 13:19:32 +02:00
Ondřej SurýandMichał Kępień deae974366 Directly cause assertion failure on pthreads primitives failure
Instead of returning error values from isc_rwlock_*(), isc_mutex_*(),
and isc_condition_*() macros/functions and subsequently carrying out
runtime assertion checks on the return values in the calling code,
trigger assertion failures directly in those macros/functions whenever
any pthread function returns an error, as there is no point in
continuing execution in such a case anyway.
2022-07-13 13:19:32 +02:00
Michał Kępień 7009f9d270 Improve reporting for read-write lock errors
Replace direct uses of implementation-specific rwlock functions in
lib/isc/include/isc/rwlock.h with preprocessor macros that use
ERRNO_CHECK(), in order to augment rwlock-related error messages with
file/line/caller information and the error string corresponding to
errno.  Adjust the implementation-specific functions for pthreads-based
rwlocks so that they return any errors encountered to the caller instead
of aborting execution immediately using RUNTIME_CHECK().

To keep code modifications simple, make the non-pthreads-based
implementation-specific rwlock functions always return 0; these
functions continue to handle errors using less verbose run-time
assertions as they do not set errno anyway.
2022-07-13 13:19:32 +02:00
Michał Kępień 77aead5ab6 Enable tracking of pthreads barriers
Some POSIX threads implementations (e.g. FreeBSD's libthr) allocate
memory on the heap when pthread_barrier_init() is called.  Every call to
that function must be accompanied by a corresponding call to
pthread_barrier_destroy() or else the memory allocated for the barrier
will leak.

jemalloc can be used for detecting memory allocations which are not
released by a process when it exits.  Unfortunately, since jemalloc is
also the system allocator on FreeBSD and a special (profiling-enabled)
build of jemalloc is required for memory leak detection, this method
cannot be used for detecting leaked memory allocated by libthr on a
stock FreeBSD installation.

However, libthr's behavior can be emulated on any platform by
implementing alternative versions of libisc functions for creating and
destroying barriers that allocate memory using malloc() and release it
using free().  This enables using jemalloc for detecting missing
pthread_barrier_destroy() calls on any platform on which it works
reliably.

When the newly introduced ISC_TRACK_PTHREADS_OBJECTS preprocessor macro
is set, allocate isc_barrier_t structures on the heap in
isc_barrier_init() and free them in isc_barrier_destroy().  Reuse
existing barrier macros (after renaming them appropriately) for other
operations.
2022-07-13 13:19:32 +02:00
Ondřej SurýandMichał Kępień 8e5e0fa522 Use library constructor to create default mutex attr once
Instead of using isc_once_do() on every isc_mutex_init() call, use the
global library constructor to initialize the default mutex attr
object (optionally with PTHREAD_MUTEX_ADAPTIVE_NP if supported) just
once when the library is loaded.
2022-07-13 13:19:32 +02:00
Michał Kępień badeeff0ac Improve reporting for condition variable errors
Replace all uses of RUNTIME_CHECK() in lib/isc/include/isc/condition.h
with ERRNO_CHECK(), in order to improve error reporting for any
condition-variable-related run-time failures (by augmenting error
messages with file/line/caller information and the error string
corresponding to errno).
2022-07-13 13:19:32 +02:00
Ondřej SurýandMichał Kępień e4606da2c6 Enable tracking of pthreads rwlocks
Some POSIX threads implementations (e.g. FreeBSD's libthr) allocate
memory on the heap when pthread_rwlock_init() is called.  Every call to
that function must be accompanied by a corresponding call to
pthread_rwlock_destroy() or else the memory allocated for the rwlock
will leak.

jemalloc can be used for detecting memory allocations which are not
released by a process when it exits.  Unfortunately, since jemalloc is
also the system allocator on FreeBSD and a special (profiling-enabled)
build of jemalloc is required for memory leak detection, this method
cannot be used for detecting leaked memory allocated by libthr on a
stock FreeBSD installation.

However, libthr's behavior can be emulated on any platform by
implementing alternative versions of libisc functions for creating and
destroying rwlocks that allocate memory using malloc() and release it
using free().  This enables using jemalloc for detecting missing
pthread_rwlock_destroy() calls on any platform on which it works
reliably.

When the newly introduced ISC_TRACK_PTHREADS_OBJECTS preprocessor macro
is set (and --enable-pthread-rwlock is used), allocate isc_rwlock_t
structures on the heap in isc_rwlock_init() and free them in
isc_rwlock_destroy().  Reuse existing functions defined in
lib/isc/rwlock.c for other operations, but rename them first, so that
they contain triple underscores (to indicate that these functions are
implementation-specific, unlike their mutex and condition variable
counterparts, which always use the pthreads implementation).  Define the
isc__rwlock_init() macro so that it is a logical counterpart of
isc__mutex_init() and isc__condition_init(); adjust isc___rwlock_init()
accordingly.  Remove a redundant function prototype for
isc__rwlock_lock() and rename that (static) function to rwlock_lock() in
order to avoid having to use quadruple underscores.
2022-07-13 13:19:32 +02:00
Michał Kępień 5759ace07f Handle pthread_*_init() failures consistently
isc_rwlock_init() currently detects pthread_rwlock_init() failures using
a REQUIRE() assertion.  Use the ERRNO_CHECK() macro for that purpose
instead, so that read-write lock initialization failures are handled
identically as condition variable (pthread_cond_init()) and mutex
(pthread_mutex_init()) initialization failures.
2022-07-13 13:19:32 +02:00
Michał Kępień f352a834a7 Improve reporting for mutex errors
Replace all uses of RUNTIME_CHECK() in lib/isc/include/isc/mutex.h with
ERRNO_CHECK(), in order to improve error reporting for any mutex-related
run-time failures (by augmenting error messages with file/line/caller
information and the error string corresponding to errno).
2022-07-13 13:19:32 +02:00
Ondřej SurýandMichał Kępień 8dfdb95a20 Enable tracking of pthreads condition variables
Some POSIX threads implementations (e.g. FreeBSD's libthr) allocate
memory on the heap when pthread_cond_init() is called.  Every call to
that function must be accompanied by a corresponding call to
pthread_cond_destroy() or else the memory allocated for the condition
variable will leak.

jemalloc can be used for detecting memory allocations which are not
released by a process when it exits.  Unfortunately, since jemalloc is
also the system allocator on FreeBSD and a special (profiling-enabled)
build of jemalloc is required for memory leak detection, this method
cannot be used for detecting leaked memory allocated by libthr on a
stock FreeBSD installation.

However, libthr's behavior can be emulated on any platform by
implementing alternative versions of libisc functions for creating and
destroying condition variables that allocate memory using malloc() and
release it using free().  This enables using jemalloc for detecting
missing pthread_cond_destroy() calls on any platform on which it works
reliably.

When the newly introduced ISC_TRACK_PTHREADS_OBJECTS preprocessor macro
is set, allocate isc_condition_t structures on the heap in
isc_condition_init() and free them in isc_condition_destroy().  Reuse
existing condition variable macros (after renaming them appropriately)
for other operations.
2022-07-13 13:19:32 +02:00
Michał Kępień 365b47caee Add an ERRNO_CHECK() preprocessor macro
In a number of situations in pthreads-related code, a common sequence of
steps is taken: if the value returned by a library function is not 0,
pass errno to strerror_r(), log the string returned by the latter, and
immediately abort execution.  Add an ERRNO_CHECK() preprocessor macro
which takes those exact steps and use it wherever (conveniently)
possible.

Notes:

 1. The "log the return value of strerror_r() and abort" pattern is used
    in a number of other places that this commit does not touch; only
    "!= 0" checks followed by isc_error_fatal() calls with
    non-customized error messages are replaced here.

 2. This change temporarily breaks file name & line number reporting for
    isc__mutex_init() errors, to prevent breaking the build.  This issue
    will be rectified in a subsequent change.
2022-07-13 13:19:32 +02:00
Ondřej SurýandMichał Kępień ebcfb16576 Enable tracking of pthreads mutexes
Some POSIX threads implementations (e.g. FreeBSD's libthr) allocate
memory on the heap when pthread_mutex_init() is called.  Every call to
that function must be accompanied by a corresponding call to
pthread_mutex_destroy() or else the memory allocated for the mutex will
leak.

jemalloc can be used for detecting memory allocations which are not
released by a process when it exits.  Unfortunately, since jemalloc is
also the system allocator on FreeBSD and a special (profiling-enabled)
build of jemalloc is required for memory leak detection, this method
cannot be used for detecting leaked memory allocated by libthr on a
stock FreeBSD installation.

However, libthr's behavior can be emulated on any platform by
implementing alternative versions of libisc functions for creating and
destroying mutexes that allocate memory using malloc() and release it
using free().  This enables using jemalloc for detecting missing
pthread_mutex_destroy() calls on any platform on which it works
reliably.

Introduce a new ISC_TRACK_PTHREADS_OBJECTS preprocessor macro, which
causes isc_mutex_t structures to be allocated on the heap by
isc_mutex_init() and freed by isc_mutex_destroy().  Reuse existing mutex
macros (after renaming them appropriately) for other operations.
2022-07-13 13:19:32 +02:00
Ondřej Surý 9968a6292d Merge branch 'ondrej-update-dir-locals-for-libtest' into 'main'
Update the .dir-locals.el for libtest

See merge request isc-projects/bind9!6565
2022-07-13 10:21:35 +00:00
Ondřej Surý 80fbd849d5 Update the .dir-locals.el for libtest
The tests/libtest directory is missing from the .dir-locals.el, so the
emacs flycheck would not work for the unit tests.  Add it to the
configuration.
2022-07-13 12:17:34 +02:00
Michał Kępień 5415ecbd7c Merge branch '3439-stop-resolving-invalid-names-in-resume_dslookup' into 'main'
Stop resolving invalid names in resume_dslookup()

Closes #3439

See merge request isc-projects/bind9!6563
2022-07-13 08:59:30 +00:00
Michał Kępień cfa398ad37 Add CHANGES entry and release note for GL #3439 2022-07-13 10:31:16 +02:00
Michał Kępień 1a79aeab44 Stop resolving invalid names in resume_dslookup()
Commit 7b2ea97e46 introduced a logic bug
in resume_dslookup(): that function now only conditionally checks
whether DS chasing can still make progress.  Specifically, that check is
only performed when the previous resume_dslookup() call invokes
dns_resolver_createfetch() with the 'nameservers' argument set to
something else than NULL, which may not always be the case.  Failing to
perform that check may trigger assertion failures as a result of
dns_resolver_createfetch() attempting to resolve an invalid name.

Example scenario that leads to such outcome:

 1. A validating resolver is configured to forward all queries to
    another resolver.  The latter returns broken DS responses that
    trigger DS chasing.

 2. rctx_chaseds() calls dns_resolver_createfetch() with the
    'nameservers' argument set to NULL.

 3. The fetch fails, so resume_dslookup() is called.  Due to
    fevent->result being set to e.g. DNS_R_SERVFAIL, the default branch
    is taken in the switch statement.

 4. Since 'nameservers' was set to NULL for the fetch which caused the
    resume_dslookup() callback to be invoked
    (fctx->nsfetch->private->nameservers), resume_dslookup() chops off
    one label off fctx->nsname and calls dns_resolver_createfetch()
    again, for a name containing one label less than before.

 5. Steps 3-4 are repeated (i.e. all attempts to find the name servers
    authoritative for the DS RRset being chased fail) until fctx->nsname
    becomes stripped down the the root name.

 6. Since resume_dslookup() does not check whether DS chasing can still
    make progress, it strips off a label off the root name and continues
    its attempts at finding the name servers authoritative for the DS
    RRset being chased, passing an invalid name to
    dns_resolver_createfetch().

Fix by ensuring resume_dslookup() always checks whether DS chasing can
still make progress when a name server fetch fails.  Update code
comments to ensure the purpose of the relevant dns_name_equal() check is
clear.
2022-07-13 10:31:16 +02:00
Mark Andrews 75027bc6ce Merge branch '3446-autosign-s-checking-revoked-key-with-duplicate-key-id-test-was-incomplete' into 'main'
Resolve "Autosign's 'checking revoked key with duplicate key ID' test was incomplete"

Closes #3446

See merge request isc-projects/bind9!6555
2022-07-13 00:48:09 +00:00
Mark Andrews 513cb24b55 Make "checking revoked key with duplicate key ID" work
There should be 2 keys with the same key id after the numerically
lower one is revoked (serial space arithmetic).  The DS points
at the non-revoked key so validation should still succeed.
2022-07-13 00:47:49 +00:00
Mark Andrews e28492dc04 Merge branch '3445-update-libdns_la_libadd-instead-of-libdns_la_ldflags' into 'main'
Resolve "Update libdns_la_LIBADD instead of libdns_la_LDFLAGS"

Closes #3445

See merge request isc-projects/bind9!6553
2022-07-13 00:44:51 +00:00
Mark Andrews 5b51610174 Update libdns_la_LIBADD rather than libdns_la_LDFLAGS
the wrong macro was being update with MAXMINDDB_LIBS making
it difficult to adjust link order.
2022-07-13 00:14:13 +00:00
Evan Hunt 47bf1e95ad Merge branch '2962-invalid-fctx' into 'main'
clear fctx->magic and fetch->magic when destroying

See merge request isc-projects/bind9!6543
2022-07-12 23:54:25 +00:00
Evan HuntandMark Andrews 5ec077e6aa clear fctx->magic and fetch->magic when destroying
fctx_destroy() and dns_resolver_destroyfetch() did not clear the
'magic' field during destruction.
2022-07-12 23:40:47 +00:00
Evan Hunt 24e52a623f Merge branch '2683-ixfr-logging' into 'main'
log the reason for falling back to AXFR from IXFR at level info

Closes #2683

See merge request isc-projects/bind9!6511
2022-07-12 23:25:34 +00:00
Evan Hunt df1d81cf96 log the reason for falling back to AXFR from IXFR at level info
messages indicating the reason for a fallback to AXFR (i.e, because
the requested serial number is not present in the journal, or because
the size of the IXFR response would exceeed "max-ixfr-ratio") are now
logged at level info instead of debug(4).
2022-07-12 16:02:54 -07:00
Artem Boldariev 0b221bf326 Merge branch 'artem-backport-tls-related-fixes-from-loopmgr-branch' into 'main'
Backport TLS-related fixes from the loopmgr-branch

See merge request isc-projects/bind9!6501
2022-07-12 12:11:21 +00:00
Artem Boldariev ffcb54211e TLS: do not ignore accept callback result
Before this change the TLS code would ignore the accept callback result,
and would not try to gracefully close the connection. This had not been
noticed, as it is not really required for DoH. Now the code tries to
shut down the TLS connection gracefully when accepting it is not
successful.
2022-07-12 14:40:22 +03:00
Artem Boldariev 0f9b6a7bc1 *_noresponse, tlsdns_listen_noalpn: csends == 1 is not guaranteed
This commit removes an assertion from the unit test which cannot be
guaranteed.

According to the test, exactly one client send must succeed. However,
it cannot really be guaranteed, as do not start to read data in the
accept callback on the server nor attach to the accepted handle. Thus,
we can expect the connection to be closed soon after we have returned
from the callback.

Interestingly enough, the test would pass just fine on TCP because:

a) there are fewer layers involved and thus there is less processing;

b) it is possible for the data to be sent and end up in an internal OS
socket buffer without being touched by an application's code on the
server. In such a case the client's write callback still would be
called successfully;

There is a chance for the test to succeed over TLS as well (as it
happily did before), but as the code has been changed to close unused
connections as soon as possible, the chance is far slimmer now.

What can be guaranteed is:

* cconnects == 1 (number client connections equals 1);
* saccepts == 1 (number of accepted connections equals 1).
2022-07-12 14:40:22 +03:00
Artem Boldariev 8585b92f98 TLSDNS: try pass incoming data to OpenSSL if there are any
Otherwise the code path will lead to a call to SSL_get_error()
returning SSL_ERROR_SSL, which in turn might lead to closing
connection to early in an unexpected way, as it is clearly not what is
intended.

The issue was found when working on loppmgr branch and appears to
be timing related as well. Might be responsible for some unexpected
transmission failures e.g. on zone transfers.
2022-07-12 14:40:22 +03:00
Artem Boldariev fc74b15e67 TLS: bail out earlier when NM is stopping
In some operations - most prominently when establishing connection -
it might be beneficial to bail out earlier when the network manager
is stopping.

The issue is backported from loopmgr branch, where such a change is
not only beneficial, but required.
2022-07-12 14:40:22 +03:00
Artem Boldariev ac4fb34f18 TLS: sometimes TCP conn. handle might be NULL on when connecting
In some cases - in particular, in case of errors, NULL might be passed
to a connection callback instead of a handle that could have led to
an abort. This commit ensures that such a situation will not occur.

The issue was found when working on the loopmgr branch.
2022-07-12 14:40:22 +03:00
Artem Boldariev 88524e26ec TLS: try to close sockets whenever there are no pending operations
This commit ensures that the underlying TCP socket of a TLS connection
gets closed earlier whenever there are no pending operations on it.

In the loop-manager branch, in some circumstances the connection
could have remained opened for far too long for no reason. This
commit ensures that will not happen.
2022-07-12 14:40:22 +03:00
Artem Boldariev 237ce05b89 TLS: Implement isc_nmhandle_setwritetimeout()
This commit adds a proper implementation of
isc_nmhandle_setwritetimeout() for TLS connections. Now it passes the
value to the underlying TCP handle.
2022-07-12 14:40:22 +03:00
Michal Nowak 56d9938328 Merge branch 'mnowak/alpine-3.16' into 'main'
Add Alpine Linux 3.16

See merge request isc-projects/bind9!6360
2022-07-12 11:10:28 +00:00
Michal Nowak 0d0ab3db10 Add Alpine Linux 3.16 2022-07-12 12:27:10 +02:00
Matthijs Mekking 0851ace0d3 Merge branch '3438-dnssec-policy-does-not-set-inline-signing' into 'main'
Fix inheritance for dnssec-policy when checking for inline-signing

Closes #3438

See merge request isc-projects/bind9!6541
2022-07-12 10:12:39 +00:00
Matthijs Mekking 689215a675 Add release note and change entry for #3438
Bug worth mentioning.
2022-07-12 11:29:39 +02:00
Matthijs Mekking 576b21b168 Inherit dnssec-policy in check for inline-signing
When dnssec-policy is used, and the zone is not dynamic, BIND will
assume that the zone is inline-signed. But the function responsible
for this did not inherit the dnssec-policy option from the view or
options level, and thus never enabled inline-signing, while the zone
should have been.

This is fixed by this commit.
2022-07-12 11:29:03 +02:00
Matthijs Mekking efa8a4e88d Test setting of inline-signing with dnssec-policy
When dnssec-policy is used, and the zone is not dynamic, BIND will
assume that the zone is inline-signed. Add test cases to verify this.
2022-07-12 11:29:03 +02:00
Matthijs Mekking ff65f07779 Fix kasp system test bugs
Fix a comment, ensuring the right parameters are used (zone is
parameter $3, not $2) and add view and policy parameters to the comment.

Fix the view tests and test the correct view (example3 instead of
example2).

Fix placement of "n=$((n+1)" for two test cases.
2022-07-12 11:29:03 +02:00
Mark Andrews c33c947415 Merge branch '3389-unexpected-badkey-in-upforwd-system-test' into 'main'
Clone UPDATE message buffer before forwarding

Closes #3389

See merge request isc-projects/bind9!6388
2022-07-12 08:57:47 +00:00
Mark Andrews 09d8ed3970 Add CHANGES note for [GL #3389] 2022-07-12 17:14:11 +10:00
Mark Andrews 7a42417d61 Clone the message buffer before forwarding UPDATE messages
this prevents named forwarding a buffer that may have been over
written.
2022-07-12 17:13:24 +10:00
Mark Andrews 50a86e9119 Merge branch '3440-use-default_algorithm-more-often' into 'main'
Resolve "Use DEFAULT_ALGORITHM more often"

Closes #3440

See merge request isc-projects/bind9!6532
2022-07-12 03:46:28 +00:00
Mark Andrews be88c583bd Add CHANGES not for [GL #3440] 2022-07-12 13:29:07 +10:00
Mark Andrews 459e6980e5 zonechecks: use $DEFAULT_ALGORITHM 2022-07-12 13:29:07 +10:00
Mark Andrews 3f65c9cf85 wildcard: use $DEFAULT_ALGORITHM 2022-07-12 13:29:07 +10:00
Mark Andrews 86b29606c3 views: use $DEFAULT_ALGORITHM 2022-07-12 13:29:07 +10:00
Mark Andrews 93f7c7cdcd verify: use $DEFAULT_ALGORITHM 2022-07-12 13:29:07 +10:00
Mark Andrews 5585909904 upforwd: use $DEFAULT_ALGORITHM 2022-07-12 13:29:07 +10:00
Mark Andrews 9970d4317d unknown: use $DEFAULT_ALGORITHM 2022-07-12 13:29:07 +10:00
Mark Andrews 73fd49f8bb synthfromdnssec: use $DEFAULT_ALGORITHM 2022-07-12 13:29:07 +10:00
Mark Andrews 32337b9dbf staticstub: use $DEFAULT_ALGORITHM 2022-07-12 13:29:07 +10:00
Mark Andrews 941b95edb0 smartsign: use $DEFAULT_ALGORITHM 2022-07-12 13:29:07 +10:00
Mark Andrews 1861c3e503 rpz: use $DEFAULT_ALGORITHM 2022-07-12 13:29:07 +10:00
Mark Andrews b0e1d9b1b3 rootkeysentinel: use $DEFAULT_ALGORITHM 2022-07-12 13:29:07 +10:00
Mark Andrews 05ef8c81dd resolver: use $DEFAULT_ALGORITHM 2022-07-12 10:40:30 +10:00
Mark Andrews e0e03602ba redirect: use $DEFAULT_ALGORITHM 2022-07-12 10:40:30 +10:00
Mark Andrews 6fd50b9fda pending: use $DEFAULT_ALGORITHM 2022-07-12 10:40:30 +10:00
Mark Andrews c2d18567fc nsupdate: use $DEFAULT_ALGORITHM 2022-07-12 10:40:30 +10:00
Mark Andrews 78fa082999 mkeys: use $DEFAULT_ALGORITHM 2022-07-12 10:40:30 +10:00
Mark Andrews ff95bafa39 mirror: use $DEFAULT_ALGORITHM 2022-07-12 10:40:29 +10:00
Mark Andrews 3f1dc83bfb metadata: use $DEFAULT_ALGORITHM 2022-07-12 10:40:29 +10:00
Mark Andrews e3acddefd1 inline: use $DEFAULT_ALGORITHM 2022-07-12 10:40:29 +10:00
Mark Andrews 49de14cb9e dsdigest: use $DEFAULT_ALGORITHM 2022-07-12 10:40:29 +10:00
Mark Andrews d0b0139c90 dnssec: use $DEFAULT_ALGORITHM 2022-07-12 10:40:29 +10:00
Mark Andrews 5cbf1e1598 dns64: use $DEFAULT_ALGORITHM 2022-07-12 10:40:29 +10:00
Mark Andrews 3419178bd2 chain: use $DEFAULT_ALGORITHM 2022-07-12 10:40:29 +10:00
Mark Andrews 6cf0b73ede cds: use $DEFAULT_ALGORITHM 2022-07-12 10:40:29 +10:00
Mark Andrews bb810b0ac9 autosign: use $DEFAULT_ALGORITHM 2022-07-12 10:40:29 +10:00
Ondřej Surý b7f603fd4b Merge branch '3423-fix-root-zone-compression' into 'main'
Don't compress in the rrset if compression was disabled

Closes #3423

See merge request isc-projects/bind9!6485
2022-07-11 11:53:15 +00:00
Ondřej Surý 51b0c3cbb8 Add CHANGES and release note for [GL #3423] 2022-07-11 12:26:37 +02:00
Mark AndrewsandOndřej Surý 8dae4e415d Expand name compression unit test
The name compression unit test is expanded to check that the compressed
form matches the expected wire pattern.

Record owner names are compressed differently to rdata names by
calling dns_name_towire2 instead of dns_name_towire so check that
owner names are compressed correctly as well.
2022-07-11 12:26:15 +02:00
Ondřej Surý ddad205092 Don't compress in the rrset if compression was disabled
Currently, when rrset is being compressed, the optimization has been put
in place to reuse offset to the previous name in the same rrset.  This
skips the check for non-improving compression and thus compresses the
root zone making the wireformat worse by one byte.

Additionally, when the compression has been disabled for the name, it
would be repeatedly added to the compression table because we act as if
the name was not found and the dns_compress_add() doesn't check for the
existing entry.

Change the dns_name_towire2() to always lookup the name in the
compression table to prevent adding duplicates, but don't use it neither
in the wireformat nor in the rrset cache.
2022-07-11 12:26:15 +02:00
Michał Kępień 01d46f57f9 Merge branch 'michal/set-up-version-and-release-notes-for-bind-9.19.4' into 'main'
Set up version and release notes for BIND 9.19.4

See merge request isc-projects/bind9!6538
2022-07-11 07:05:52 +00:00
Michał Kępień 680d1d29a4 Set up release notes for BIND 9.19.4 2022-07-11 08:49:38 +02:00
Michał Kępień 26bd3c172c Update BIND version to 9.19.4-dev 2022-07-11 08:49:38 +02:00
683 changed files with 32655 additions and 24754 deletions
+4
View File
@@ -49,6 +49,10 @@
(expand-file-name
(concat directory-of-current-dir-locals-file "lib/bind9/include"))
;; libtest
(expand-file-name
(concat directory-of-current-dir-locals-file "tests/include"))
;; bin
(expand-file-name
(concat directory-of-current-dir-locals-file "bin/check"))
File diff suppressed because it is too large Load Diff
+146 -160
View File
@@ -6,10 +6,6 @@ variables:
CI_REGISTRY_IMAGE: registry.gitlab.isc.org/isc-projects/images/bind9
CCACHE_DIR: "/ccache"
SOFTHSM2_CONF: "/var/tmp/softhsm2/softhsm2.conf"
OPENSSL_ENGINES: "/usr/lib/x86_64-linux-gnu/engines-1.1"
DEFAULT_OPENSSL_CONF: "/etc/ssl/openssl.cnf"
OPENSSL_CONF: "/var/tmp/etc/openssl.cnf"
GIT_DEPTH: 1
BUILD_PARALLEL_JOBS: 6
@@ -106,8 +102,8 @@ stages:
# Alpine Linux
.alpine-3.15-amd64: &alpine_3_15_amd64_image
image: "$CI_REGISTRY_IMAGE:alpine-3.15-amd64"
.alpine-3.16-amd64: &alpine_3_16_amd64_image
image: "$CI_REGISTRY_IMAGE:alpine-3.16-amd64"
<<: *linux_amd64
# Oracle Linux
@@ -120,12 +116,12 @@ stages:
image: "$CI_REGISTRY_IMAGE:oraclelinux-8-amd64"
<<: *linux_amd64
# Debian
.debian-buster-amd64: &debian_buster_amd64_image
image: "$CI_REGISTRY_IMAGE:debian-buster-amd64"
.oraclelinux-9-amd64: &oraclelinux_9_amd64_image
image: "$CI_REGISTRY_IMAGE:oraclelinux-9-amd64"
<<: *linux_amd64
# Debian
.debian-bullseye-amd64: &debian_bullseye_amd64_image
image: "$CI_REGISTRY_IMAGE:debian-bullseye-amd64"
<<: *linux_amd64
@@ -146,20 +142,16 @@ stages:
# Fedora
.fedora-35-amd64: &fedora_35_amd64_image
image: "$CI_REGISTRY_IMAGE:fedora-35-amd64"
.fedora-36-amd64: &fedora_36_amd64_image
image: "$CI_REGISTRY_IMAGE:fedora-36-amd64"
<<: *linux_amd64
.fedora-35-arm64: &fedora_35_arm64_image
image: "$CI_REGISTRY_IMAGE:fedora-35-arm64"
.fedora-36-arm64: &fedora_36_arm64_image
image: "$CI_REGISTRY_IMAGE:fedora-36-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
@@ -181,11 +173,11 @@ stages:
<<: *libvirt_amd64
.freebsd-13-amd64: &freebsd_13_amd64_image
image: "freebsd-13.0-x86_64"
image: "freebsd-13.1-x86_64"
<<: *libvirt_amd64
.openbsd-amd64: &openbsd_amd64_image
image: "openbsd-7.0-x86_64"
image: "openbsd-7.1-x86_64"
<<: *libvirt_amd64
### Job Templates
@@ -238,9 +230,15 @@ stages:
--with-cmocka
--with-libxml2
--with-json-c
--enable-leak-detection
$EXTRA_CONFIGURE
|| (test -s config.log && cat config.log; exit 1)
# change directory to the workspace before including this
.find_python: &find_python
- PYTHON="$(source bin/tests/system/conf.sh; echo $PYTHON)"
- test -x "$PYTHON"
.check_readline_setup: &check_readline_setup
- if [[ -n "${WITHOUT_READLINE}" ]]; then
! grep "^#define HAVE_READLINE" config.h;
@@ -279,6 +277,7 @@ stages:
- test -z "${CROSS_COMPILATION}" || file lib/dns/gen | grep -F -q "ELF 64-bit LSB"
- test -z "${CROSS_COMPILATION}" || ( ! git ls-files -z --others --exclude lib/dns/gen | xargs -0 file | grep "ELF 64-bit LSB" )
- if test -z "${OUT_OF_TREE_WORKSPACE}" && test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
- bin/named/named -V
needs:
- job: autoreconf
artifacts: true
@@ -304,11 +303,15 @@ stages:
- cd bin/tests/system
- make -j${TEST_PARALLEL_JOBS:-1} -k check V=1
- if git rev-parse > /dev/null 2>&1; then ( ! grep "^I:.*:file.*not removed$" *.log ); fi
- '( ! grep -F "grep: warning:" *.log )'
after_script:
- test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
- test -d bind-* && cd bind-*
- REALSOURCEDIR="$PWD"
- test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
- cat bin/tests/system/test-suite.log
- (source bin/tests/system/conf.sh && "${PYTHON}" "${CI_PROJECT_DIR}/bin/tests/convert-trs-to-junit.py" . > "${CI_PROJECT_DIR}/junit.xml")
- *find_python
- >
"$PYTHON" "$REALSOURCEDIR"/bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml
.system_test: &system_test_job
<<: *system_test_common
@@ -330,11 +333,13 @@ stages:
<<: *system_test_common
after_script:
- cat bin/tests/system/test-suite.log
- find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
- (source bin/tests/system/conf.sh && "${PYTHON}" "${CI_PROJECT_DIR}/bin/tests/convert-trs-to-junit.py" . > "${CI_PROJECT_DIR}/junit.xml")
- *find_python
- find -name 'tsan.*' -exec "$PYTHON" util/parse_tsan.py {} \;
- >
"$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml
artifacts:
expire_in: "1 day"
untracked: true
expire_in: "1 day"
when: always
reports:
junit: junit.xml
@@ -347,9 +352,12 @@ stages:
script:
- make -j${TEST_PARALLEL_JOBS:-1} -k unit V=1
after_script:
- test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
- test -d bind-* && cd bind-*
- (source bin/tests/system/conf.sh && "${PYTHON}" "${CI_PROJECT_DIR}/bin/tests/convert-trs-to-junit.py" . > "${CI_PROJECT_DIR}/junit.xml")
- REALSOURCEDIR="$PWD"
- test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
- *find_python
- >
"$PYTHON" "$REALSOURCEDIR"/bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml
.unit_test: &unit_test_job
<<: *unit_test_common
@@ -370,14 +378,13 @@ stages:
.unit_test_tsan: &unit_test_tsan_job
<<: *unit_test_common
after_script:
- find lib -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
- (source bin/tests/system/conf.sh && "${PYTHON}" "${CI_PROJECT_DIR}/bin/tests/convert-trs-to-junit.py" . > "${CI_PROJECT_DIR}/junit.xml")
- *find_python
- find -name 'tsan.*' -exec "$PYTHON" util/parse_tsan.py {} \;
- >
"$PYTHON" bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml
artifacts:
untracked: true
expire_in: "1 day"
paths:
- tests/*/tsan.*
- tsan/
- junit.xml
when: always
reports:
junit: junit.xml
@@ -390,6 +397,26 @@ stages:
- qpdf --check doc/arm/_build/latex/Bv9ARM.pdf
- find doc/man/ -maxdepth 1 -name "*.[0-9]" -exec mandoc -T lint "{}" \; | ( ! grep -v -e "skipping paragraph macro. sp after" -e "unknown font, skipping request. ft C" )
.respdiff: &respdiff_job
<<: *base_image
stage: system
before_script:
- autoreconf -fi
- *configure
- make -j${BUILD_PARALLEL_JOBS:-1} V=1
- *setup_interfaces
- git clone --depth 1 https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.isc.org/isc-private/bind-qa.git
- cd bind-qa/bind9/respdiff
needs: []
artifacts:
paths:
- bind-qa/bind9/respdiff
exclude:
- bind-qa/bind9/respdiff/rspworkdir/data.mdb # Exclude a 10 GB file.
untracked: true
expire_in: "1 day"
when: always
### Job Definitions
# Jobs in the precheck stage
@@ -525,28 +552,28 @@ docs:tarball:
- job: tarball-create
artifacts: true
# Jobs for regular GCC builds on Alpine Linux 3.15 (amd64)
# Jobs for regular GCC builds on Alpine Linux 3.16 (amd64)
gcc:alpine3.15:amd64:
gcc:alpine3.16:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "${WITHOUT_READLINE}"
<<: *alpine_3_15_amd64_image
<<: *alpine_3_16_amd64_image
<<: *build_job
system:gcc:alpine3.15:amd64:
<<: *alpine_3_15_amd64_image
system:gcc:alpine3.16:amd64:
<<: *alpine_3_16_amd64_image
<<: *system_test_job
needs:
- job: gcc:alpine3.15:amd64
- job: gcc:alpine3.16:amd64
artifacts: true
unit:gcc:alpine3.15:amd64:
<<: *alpine_3_15_amd64_image
unit:gcc:alpine3.16:amd64:
<<: *alpine_3_16_amd64_image
<<: *unit_test_job
needs:
- job: gcc:alpine3.15:amd64
- job: gcc:alpine3.16:amd64
artifacts: true
# Jobs for regular GCC builds on Oracle Linux 7 (amd64)
@@ -579,7 +606,7 @@ gcc:oraclelinux8:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--enable-buffer-useinline --with-libidn2"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *oraclelinux_8_amd64_image
<<: *build_job
@@ -597,31 +624,28 @@ unit:gcc:oraclelinux8:amd64:
- job: gcc:oraclelinux8:amd64
artifacts: true
# Jobs for regular GCC builds on Debian 10 "buster" (amd64)
# Jobs for regular GCC builds on Oracle Linux 9 (amd64)
gcc:buster:amd64:
gcc:oraclelinux9:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *debian_buster_amd64_image
EXTRA_CONFIGURE: "--with-libidn2 --disable-developer"
<<: *oraclelinux_9_amd64_image
<<: *build_job
<<: *api_schedules_tags_triggers_web_triggering_rules
system:gcc:buster:amd64:
<<: *debian_buster_amd64_image
system:gcc:oraclelinux9:amd64:
<<: *oraclelinux_9_amd64_image
<<: *system_test_job
<<: *api_schedules_tags_triggers_web_triggering_rules
needs:
- job: gcc:buster:amd64
- job: gcc:oraclelinux9:amd64
artifacts: true
unit:gcc:buster:amd64:
<<: *debian_buster_amd64_image
unit:gcc:oraclelinux9:amd64:
<<: *oraclelinux_9_amd64_image
<<: *unit_test_job
<<: *api_schedules_tags_triggers_web_triggering_rules
needs:
- job: gcc:buster:amd64
- job: gcc:oraclelinux9:amd64
artifacts: true
# Jobs for regular GCC builds on Debian 11 "bullseye" (amd64)
@@ -730,13 +754,20 @@ scan-build:
gcc:sid:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -O3"
EXTRA_CONFIGURE: "--with-libidn2 --without-lmdb ${WITH_READLINE}"
CFLAGS: "${CFLAGS_COMMON} -O3 -DOPENSSL_API_COMPAT=10100"
# For the jemalloc ./configure option, see https://gitlab.isc.org/isc-projects/bind9/-/issues/3444
EXTRA_CONFIGURE: "--with-libidn2 --without-lmdb --without-jemalloc --disable-leak-detection ${WITH_READLINE}"
RUN_MAKE_INSTALL: 1
<<: *debian_sid_amd64_image
<<: *build_job
system:gcc:sid:amd64:
# Set up environment variables that allow the "keyfromlabel" system test to be run
variables:
DEFAULT_OPENSSL_CONF: "/etc/ssl/openssl.cnf"
OPENSSL_CONF: "/var/tmp/etc/openssl.cnf"
SOFTHSM2_CONF: "/var/tmp/softhsm2/softhsm2.conf"
SOFTHSM2_MODULE: "/usr/lib/softhsm/libsofthsm2.so"
<<: *debian_sid_amd64_image
<<: *system_test_job
needs:
@@ -844,40 +875,13 @@ 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"
<<: *ubuntu_bionic_amd64_image
<<: *build_job
<<: *api_schedules_tags_triggers_web_triggering_rules
system:gcc:bionic:amd64:
<<: *ubuntu_bionic_amd64_image
<<: *system_test_job
<<: *api_schedules_tags_triggers_web_triggering_rules
needs:
- job: gcc:bionic:amd64
artifacts: true
unit:gcc:bionic:amd64:
<<: *ubuntu_bionic_amd64_image
<<: *unit_test_job
<<: *api_schedules_tags_triggers_web_triggering_rules
needs:
- job: gcc:bionic:amd64
artifacts: true
# Jobs for regular GCC builds on Ubuntu 20.04 Focal Fossa (amd64)
gcc:focal:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
EXTRA_CONFIGURE: "--disable-geoip --with-libidn2"
EXTRA_CONFIGURE: "--disable-dnstap --without-cmocka --without-gssapi --with-libidn2"
<<: *ubuntu_focal_amd64_image
<<: *build_job
@@ -901,7 +905,7 @@ gcc:jammy:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--with-libidn2"
EXTRA_CONFIGURE: "--disable-geoip --with-libidn2 --disable-doh"
<<: *ubuntu_jammy_amd64_image
<<: *build_job
@@ -919,30 +923,28 @@ unit:gcc:jammy:amd64:
- job: gcc:jammy:amd64
artifacts: true
# Jobs for ASAN builds on Fedora 35 (amd64)
# Jobs for ASAN builds on Fedora 36 (amd64)
gcc:asan:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined -Wno-error=stringop-overread"
CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined"
LDFLAGS: "-fsanitize=address,undefined"
SOFTHSM2_MODULE: "/lib64/libsofthsm2.so"
EXTRA_CONFIGURE: "--with-libidn2 --without-jemalloc"
<<: *fedora_35_amd64_image
<<: *fedora_36_amd64_image
<<: *build_job
system:gcc:asan:
variables:
SOFTHSM2_MODULE: "/lib64/libsofthsm2.so"
LSAN_OPTIONS: "suppressions=$CI_PROJECT_DIR/suppr-lsan.txt"
<<: *fedora_35_amd64_image
<<: *fedora_36_amd64_image
<<: *system_test_job
needs:
- job: gcc:asan
artifacts: true
unit:gcc:asan:
<<: *fedora_35_amd64_image
<<: *fedora_36_amd64_image
<<: *unit_test_job
needs:
- job: gcc:asan
@@ -971,23 +973,21 @@ unit:clang:asan:
- job: clang:asan
artifacts: true
# Jobs for TSAN builds on Fedora 35 (amd64)
# Jobs for TSAN builds on Fedora 36 (amd64)
gcc:tsan:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -fsanitize=thread"
LDFLAGS: "-fsanitize=thread"
SOFTHSM2_MODULE: "/lib64/libsofthsm2.so"
EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock --without-jemalloc"
<<: *fedora_35_amd64_image
<<: *fedora_36_amd64_image
<<: *build_job
system:gcc:tsan:
variables:
SOFTHSM2_MODULE: "/lib64/libsofthsm2.so"
TSAN_OPTIONS: "${TSAN_OPTIONS_COMMON} external_symbolizer_path=/usr/bin/llvm-symbolizer"
<<: *fedora_35_amd64_image
<<: *fedora_36_amd64_image
<<: *system_test_tsan_job
needs:
- job: gcc:tsan
@@ -996,7 +996,7 @@ system:gcc:tsan:
unit:gcc:tsan:
variables:
TSAN_OPTIONS: "${TSAN_OPTIONS_COMMON} external_symbolizer_path=/usr/bin/llvm-symbolizer"
<<: *fedora_35_amd64_image
<<: *fedora_36_amd64_image
<<: *unit_test_tsan_job
needs:
- job: gcc:tsan
@@ -1035,10 +1035,18 @@ clang:bullseye:amd64:
variables:
CC: ${CLANG}
CFLAGS: "${CFLAGS_COMMON} -Wenum-conversion"
# See https://gitlab.isc.org/isc-projects/bind9/-/issues/3444
EXTRA_CONFIGURE: "--without-jemalloc --disable-leak-detection"
<<: *debian_bullseye_amd64_image
<<: *build_job
system:clang:bullseye:amd64:
# Set up environment variables that allow the "keyfromlabel" system test to be run
variables:
DEFAULT_OPENSSL_CONF: "/etc/ssl/openssl.cnf"
OPENSSL_CONF: "/var/tmp/etc/openssl.cnf"
SOFTHSM2_CONF: "/var/tmp/softhsm2/softhsm2.conf"
SOFTHSM2_MODULE: "/usr/lib/softhsm/libsofthsm2.so"
<<: *debian_bullseye_amd64_image
<<: *system_test_job
needs:
@@ -1180,10 +1188,10 @@ release:
--form token=$COVERITY_SCAN_TOKEN
- test "$(md5sum /tmp/cov-analysis-linux64.tgz | awk '{ print $1 }')" = "$(cat /tmp/cov-analysis-linux64.md5)"
- tar --extract --gzip --file=/tmp/cov-analysis-linux64.tgz --directory=/tmp
- test -d /tmp/cov-analysis-linux64-2021.12.1
- test -d /tmp/cov-analysis-linux64-2022.6.0
.coverity_build: &coverity_build
- /tmp/cov-analysis-linux64-2021.12.1/bin/cov-build --dir /tmp/cov-int --fs-capture-search . sh -c 'make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1'
- /tmp/cov-analysis-linux64-2022.6.0/bin/cov-build --dir /tmp/cov-int --fs-capture-search . sh -c 'make -j${BUILD_PARALLEL_JOBS:-1} -k all V=1'
- tar --create --gzip --file=/tmp/cov-int.tar.gz --directory /tmp cov-int
- curl -v https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME
--form token=$COVERITY_SCAN_TOKEN
@@ -1223,63 +1231,35 @@ coverity:
# Respdiff tests
respdiff:
<<: *base_image
<<: *api_schedules_tags_triggers_web_triggering_rules
stage: system
respdiff-short:
<<: *respdiff_job
<<: *default_triggering_rules
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
BIND_BASELINE_VERSION: v9_11_24
CFLAGS: "${CFLAGS_COMMON} -Og -DISC_TRACK_PTHREADS_OBJECTS"
MAX_DISAGREEMENTS_PERCENTAGE: "0.5"
script:
- autoreconf -fi
- *configure
- make -j${BUILD_PARALLEL_JOBS:-1} V=1
- *setup_interfaces
- git clone --depth 1 https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.isc.org/isc-private/bind-qa.git
- git clone --branch "${BIND_BASELINE_VERSION}" --depth 1 https://gitlab.isc.org/isc-projects/bind9.git refserver
- cd refserver/
- ./configure --with-randomdev=/dev/urandom
- make -j${BUILD_PARALLEL_JOBS:-1} V=1
- cd ../bind-qa/bind9/respdiff
- bash respdiff.sh -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "${CI_PROJECT_DIR}/refserver"
needs: []
artifacts:
paths:
- refserver
- bind-qa/bind9/respdiff
exclude:
- bind-qa/bind9/respdiff/rspworkdir/data.mdb # Exclude a 10 GB file.
untracked: true
expire_in: "1 day"
when: always
- bash respdiff.sh -m /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 -s named -q "${PWD}/10k_a.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named"
respdiff-third-party:
<<: *base_image
respdiff-long:
<<: *respdiff_job
<<: *api_schedules_tags_triggers_web_triggering_rules
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og -DISC_TRACK_PTHREADS_OBJECTS"
MAX_DISAGREEMENTS_PERCENTAGE: "0.5"
script:
- bash respdiff.sh -m /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 -s named -q "${PWD}/100k_mixed.txt" -c 3 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}" "/usr/local/respdiff-reference-bind/sbin/named"
respdiff-long-third-party:
<<: *respdiff_job
<<: *api_schedules_tags_triggers_web_triggering_rules
stage: system
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
MAX_DISAGREEMENTS_PERCENTAGE: "0.5"
script:
- autoreconf -fi
- *configure
- make -j${BUILD_PARALLEL_JOBS:-1} V=1
- *setup_interfaces
- git clone --depth 1 https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.isc.org/isc-private/bind-qa.git
- cd bind-qa/bind9/respdiff
- bash respdiff.sh -s third_party -q "${PWD}/100k_mixed.txt" -c 1 -w "${PWD}/rspworkdir" "${CI_PROJECT_DIR}"
needs: []
artifacts:
paths:
- bind-qa/bind9/respdiff
exclude:
- bind-qa/bind9/respdiff/rspworkdir/data.mdb # Exclude a 10 GB file.
untracked: true
expire_in: "1 day"
when: always
# "Stress" tests
@@ -1302,8 +1282,8 @@ respdiff-third-party:
when: always
timeout: 2h
stress:authoritative:fedora:35:amd64:
<<: *fedora_35_amd64_image
stress:authoritative:fedora:36:amd64:
<<: *fedora_36_amd64_image
<<: *linux_stress_amd64
<<: *stress_job
variables:
@@ -1316,8 +1296,8 @@ stress:authoritative:fedora:35: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:35:amd64:
<<: *fedora_35_amd64_image
stress:recursive:fedora:36:amd64:
<<: *fedora_36_amd64_image
<<: *linux_stress_amd64
<<: *stress_job
variables:
@@ -1330,8 +1310,8 @@ stress:recursive:fedora:35:amd64:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /recursive/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
stress:rpz:fedora:35:amd64:
<<: *fedora_35_amd64_image
stress:rpz:fedora:36:amd64:
<<: *fedora_36_amd64_image
<<: *linux_stress_amd64
<<: *stress_job
variables:
@@ -1344,8 +1324,8 @@ stress:rpz:fedora:35:amd64:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /rpz/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
stress:authoritative:fedora:35:arm64:
<<: *fedora_35_arm64_image
stress:authoritative:fedora:36:arm64:
<<: *fedora_36_arm64_image
<<: *linux_stress_arm64
<<: *stress_job
variables:
@@ -1358,8 +1338,8 @@ stress:authoritative:fedora:35: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:35:arm64:
<<: *fedora_35_arm64_image
stress:recursive:fedora:36:arm64:
<<: *fedora_36_arm64_image
<<: *linux_stress_arm64
<<: *stress_job
variables:
@@ -1372,8 +1352,8 @@ stress:recursive:fedora:35:arm64:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /linux/i && $BIND_STRESS_TEST_MODE =~ /recursive/i && $BIND_STRESS_TEST_ARCH =~ /arm64/i)
stress:rpz:fedora:35:arm64:
<<: *fedora_35_arm64_image
stress:rpz:fedora:36:arm64:
<<: *fedora_36_arm64_image
<<: *linux_stress_arm64
<<: *stress_job
variables:
@@ -1444,9 +1424,15 @@ gcov:
# source files from lib/dns/rdata/*/, using an even nastier trick.
- find lib/dns/rdata/* -name "*.c" -execdir cp -f "{}" ../../ \;
# Help gcovr process inline functions in headers
- cp -f lib/isc/include/isc/*.h lib/dns/
- cp -f lib/dns/include/dns/*.h lib/dns/
- cp -f lib/dns/include/dns/*.h lib/ns/
- cp -f lib/isc/include/isc/*.h lib/isc/
- cp -f lib/isc/include/isc/*.h lib/dns/
- cp -f lib/isc/include/isc/*.h lib/ns/
- find bin lib -maxdepth 1 -mindepth 1 -type d -exec cp -f lib/isc/include/isc/buffer.h "{}" \;
- cp -f lib/isc/include/isc/buffer.h fuzz/
- cp -f lib/isc/include/isc/buffer.h lib/isc/netmgr/buffer.h
- cp -f lib/isc/include/isc/hash.h lib/dns/hash.h
# Generate XML file in the Cobertura XML format suitable for use by GitLab
# for the purpose of displaying code coverage information in the diff view
# of a given merge request.
+1 -1
View File
@@ -86,7 +86,7 @@
- [ ] ***(QA)*** Merge published release tags (non-linearly) back into the their relevant development/maintenance branches.
- [ ] ***(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`.
- [ ] ***(QA)*** Update QA tools used in GitLab CI (e.g. Black, 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.
+6
View File
@@ -49,6 +49,11 @@ Files: **/*.after*
bin/tests/system/keepalive/expected
bin/tests/system/legacy/ns6/edns512.db.signed
bin/tests/system/legacy/ns7/edns512-notcp.db.signed
bin/tests/system/nsupdate/CA/CA.cfg
bin/tests/system/nsupdate/CA/README
bin/tests/system/nsupdate/CA/index.txt
bin/tests/system/nsupdate/CA/index.txt.attr
bin/tests/system/nsupdate/CA/serial
bin/tests/system/nsupdate/commandlist
bin/tests/system/nsupdate/verylarge.in
bin/tests/system/org.isc.bind.system.plist
@@ -147,6 +152,7 @@ Files: **/.clang-format
.clang-format
.clang-format.headers
.dir-locals.el
.git-blame-ignore-revs
.gitattributes
.gitignore
.gitlab-ci.yml
+329
View File
@@ -1,3 +1,332 @@
6001. [bug] Always call dns_adb_endudpfetch() after calling
dns_adb_beginudpfetch() for UDP queries in resolver.c,
in order to adjust back the quota. [GL #3598]
6000. [bug] Fix a startup issue on Solaris systems with many
(reportedly > 510) CPUs. Thanks to Stacey Marshall from
Oracle for deep investigation of the problem. [GL #3563]
5999. [bug] rpz-ip rules could be ineffective in some scenarios
with CD=1 queries. [GL #3247]
5998. [placeholder]
5997. [cleanup] Less ceremonial UNEXPECTED_ERROR() and FATAL_ERROR()
reporting macros. [GL !6914]
5996. [bug] Fix a couple of bugs in cfg_print_duration(), which
could result in generating incomplete duration values
when printing the configuration using named-checkconf.
[GL !6880]
5995. [performance] A new algorithm for DNS name compression based on a
hash set of message offsets. Name compression is now
more complete as well as being generally faster, and
the implementation is less complicated and requires
much less memory. [GL !6517]
5994. [func] Refactor the isc_httpd implementation used in the
statistics channel. [GL !6879]
5993. [cleanup] Store dns_name_t attributes as boolean members of
the structure. Remove DNS_NAMEATTR_* macros.
Fix latent attribute handling bug in RBT. [GL !6902]
--- 9.19.6 released ---
5992. [func] Introduce the new isc_mem_*x() APIs that takes extra
flags as the last argument. Currently ISC_MEM_ZERO
and ISC_MEM_ALIGN(n) flags have been implemented that
clears the memory to avoid the isc_mem_get()/memset()
pattern and make aligned allocation which replaces the
previous isc_mem_*_aligned() calls. [GL !6398]
5991. [protocol] Add support for parsing and validating "dohpath" to
SVCB. [GL #3544]
5990. [test] fuzz/dns_message_checksig now creates the key directory
it uses when testing in /tmp at run time. [GL #3569]
5989. [func] Implement support for DDNS update forwarding using DoT
to TLS-enabled primary servers. [GL #3512]
5988. [bug] Some out of memory conditions in opensslrsa_link.c
could lead to memory leaks. [GL #3551]
5987. [func] Provide custom isc_mem based allocators for libuv,
OpenSSL and libxml2 libraries that support replacing
the internal allocators. [GL #3559]
5986. [func] Make the memory context debugging options local to
the memory context and make it immutable for the memory
context lifetime. [GL #3559]
5985. [func] Bump the minimal libuv version to 1.34.0. [GL #3567]
5984. [func] 'named -V' now reports the list of supported
DNSSEC/DS/HMAC algorithms and the supported TKEY modes.
[GL #3541]
5983. [bug] Changing just the TSIG key names for primaries in
catalog zones' member zones was not effective.
[GL #3557]
5982. [func] Extend dig to allow requests to be signed using SIG(0)
as well as providing a mechanism to specify the signing
time. [GL !5923]
5981. [test] Add dns_message_checksig fuzzer to check messages
signed using TSIG or SIG(0). [GL !5923]
5980. [func] The internal isc_entropy API provider has been
changed from OpenSSL RAND_bytes() to uv_random()
to use system provided entropy. [GL !6803]
5979. [func] Implement DoT support for nsupdate. [GL #1781]
5978. [port] The ability to use pkcs11 via engine_pkcs11 has been
restored, by only using deprecated APIs in
OpenSSL 3.0.0. BIND needs to be compiled with
'-DOPENSSL_API_COMPAT=10100' specified in the CFLAGS
at compile time. [GL !6711]
5977. [bug] named could incorrectly return non-truncated, glueless
referrals for responses whose size was close to the UDP
packet size limit. [GL #1967]
5976. [cleanup] isc_timer_t objects are now created, started and
destroyed in a particular loop, and timer callbacks
run in that loop. isc_timer_stop() can still be called
from any loop; when run from a different loop than
the one associated with the timer, the request will
be recorded in atomic variable and the timer will
be stopped on the next callback call. [GL #3202]
5975. [func] Implement TLS transport support for dns_request and
dns_dispatch. [GL #3529]
5974. [bug] Fix an assertion failure in dispatch caused by
extra read callback call. [GL #3545]
5973. [bug] Fixed a possible invalid detach in UPDATE
processing. [GL #3522]
5972. [bug] Gracefully handle when the statschannel HTTP connection
gets cancelled during sending data back to the client.
[GL #3542]
5971. [func] Add libsystemd sd_notify() support. [GL #1176]
5970. [func] Log the reason why a query was refused. [GL !6669]
5969. [bug] DNSSEC signing statistics failed to identify the
algorithm involved. The key names have been changed
to be the algorithm number followed by "+" followed
by the key id (e.g. "8+54274"). [GL #3525]
5968. [cleanup] Remove 'resolve' binary from tests. [GL !6733]
5967. [cleanup] Flagged the obsolete "random-device" option as
ancient; it is now an error to configure it. [GL #3399]
5966. [func] You can now specify if a server must return a DNS
COOKIE before accepting the response over UDP.
[GL #2295]
server <prefix> { require-cookie <yes_or_no>; };
5965. [cleanup] Move the duplicated ASCII case conversion tables to
isc_ascii where they can be shared, and replace the
various hot-path tolower() loops with calls to new
isc_ascii implementations. [GL !6516]
5964. [func] When an international domain name is not valid, DiG will
now pass it through unchanged, instead of stopping with
an error message. [GL #3527]
5963. [bug] Ensure struct named_server is properly initialized.
[GL #6531]
--- 9.19.5 released ---
5962. [security] Fix memory leak in EdDSA verify processing.
(CVE-2022-38178) [GL #3487]
5961. [placeholder]
5960. [security] Fix serve-stale crash that could happen when
stale-answer-client-timeout was set to 0 and there was
a stale CNAME in the cache for an incoming query.
(CVE-2022-3080) [GL #3517]
5959. [security] Fix memory leaks in the DH code when using OpenSSL 3.0.0
and later versions. The openssldh_compare(),
openssldh_paramcompare(), and openssldh_todns()
functions were affected. (CVE-2022-2906) [GL #3491]
5958. [security] When an HTTP connection was reused to get
statistics from the stats channel, and zlib
compression was in use, each successive
response sent larger and larger blocks of memory,
potentially reading past the end of the allocated
buffer. (CVE-2022-2881) [GL #3493]
5957. [security] Prevent excessive resource use while processing large
delegations. (CVE-2022-2795) [GL #3394]
5956. [func] Make RRL code treat all QNAMEs that are subject to
wildcard processing within a given zone as the same
name. [GL #3459]
5955. [port] The libxml2 library has deprecated the usage of
xmlInitThreads() and xmlCleanupThreads() functions. Use
xmlInitParser() and xmlCleanupParser() instead.
[GL #3518]
5954. [func] Fallback to IDNA2003 processing in dig when IDNA2008
conversion fails. [GL #3485]
5953. [bug] Fix a crash on shutdown in delete_trace_entry(). Add
mctx attach/detach pair to make sure that the memory
context used by a memory pool is not destroyed before
the memory pool itself. [GL #3515]
5952. [bug] Use quotes around address strings in YAML output.
[GL #3511]
5951. [bug] In some cases, the dnstap query_message field was
erroneously set when logging response messages.
[GL #3501]
5950. [func] Implement a feature to set an Extended DNS Error (EDE)
code on responses modified by RPZ. [GL #3410]
5949. [func] Add new isc_loopmgr API that runs the application
event loops and completely replaces the isc_app
API. Refactor the isc_taskmgr, isc_timermgr and
isc_netmgr to use the isc_loopmgr event loops.
[GL #3508]
5948. [bug] Fix nsec3.c:dns_nsec3_activex() function, add a missing
dns_db_detachnode() call. [GL #3500]
5947. [func] Change dnssec-policy to allow graceful transition from
an NSEC only zone to NSEC3. [GL #3486]
5946. [bug] Fix statistics channel's handling of multiple HTTP
requests in a single connection which have non-empty
request bodies. [GL #3463]
5945. [bug] If parsing /etc/bind.key failed, delv could assert
when trying to parse the built in trust anchors as
the parser hadn't been reset. [GL !6468]
5944. [bug] Fix +http-plain-get and +http-plain-post options
support in dig. Thanks to Marco Davids at SIDN for
reporting the problem. [GL !6672]
5943. [placeholder]
5942. [bug] Fix tkey.c:buildquery() function's error handling by
adding the missing cleanup code. [GL #3492]
5941. [func] Zones with dnssec-policy now require dynamic DNS or
inline-siging to be configured explicitly. [GL #3381]
5940. [placeholder]
5939. [placeholder]
5938. [bug] An integer type overflow could cause an assertion
failure when freeing memory. [GL #3483]
5937. [cleanup] The dns_rdatalist_tordataset() and
dns_rdatalist_fromrdataset() functions can no
longer fail. Clean up their prototypes and error
handling, and that of other calling functions that
subsequently cannot fail, including
dns_message_setquerytsig(). [GL #3467]
5936. [bug] Don't enable serve-stale for lookups that error because
it is a duplicate query or a query that would be
dropped. [GL #2982]
5935. [bug] Fix DiG lookup reference counting bug, which could
be observed in NSSEARCH mode. [GL #3478]
--- 9.19.4 released ---
5934. [func] Improve fetches-per-zone fetch limit logging to log
the final allowed and spilled values of the fetch
counters before the counter object gets destroyed.
[GL #3461]
5933. [port] Automatically disable RSASHA1 and NSEC3RSASHA1 in
named on Fedorda 33, Oracle Linux 9 and RHEL9 when
they are disabled by the security policy. [GL #3469]
5932. [bug] Fix rndc dumpdb -expired and always include expired
RRsets, not just for RBTDB_VIRTUAL time window.
[GL #3462]
5931. [bug] Fix DiG query error handling robustness in NSSEARCH
mode by making sure that udp_ready(), tcp_connected(),
and send_done() callbacks start the next query in chain
even if there is some kind of error with the previous
query. [GL #3419]
5930. [bug] Fix DiG query retry and fail-over bug in UDP mode.
Also simplify the overall retry and fail-over logic to
make it behave predictably, and always respect the
documented +retry/+tries count set by a command-line
option (or use the default values of 2 or 3
respectively). [GL #3407]
5929. [func] The use of the "max-zone-ttl" option in "zone" and
"options" blocks is now deprecated; this should
now be configured as part of "dnssec-policy"
instead. The old option still works in zones
with no "dnssec-policy" configured, but a warning
will be logged when loading configuration. Its
functionality will be removed in a future release.
Using "max-zone-ttl" and "dnssec-policy" in the
same zone is now a fatal error. [GL #2918]
5928. [placeholder]
5927. [bug] A race was possible in dns_dispatch_connect()
that could trigger an assertion failure if two
threads called it near-simultaneously. [GL #3456]
5926. [func] Handle transient TCP connect() EADDRINUSE failures
on FreeBSD (and possibly other BSDs) by trying three
times before giving up. [GL #3451]
5925. [bug] With a forwarder configured for all queries, resolution
failures encountered during DS chasing could trigger
assertion failures due to a logic bug in
resume_dslookup() that caused it to call
dns_resolver_createfetch() with an invalid name.
[GL #3439]
5924. [func] When it's necessary to use AXFR to respond to an
IXFR request, a message explaining the reason
is now logged at level info. [GL #2683]
5923. [bug] Fix inheritance for dnssec-policy when checking for
inline-signing. [GL #3438]
5922. [bug] Forwarding of UPDATE message could fail with the
introduction of netmgr. This has been fixed. [GL #3389]
5921. [test] Convert system tests to use a default DNSKEY algorithm
where the test is not DNSKEY algorithm specific.
[GL #3440]
5920. [bug] Don't pass back the current name offset when the
compression is disabled in the non-improving case.
[GL #3423]
--- 9.19.3 released ---
5919. [func] The "rndc fetchlimit" command lists name servers
+2 -1
View File
@@ -2,6 +2,7 @@ SPHINX_V = $(SPHINX_V_@AM_V@)
SPHINX_V_ = $(SPHINX_V_@AM_DEFAULT_V@)
SPHINX_V_0 = -q
SPHINX_V_1 = -n
SPHINX_W = -W
AM_V_SPHINX = $(AM_V_SPHINX_@AM_V@)
AM_V_SPHINX_ = $(AM_V_SPHINX_@AM_DEFAULT_V@)
@@ -20,7 +21,7 @@ SESSION_KEY = .. |session_key| replace:: ``$(runstatedir)/session.key``
export RST_EPILOG = $(RNDC_CONF)$(LF)$(RNDC_KEY)$(LF)$(NAMED_CONF)$(LF)$(BIND_KEYS)$(LF)$(NAMED_PID)$(LF)$(SESSION_KEY)
common_SPHINXOPTS = \
-W \
$(SPHINX_W) \
-c $(srcdir) \
-a \
$(SPHINX_V)
+1
View File
@@ -26,3 +26,4 @@ Some of these settings are:
| `-DISC_MEM_TRACKLINES=0` | Don't track memory allocations by file and line number; this improves performance but makes debugging more difficult |
| `-DNAMED_RUN_PID_DIR=0` | Create default PID files in `${localstatedir}/run` rather than `${localstatedir}/run/named/` |
| `-DNS_CLIENT_DROPPORT=0` | Disable dropping queries from particular well-known ports |
| `-DOPENSSL_API_COMPAT=10100` | Build using the deprecated OpenSSL APIs so that the `engine` API is available when building with OpenSSL 3.0.0 for PKCS#11 support |
+1 -1
View File
@@ -125,7 +125,7 @@ including your patch as an attachment, preferably generated by
### <a name="build"/> Building BIND 9
For information about building BIND 9, see the
["Building BIND 9"](doc/arm/build.rst) section in the BIND 9
["Building BIND 9"](doc/arm/build.inc.rst) section in the BIND 9
Administrator Reference Manual.
### <a name="testing"/> Automated testing
-1
View File
@@ -17,7 +17,6 @@
#include <stdbool.h>
#include <stdlib.h>
#include <isc/app.h>
#include <isc/attributes.h>
#include <isc/commandline.h>
#include <isc/dir.h>
+1 -24
View File
@@ -34,29 +34,6 @@
#include "util.h"
/*%
* Convert algorithm type to string.
*/
const char *
alg_totext(dns_secalg_t alg) {
switch (alg) {
case DST_ALG_HMACMD5:
return ("hmac-md5");
case DST_ALG_HMACSHA1:
return ("hmac-sha1");
case DST_ALG_HMACSHA224:
return ("hmac-sha224");
case DST_ALG_HMACSHA256:
return ("hmac-sha256");
case DST_ALG_HMACSHA384:
return ("hmac-sha384");
case DST_ALG_HMACSHA512:
return ("hmac-sha512");
default:
return ("(unknown)");
}
}
/*%
* Convert string to algorithm type.
*/
@@ -175,7 +152,7 @@ void
write_key_file(const char *keyfile, const char *user, const char *keyname,
isc_buffer_t *secret, dns_secalg_t alg) {
isc_result_t result;
const char *algname = alg_totext(alg);
const char *algname = dst_hmac_algorithm_totext(alg);
FILE *fd = NULL;
DO("create keyfile", isc_file_safecreate(keyfile, &fd));
+1 -1
View File
@@ -222,7 +222,7 @@ main(int argc, char **argv) {
if (keysize < 0) {
keysize = alg_bits(alg);
}
algname = alg_totext(alg);
algname = dst_hmac_algorithm_totext(alg);
isc_mem_create(&mctx);
isc_buffer_init(&key_txtbuffer, &key_txtsecret, sizeof(key_txtsecret));
+1 -1
View File
@@ -208,7 +208,7 @@ main(int argc, char **argv) {
}
/* Use canonical algorithm name */
algname = alg_totext(alg);
algname = dst_hmac_algorithm_totext(alg);
isc_mem_create(&mctx);
+116 -87
View File
@@ -25,7 +25,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <isc/app.h>
#include <isc/attributes.h>
#include <isc/base64.h>
#include <isc/buffer.h>
@@ -81,6 +80,11 @@ char *progname;
static isc_mem_t *mctx = NULL;
static isc_log_t *lctx = NULL;
/* Managers */
static isc_nm_t *netmgr = NULL;
static isc_loopmgr_t *loopmgr = NULL;
static isc_taskmgr_t *taskmgr = NULL;
/* Configurables */
static char *server = NULL;
static const char *port = "53";
@@ -114,6 +118,9 @@ static int num_keys = 0;
static dns_fixedname_t afn;
static dns_name_t *anchor_name = NULL;
static dns_master_style_t *style = NULL;
static dns_fixedname_t qfn;
/* Default bind.keys contents */
static char anchortext[] = TRUST_ANCHORS;
@@ -417,8 +424,7 @@ print_status(dns_rdataset_t *rdataset) {
}
static isc_result_t
printdata(dns_rdataset_t *rdataset, dns_name_t *owner,
dns_master_style_t *style) {
printdata(dns_rdataset_t *rdataset, dns_name_t *owner) {
isc_result_t result = ISC_R_SUCCESS;
static dns_trust_t trust;
static bool first = true;
@@ -512,11 +518,8 @@ cleanup:
}
static isc_result_t
setup_style(dns_master_style_t **stylep) {
setup_style(void) {
isc_result_t result;
dns_master_style_t *style = NULL;
REQUIRE(stylep != NULL && *stylep == NULL);
styleflags |= DNS_STYLEFLAG_REL_OWNER;
if (yaml) {
@@ -557,9 +560,6 @@ setup_style(dns_master_style_t **stylep) {
48, 80, 8, splitwidth, mctx);
}
if (result == ISC_R_SUCCESS) {
*stylep = style;
}
return (result);
}
@@ -845,6 +845,7 @@ setup_dnsseckeys(dns_client_t *client) {
isc_buffer_init(&b, anchortext, sizeof(anchortext) - 1);
isc_buffer_add(&b, sizeof(anchortext) - 1);
cfg_parser_reset(parser);
result = cfg_parse_buffer(parser, &b, NULL, 0,
&cfg_type_bindkeys, 0, &bindkeys);
if (result != ISC_R_SUCCESS) {
@@ -946,10 +947,11 @@ addserver(dns_client_t *client) {
continue;
}
sa = isc_mem_get(mctx, sizeof(*sa));
memset(sa, 0, sizeof(*sa));
*sa = (isc_sockaddr_t){
.length = (unsigned int)cur->ai_addrlen,
};
ISC_LINK_INIT(sa, link);
memmove(&sa->type, cur->ai_addr, cur->ai_addrlen);
sa->length = (unsigned int)cur->ai_addrlen;
ISC_LIST_APPEND(servers, sa, link);
}
freeaddrinfo(res);
@@ -1708,59 +1710,57 @@ get_reverse(char *reverse, size_t len, char *value, bool strict) {
}
}
int
main(int argc, char *argv[]) {
dns_client_t *client = NULL;
isc_result_t result;
dns_fixedname_t qfn;
dns_name_t *query_name, *response_name;
static void
resolve_cb(dns_client_t *client, const dns_name_t *query_name,
dns_namelist_t *namelist, isc_result_t result) {
char namestr[DNS_NAME_FORMATSIZE];
dns_rdataset_t *rdataset;
dns_namelist_t namelist;
unsigned int resopt;
isc_nm_t *netmgr = NULL;
isc_taskmgr_t *taskmgr = NULL;
isc_timermgr_t *timermgr = NULL;
dns_master_style_t *style = NULL;
progname = argv[0];
preparse_args(argc, argv);
argc--;
argv++;
isc_mem_create(&mctx);
result = dst_lib_init(mctx, NULL);
if (result != ISC_R_SUCCESS) {
fatal("dst_lib_init failed: %d", result);
}
isc_managers_create(mctx, 1, 0, &netmgr, &taskmgr, &timermgr);
parse_args(argc, argv);
CHECK(setup_style(&style));
setup_logging(stderr);
/* Create client */
result = dns_client_create(mctx, taskmgr, netmgr, timermgr, 0, &client,
srcaddr4, srcaddr6);
if (result != ISC_R_SUCCESS) {
delv_log(ISC_LOG_ERROR, "dns_client_create: %s",
if (result != ISC_R_SUCCESS && !yaml) {
delv_log(ISC_LOG_ERROR, "resolution failed: %s",
isc_result_totext(result));
goto cleanup;
}
/* Set the nameserver */
if (server != NULL) {
addserver(client);
} else {
findserver(client);
if (yaml) {
printf("type: DELV_RESULT\n");
dns_name_format(query_name, namestr, sizeof(namestr));
printf("query_name: %s\n", namestr);
printf("status: %s\n", isc_result_totext(result));
printf("records:\n");
}
CHECK(setup_dnsseckeys(client));
for (dns_name_t *response_name = ISC_LIST_HEAD(*namelist);
response_name != NULL;
response_name = ISC_LIST_NEXT(response_name, link))
{
for (rdataset = ISC_LIST_HEAD(response_name->list);
rdataset != NULL; rdataset = ISC_LIST_NEXT(rdataset, link))
{
result = printdata(rdataset, response_name);
if (result != ISC_R_SUCCESS) {
delv_log(ISC_LOG_ERROR, "print data failed");
}
}
}
dns_client_freeresanswer(client, namelist);
isc_mem_put(mctx, namelist, sizeof(*namelist));
dns_client_detach(&client);
isc_loopmgr_shutdown(loopmgr);
}
static void
resolve(void *arg) {
dns_client_t *client = arg;
dns_namelist_t *namelist;
unsigned int resopt;
isc_result_t result;
dns_name_t *query_name;
namelist = isc_mem_get(mctx, sizeof(*namelist));
ISC_LIST_INIT(*namelist);
/* Construct QNAME */
CHECK(convert_name(&qfn, &query_name, qname));
@@ -1781,36 +1781,71 @@ main(int argc, char *argv[]) {
}
/* Perform resolution */
ISC_LIST_INIT(namelist);
result = dns_client_resolve(client, query_name, dns_rdataclass_in,
qtype, resopt, &namelist);
if (result != ISC_R_SUCCESS && !yaml) {
qtype, resopt, namelist, resolve_cb);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
return;
cleanup:
if (!yaml) {
delv_log(ISC_LOG_ERROR, "resolution failed: %s",
isc_result_totext(result));
}
if (yaml) {
printf("type: DELV_RESULT\n");
dns_name_format(query_name, namestr, sizeof(namestr));
printf("query_name: %s\n", namestr);
printf("status: %s\n", isc_result_totext(result));
printf("records:\n");
isc_mem_put(mctx, namelist, sizeof(*namelist));
isc_loopmgr_shutdown(loopmgr);
dns_client_detach(&client);
}
int
main(int argc, char *argv[]) {
dns_client_t *client = NULL;
isc_result_t result;
progname = argv[0];
preparse_args(argc, argv);
argc--;
argv++;
isc_managers_create(&mctx, 1, &loopmgr, &netmgr, &taskmgr);
result = dst_lib_init(mctx, NULL);
if (result != ISC_R_SUCCESS) {
fatal("dst_lib_init failed: %d", result);
}
for (response_name = ISC_LIST_HEAD(namelist); response_name != NULL;
response_name = ISC_LIST_NEXT(response_name, link))
{
for (rdataset = ISC_LIST_HEAD(response_name->list);
rdataset != NULL; rdataset = ISC_LIST_NEXT(rdataset, link))
{
result = printdata(rdataset, response_name, style);
if (result != ISC_R_SUCCESS) {
delv_log(ISC_LOG_ERROR, "print data failed");
}
}
parse_args(argc, argv);
CHECK(setup_style());
setup_logging(stderr);
/* Create client */
result = dns_client_create(mctx, loopmgr, taskmgr, netmgr, 0, &client,
srcaddr4, srcaddr6);
if (result != ISC_R_SUCCESS) {
delv_log(ISC_LOG_ERROR, "dns_client_create: %s",
isc_result_totext(result));
goto cleanup;
}
dns_client_freeresanswer(client, &namelist);
/* Set the nameserver */
if (server != NULL) {
addserver(client);
} else {
findserver(client);
}
CHECK(setup_dnsseckeys(client));
isc_loop_setup(isc_loop_main(loopmgr), resolve, client);
isc_loopmgr_run(loopmgr);
cleanup:
if (trust_anchor != NULL) {
@@ -1825,18 +1860,12 @@ cleanup:
if (style != NULL) {
dns_master_styledestroy(&style, mctx);
}
if (client != NULL) {
dns_client_detach(&client);
}
isc_managers_destroy(&netmgr, &taskmgr, &timermgr);
if (lctx != NULL) {
isc_log_destroy(&lctx);
}
isc_mem_detach(&mctx);
isc_log_destroy(&lctx);
dst_lib_destroy();
isc_managers_destroy(&mctx, &loopmgr, &netmgr, &taskmgr);
return (0);
}
+2 -1
View File
@@ -6,7 +6,8 @@ AM_CPPFLAGS += \
$(LIBISCCFG_CFLAGS) \
$(LIBIRS_CFLAGS) \
$(LIBBIND9_CFLAGS) \
$(LIBIDN2_CFLAGS)
$(LIBIDN2_CFLAGS) \
$(LIBUV_CFLAGS)
LDADD += \
libdighost.la \
+79 -78
View File
@@ -19,9 +19,9 @@
#include <stdlib.h>
#include <time.h>
#include <isc/app.h>
#include <isc/attributes.h>
#include <isc/dir.h>
#include <isc/loop.h>
#include <isc/netaddr.h>
#include <isc/parseint.h>
#include <isc/print.h>
@@ -59,7 +59,7 @@
dig_lookup_t *default_lookup = NULL;
static atomic_uintptr_t batchname = 0;
static char *batchname = NULL;
static FILE *batchfp = NULL;
static char *argv0;
static int addresscount = 0;
@@ -235,10 +235,8 @@ help(void) {
" +[no]identify (ID responders in short "
"answers)\n"
#ifdef HAVE_LIBIDN2
" +[no]idnin (Parse IDN names "
"[default=on on tty])\n"
" +[no]idnout (Convert IDN response "
"[default=on on tty])\n"
" +[no]idn (convert international "
"domain names)\n"
#endif /* ifdef HAVE_LIBIDN2 */
" +[no]ignore (Don't revert to TCP for "
"TC responses.)\n"
@@ -259,6 +257,8 @@ help(void) {
"request)\n"
" +padding=### (Set padding block size "
"[0])\n"
" +qid=### (Specify the query ID to "
"use when sending queries)\n"
" +[no]qr (Print question before "
"sending)\n"
" +[no]question (Control display of "
@@ -357,9 +357,11 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
proto = "TLS";
} else if (query->lookup->https_mode) {
if (query->lookup->http_plain) {
proto = "HTTP";
proto = query->lookup->https_get ? "HTTP-GET"
: "HTTP";
} else {
proto = "HTTPS";
proto = query->lookup->https_get ? "HTTPS-GET"
: "HTTPS";
}
} else if (query->lookup->tcp_mode) {
proto = "TCP";
@@ -780,7 +782,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
strlcat(sockstr, "0", sizeof(sockstr));
}
printf(" response_address: %s\n", sockstr);
printf(" response_address: \"%s\"\n", sockstr);
printf(" response_port: %u\n", sport);
}
@@ -797,7 +799,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
strlcat(sockstr, "0", sizeof(sockstr));
}
printf(" query_address: %s\n", sockstr);
printf(" query_address: \"%s\"\n", sockstr);
printf(" query_port: %u\n", sport);
}
@@ -1520,8 +1522,31 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
}
break;
case 'f': /* fail */
FULLCHECK("fail");
lookup->servfail_stops = state;
switch (cmd[1]) {
case 'a':
FULLCHECK("fail");
lookup->servfail_stops = state;
break;
case 'u':
FULLCHECK("fuzztime");
lookup->fuzzing = state;
if (lookup->fuzzing) {
if (value == NULL) {
lookup->fuzztime = 0x622acce1;
break;
}
result = parse_uint(&num, value, 0xffffffff,
"fuzztime");
if (result != ISC_R_SUCCESS) {
warn("Couldn't parse fuzztime");
goto exit_or_usage;
}
lookup->fuzztime = num;
}
break;
default:
goto invalid_option;
}
break;
case 'h':
switch (cmd[1]) {
@@ -1550,12 +1575,12 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
FULLCHECK("http-plain");
break;
case '-':
switch (cmd[6]) {
switch (cmd[11]) {
case 'p':
FULLCHECK("https-plain-post");
FULLCHECK("http-plain-post");
break;
case 'g':
FULLCHECK("https-plain-get");
FULLCHECK("http-plain-get");
lookup->https_get = true;
break;
}
@@ -1611,7 +1636,7 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
break;
case 'i':
switch (cmd[1]) {
case 'd': /* identify */
case 'd':
switch (cmd[2]) {
case 'e':
FULLCHECK("identify");
@@ -1619,33 +1644,28 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
break;
case 'n':
switch (cmd[3]) {
case 'i':
FULLCHECK("idnin");
#ifndef HAVE_LIBIDN2
if (state) {
fprintf(stderr,
";; IDN input support"
" not enabled\n");
}
#else /* ifndef HAVE_LIBIDN2 */
case '\0':
FULLCHECK("idn");
lookup->idnin = state;
#endif /* ifndef HAVE_LIBIDN2 */
break;
case 'o':
FULLCHECK("idnout");
#ifndef HAVE_LIBIDN2
if (state) {
fprintf(stderr,
";; IDN output support"
" not enabled\n");
}
#else /* ifndef HAVE_LIBIDN2 */
lookup->idnout = state;
#endif /* ifndef HAVE_LIBIDN2 */
break;
case 'i': /* (compat) */
FULLCHECK("idnin");
lookup->idnin = state;
break;
case 'o': /* (compat) */
FULLCHECK("idnout");
lookup->idnout = state;
break;
default:
goto invalid_option;
}
#ifndef HAVE_LIBIDN2
if (state) {
printf(";; IDN support "
"is not available\n");
}
#endif /* ifndef HAVE_LIBIDN2 */
break;
default:
goto invalid_option;
@@ -1987,7 +2007,8 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
}
if (!state) {
if (lookup->ecs_addr != NULL) {
isc_mem_free(mctx, lookup->ecs_addr);
isc_mem_put(mctx, lookup->ecs_addr,
sizeof(*lookup->ecs_addr));
lookup->ecs_addr = NULL;
}
break;
@@ -1996,7 +2017,8 @@ plus_option(char *option, bool is_batchfile, bool *need_clone,
lookup->edns = DEFAULT_EDNS_VERSION;
}
if (lookup->ecs_addr != NULL) {
isc_mem_free(mctx, lookup->ecs_addr);
isc_mem_put(mctx, lookup->ecs_addr,
sizeof(*lookup->ecs_addr));
lookup->ecs_addr = NULL;
}
result = parse_netprefix(&lookup->ecs_addr, value);
@@ -2348,7 +2370,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
}
return (value_from_next);
case 'f':
atomic_store(&batchname, (uintptr_t)value);
batchname = value;
return (value_from_next);
case 'k':
strlcpy(keyfile, value, sizeof(keyfile));
@@ -2834,7 +2856,7 @@ parse_args(bool is_batchfile, bool config_only, int argc, char **argv) {
* first entry, then trust the callback in dighost_shutdown
* to get the rest
*/
char *filename = (char *)atomic_load(&batchname);
char *filename = batchname;
if ((filename != NULL) && !(is_batchfile)) {
if (strcmp(filename, "-") == 0) {
batchfp = stdin;
@@ -2898,38 +2920,32 @@ parse_args(bool is_batchfile, bool config_only, int argc, char **argv) {
static void
query_finished(void) {
char batchline[MXNAME];
int bargc;
char *bargv[16];
if (atomic_load(&batchname) == 0) {
isc_app_shutdown();
return;
}
fflush(stdout);
if (feof(batchfp)) {
atomic_store(&batchname, 0);
isc_app_shutdown();
if (batchfp != stdin) {
fclose(batchfp);
}
return;
}
if (fgets(batchline, sizeof(batchline), batchfp) != 0) {
if (batchname != NULL && !feof(batchfp) &&
fgets(batchline, sizeof(batchline), batchfp) != NULL)
{
int bargc;
char *bargv[16];
debug("batch line %s", batchline);
bargc = split_batchline(batchline, bargv, 14, "batch argv");
bargv[0] = argv0;
parse_args(true, false, bargc, (char **)bargv);
start_lookup();
} else {
atomic_store(&batchname, 0);
return;
}
debug("shutdown");
/* We are done */
if (batchname != NULL) {
if (batchfp != stdin) {
fclose(batchfp);
}
isc_app_shutdown();
return;
batchname = NULL;
}
isc_loopmgr_shutdown(loopmgr);
}
static void
@@ -2993,8 +3009,6 @@ dig_comments(dig_lookup_t *lookup, const char *format, ...) {
void
dig_setup(int argc, char **argv) {
isc_result_t result;
ISC_LIST_INIT(lookup_list);
ISC_LIST_INIT(server_list);
ISC_LIST_INIT(search_list);
@@ -3013,9 +3027,6 @@ dig_setup(int argc, char **argv) {
progname = argv[0];
preparse_args(argc, argv);
result = isc_app_start();
check_result(result, "isc_app_start");
setup_libs();
setup_system(ipv4only, ipv6only);
}
@@ -3038,13 +3049,10 @@ dig_query_setup(bool is_batchfile, bool config_only, int argc, char **argv) {
void
dig_startup(void) {
isc_result_t result;
debug("dig_startup()");
result = isc_app_onrun(mctx, global_task, onrun_callback, NULL);
check_result(result, "isc_app_onrun");
isc_app_run();
isc_loopmgr_setup(loopmgr, run_loop, NULL);
isc_loopmgr_run(loopmgr);
}
void
@@ -3055,15 +3063,8 @@ dig_query_start(void) {
void
dig_shutdown(void) {
destroy_lookup(default_lookup);
if (atomic_load(&batchname) != 0) {
if (batchfp != stdin) {
fclose(batchfp);
}
atomic_store(&batchname, 0);
}
cancel_all();
destroy_libs();
isc_app_finish();
}
/*% Main processing routine for dig */
+24 -34
View File
@@ -132,12 +132,14 @@ Options
.. option:: -k keyfile
This option tells :iscman:`named` to sign queries using TSIG using a key read from the given file. Key
files can be generated using :iscman:`tsig-keygen`. When using TSIG
authentication with :program:`dig`, the name server that is queried needs to
know the key and algorithm that is being used. In BIND, this is done
by providing appropriate ``key`` and ``server`` statements in
:iscman:`named.conf`.
This option tells :program:`dig` to sign queries using TSIG or
SIG(0) using a key read from the given file. Key files can be
generated using :iscman:`tsig-keygen`. When using TSIG authentication
with :program:`dig`, the name server that is queried needs to
know the key and algorithm that is being used. In BIND, this is
done by providing appropriate ``key`` and ``server`` statements
in :iscman:`named.conf` for TSIG and by looking up the KEY record
in zone data for SIG(0).
.. option:: -m
@@ -386,6 +388,14 @@ abbreviation is unambiguous; for example, :option:`+cd` is equivalent to
to not try the next server, which is the reverse of normal stub
resolver behavior.
.. option:: +fuzztime[=value], +nofuzztime
This option allows the signing time to be specified when generating
signed messages. If a value is specified it is the seconds since
00:00:00 January 1, 1970 UTC ignoring leap seconds. If no value
is specified 1646972129 (Fri 11 Mar 2022 04:15:29 UTC) is used.
The default is ``+nofuzztime`` and the current time is used.
.. option:: +header-only, +noheader-only
This option sends a query with a DNS header without a question section. The
@@ -432,28 +442,19 @@ abbreviation is unambiguous; for example, :option:`+cd` is equivalent to
form answers are requested, the default is not to show the source
address and port number of the server that provided the answer.
.. option:: +idnin, +noidnin
.. option:: +idn, +noidn
This option processes [or does not process] IDN domain names on input. This requires
``IDN SUPPORT`` to have been enabled at compile time.
Enable or disable IDN processing. By default IDN is enabled for
input query names, and for display when the output is a terminal.
The default is to process IDN input when standard output is a tty.
The IDN processing on input is disabled when :program:`dig` output is redirected
to files, pipes, and other non-tty file descriptors.
.. option:: +idnout, +noidnout
This option converts [or does not convert] puny code on output. This requires
``IDN SUPPORT`` to have been enabled at compile time.
The default is to process puny code on output when standard output is
a tty. The puny code processing on output is disabled when :program:`dig` output
is redirected to files, pipes, and other non-tty file descriptors.
You can also turn off :program:`dig`'s IDN processing by setting
the ``IDN_DISABLE`` environment variable.
.. option:: +ignore, +noignore
This option ignores [or does not ignore] truncation in UDP responses instead of retrying with TCP. By
default, TCP retries are performed.
This option ignores [or does not ignore] truncation in UDP
responses instead of retrying with TCP. By default, TCP retries are
performed.
.. option:: +keepalive, +nokeepalive
@@ -750,17 +751,6 @@ each lookup. The final query has a local query option of :option:`+qr` which
means that :program:`dig` does not print the initial query when it looks up the
NS records for ``isc.org``.
IDN Support
~~~~~~~~~~~
If :program:`dig` has been built with IDN (internationalized domain name)
support, it can accept and display non-ASCII domain names. :program:`dig`
appropriately converts character encoding of a domain name before sending
a request to a DNS server or displaying a reply from the server.
To turn off IDN support, use the parameters
:option:`+idnin` and :option:`+idnout`, or define the ``IDN_DISABLE`` environment
variable.
Return Codes
~~~~~~~~~~~~
+346 -417
View File
File diff suppressed because it is too large Load Diff
+14 -8
View File
@@ -23,6 +23,7 @@
#include <isc/formatcheck.h>
#include <isc/lang.h>
#include <isc/list.h>
#include <isc/loop.h>
#include <isc/magic.h>
#include <isc/mem.h>
#include <isc/netmgr.h>
@@ -105,12 +106,13 @@ typedef struct dig_searchlist dig_searchlist_t;
struct dig_lookup {
unsigned int magic;
isc_refcount_t references;
bool aaonly, adflag, badcookie, besteffort, cdflag, comments,
bool aaonly, adflag, badcookie, besteffort, cdflag, cleared, comments,
dns64prefix, dnssec, doing_xfr, done_as_is, ednsneg, expandaaaa,
expire, header_only, identify, /*%< Append an "on server <foo>"
message */
identify_previous_line, /*% Prepend a "Nameserver <foo>:"
message, with newline and tab */
expire, fuzzing, header_only, identify, /*%< Append an "on
server <foo>" message
*/
identify_previous_line, /*% Prepend a "Nameserver <foo>:"
message, with newline and tab */
idnin, idnout, ignore, multiline, need_search, new_search,
noclass, nocrypto, nottl, ns_search_only, /*%< dig +nssearch,
host -C */
@@ -169,7 +171,6 @@ struct dig_lookup {
unsigned int ednsflags;
dns_opcode_t opcode;
int rrcomments;
unsigned int eoferr;
uint16_t qid;
struct {
bool http_plain;
@@ -188,6 +189,7 @@ struct dig_lookup {
char *tls_key_file;
isc_tlsctx_cache_t *tls_ctx_cache;
};
isc_stdtime_t fuzztime;
};
/*% The dig_query structure */
@@ -264,7 +266,8 @@ extern unsigned int digestbits;
extern dns_tsigkey_t *tsigkey;
extern bool validated;
extern isc_taskmgr_t *taskmgr;
extern isc_task_t *global_task;
extern isc_loopmgr_t *loopmgr;
extern isc_loop_t *mainloop;
extern bool free_now;
extern bool debugging, debugtiming, memdebugging;
extern bool keep_open;
@@ -314,7 +317,10 @@ void
start_lookup(void);
void
onrun_callback(isc_task_t *task, isc_event_t *event);
onrun_callback(void *arg);
void
run_loop(void *arg);
int
dhmain(int argc, char **argv);
+7 -10
View File
@@ -19,9 +19,9 @@
#include <stdbool.h>
#include <stdlib.h>
#include <isc/app.h>
#include <isc/attributes.h>
#include <isc/commandline.h>
#include <isc/loop.h>
#include <isc/netaddr.h>
#include <isc/print.h>
#include <isc/string.h>
@@ -139,7 +139,7 @@ show_usage(void) {
static void
host_shutdown(void) {
(void)isc_app_shutdown();
isc_loopmgr_shutdown(loopmgr);
}
static void
@@ -878,8 +878,6 @@ parse_args(bool is_batchfile, int argc, char **argv) {
int
main(int argc, char **argv) {
isc_result_t result;
tries = 2;
ISC_LIST_INIT(lookup_list);
@@ -897,8 +895,6 @@ main(int argc, char **argv) {
debug("main()");
progname = argv[0];
pre_parse_args(argc, argv);
result = isc_app_start();
check_result(result, "isc_app_start");
setup_libs();
setup_system(ipv4only, ipv6only);
parse_args(false, argc, argv);
@@ -907,11 +903,12 @@ main(int argc, char **argv) {
} else if (keysecret[0] != 0) {
setup_text_key();
}
result = isc_app_onrun(mctx, global_task, onrun_callback, NULL);
check_result(result, "isc_app_onrun");
isc_app_run();
isc_loopmgr_setup(loopmgr, run_loop, NULL);
isc_loopmgr_run(loopmgr);
cancel_all();
destroy_libs();
isc_app_finish();
return ((seen_error == 0) ? 0 : 1);
}
+73 -65
View File
@@ -16,17 +16,20 @@
#include <stdlib.h>
#include <unistd.h>
#include <isc/app.h>
#include <isc/attributes.h>
#include <isc/buffer.h>
#include <isc/commandline.h>
#include <isc/condition.h>
#include <isc/event.h>
#include <isc/job.h>
#include <isc/loop.h>
#include <isc/netaddr.h>
#include <isc/parseint.h>
#include <isc/print.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/util.h>
#include <isc/work.h>
#include <dns/byaddr.h>
#include <dns/fixedname.h>
@@ -41,6 +44,9 @@
#include "dighost.h"
#include "readline.h"
static char cmdlinebuf[COMMSIZE];
static char *cmdline = NULL;
static bool short_form = true, tcpmode = false, tcpmode_set = false,
identify = false, stats = true, comments = true,
section_question = true, section_answer = true,
@@ -53,7 +59,6 @@ static bool interactive;
static bool in_use = false;
static char defclass[MXRD] = "IN";
static char deftype[MXRD] = "A";
static isc_event_t *global_event = NULL;
static int query_error = 1, print_error = 0;
static char domainopt[DNS_NAME_MAXTEXT];
@@ -112,9 +117,6 @@ static const char *rtypetext[] = {
#define N_KNOWN_RRTYPES (sizeof(rtypetext) / sizeof(rtypetext[0]))
static void
getinput(isc_task_t *task, isc_event_t *event);
static char *
rcode_totext(dns_rcode_t rcode) {
static char buf[sizeof("?65535")];
@@ -132,20 +134,6 @@ rcode_totext(dns_rcode_t rcode) {
return (totext.deconsttext);
}
static void
query_finished(void) {
isc_event_t *event = global_event;
debug("dighost_shutdown()");
if (!in_use) {
isc_app_shutdown();
return;
}
isc_task_send(global_task, &event);
}
static void
printsoa(dns_rdata_t *rdata) {
dns_rdata_soa_t soa;
@@ -401,8 +389,6 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
static isc_result_t
printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
bool headers) {
char servtext[ISC_SOCKADDR_FORMATSIZE];
UNUSED(msgbuf);
/* I've we've gotten this far, we've reached a server. */
@@ -411,6 +397,7 @@ printmessage(dig_query_t *query, const isc_buffer_t *msgbuf, dns_message_t *msg,
debug("printmessage()");
if (!default_lookups || query->lookup->rdtype == dns_rdatatype_a) {
char servtext[ISC_SOCKADDR_FORMATSIZE];
isc_sockaddr_format(&query->sockaddr, servtext,
sizeof(servtext));
printf("Server:\t\t%s\n", query->userarg);
@@ -805,10 +792,8 @@ do_next_command(char *input) {
} else if ((strcasecmp(ptr, "server") == 0) ||
(strcasecmp(ptr, "lserver") == 0))
{
isc_app_block();
set_nameserver(arg);
check_ra = false;
isc_app_unblock();
show_settings(true, true);
} else if (strcasecmp(ptr, "exit") == 0) {
in_use = false;
@@ -825,28 +810,31 @@ do_next_command(char *input) {
}
static void
get_next_command(void) {
char cmdlinebuf[COMMSIZE];
char *cmdline, *ptr = NULL;
readline_next_command(void *arg) {
char *ptr = NULL;
isc_app_block();
if (interactive) {
cmdline = ptr = readline("> ");
if (ptr != NULL && *ptr != 0) {
add_history(ptr);
}
} else {
cmdline = fgets(cmdlinebuf, COMMSIZE, stdin);
UNUSED(arg);
isc_loopmgr_blocking(loopmgr);
ptr = readline("> ");
isc_loopmgr_nonblocking(loopmgr);
if (ptr == NULL) {
return;
}
isc_app_unblock();
if (cmdline == NULL) {
in_use = false;
} else {
do_next_command(cmdline);
}
if (ptr != NULL) {
free(ptr);
if (*ptr != 0) {
add_history(ptr);
strlcpy(cmdlinebuf, ptr, COMMSIZE);
cmdline = cmdlinebuf;
}
free(ptr);
}
static void
fgets_next_command(void *arg) {
UNUSED(arg);
cmdline = fgets(cmdlinebuf, COMMSIZE, stdin);
}
noreturn static void
@@ -899,25 +887,53 @@ parse_args(int argc, char **argv) {
}
static void
getinput(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
if (global_event == NULL) {
global_event = event;
}
while (in_use) {
get_next_command();
start_next_command(void);
static void
process_next_command(void *arg __attribute__((__unused__))) {
if (cmdline == NULL) {
in_use = false;
} else {
do_next_command(cmdline);
if (ISC_LIST_HEAD(lookup_list) != NULL) {
start_lookup();
isc_job_run(loopmgr, run_loop, NULL);
return;
}
}
isc_app_shutdown();
start_next_command();
}
static void
start_next_command(void) {
isc_loop_t *loop = isc_loop_main(loopmgr);
if (!in_use) {
isc_loopmgr_shutdown(loopmgr);
return;
}
cmdline = NULL;
isc_loopmgr_pause(loopmgr);
if (interactive) {
isc_work_enqueue(loop, readline_next_command,
process_next_command, loop);
} else {
isc_work_enqueue(loop, fgets_next_command, process_next_command,
loop);
}
isc_loopmgr_resume(loopmgr);
}
static void
read_loop(void *arg) {
UNUSED(arg);
start_next_command();
}
int
main(int argc, char **argv) {
isc_result_t result;
interactive = isatty(0);
ISC_LIST_INIT(lookup_list);
@@ -930,10 +946,7 @@ main(int argc, char **argv) {
dighost_printmessage = printmessage;
dighost_received = received;
dighost_trying = trying;
dighost_shutdown = query_finished;
result = isc_app_start();
check_result(result, "isc_app_start");
dighost_shutdown = start_next_command;
setup_libs();
progname = argv[0];
@@ -949,23 +962,18 @@ main(int argc, char **argv) {
set_search_domain(domainopt);
}
if (in_use) {
result = isc_app_onrun(mctx, global_task, onrun_callback, NULL);
isc_loopmgr_setup(loopmgr, run_loop, NULL);
} else {
result = isc_app_onrun(mctx, global_task, getinput, NULL);
isc_loopmgr_setup(loopmgr, read_loop, NULL);
}
check_result(result, "isc_app_onrun");
in_use = !in_use;
(void)isc_app_run();
isc_loopmgr_run(loopmgr);
puts("");
debug("done, and starting to shut down");
if (global_event != NULL) {
isc_event_free(&global_event);
}
cancel_all();
destroy_libs();
isc_app_finish();
return (query_error | print_error);
}
+10 -11
View File
@@ -519,7 +519,7 @@ match_keyset_dsset(dns_rdataset_t *keyset, dns_rdataset_t *dsset,
nkey = dns_rdataset_count(keyset);
keytable = isc_mem_get(mctx, sizeof(keyinfo_t) * nkey);
keytable = isc_mem_getx(mctx, sizeof(keytable[0]) * nkey, ISC_MEM_ZERO);
for (result = dns_rdataset_first(keyset), i = 0;
result == ISC_R_SUCCESS; result = dns_rdataset_next(keyset), i++)
@@ -575,7 +575,7 @@ free_keytable(keyinfo_t **keytable_p) {
}
}
isc_mem_put(mctx, keytable, sizeof(keyinfo_t) * nkey);
isc_mem_put(mctx, keytable, sizeof(keytable[0]) * nkey);
}
/*
@@ -594,8 +594,7 @@ matching_sigs(keyinfo_t *keytbl, dns_rdataset_t *rdataset,
dns_secalg_t *algo;
int i;
algo = isc_mem_get(mctx, nkey);
memset(algo, 0, nkey);
algo = isc_mem_getx(mctx, nkey * sizeof(algo[0]), ISC_MEM_ZERO);
for (result = dns_rdataset_first(sigset); result == ISC_R_SUCCESS;
result = dns_rdataset_next(sigset))
@@ -677,7 +676,7 @@ signed_loose(dns_secalg_t *algo) {
ok = true;
}
}
isc_mem_put(mctx, algo, nkey);
isc_mem_put(mctx, algo, nkey * sizeof(algo[0]));
return (ok);
}
@@ -808,12 +807,13 @@ append_new_ds_set(ds_maker_func_t *ds_from_rdata, isc_buffer_t *buf,
static void
make_new_ds_set(ds_maker_func_t *ds_from_rdata, uint32_t ttl,
dns_rdataset_t *crdset) {
isc_result_t result;
dns_rdatalist_t *dslist;
unsigned int size = 16;
unsigned i, n;
for (;;) {
isc_result_t result = ISC_R_SUCCESS;
dns_rdatalist_t *dslist = NULL;
size_t n;
dslist = isc_mem_get(mctx, sizeof(*dslist));
dns_rdatalist_init(dslist);
dslist->rdclass = rdclass;
@@ -821,13 +821,12 @@ make_new_ds_set(ds_maker_func_t *ds_from_rdata, uint32_t ttl,
dslist->ttl = ttl;
dns_rdataset_init(&new_ds_set);
result = dns_rdatalist_tordataset(dslist, &new_ds_set);
check_result(result, "dns_rdatalist_tordataset(dslist)");
dns_rdatalist_tordataset(dslist, &new_ds_set);
isc_buffer_allocate(mctx, &new_ds_buf, size);
n = sizeof(dtype) / sizeof(dtype[0]);
for (i = 0; i < n && dtype[i] != 0; i++) {
for (size_t i = 0; i < n && dtype[i] != 0; i++) {
result = append_new_ds_set(ds_from_rdata, new_ds_buf,
dslist, dtype[i], crdset);
if (result != ISC_R_SUCCESS) {
+1 -1
View File
@@ -314,7 +314,7 @@ emit(dns_dsdigest_t dt, bool showall, bool cds, dns_rdata_t *rdata) {
static void
emits(bool showall, bool cds, dns_rdata_t *rdata) {
unsigned i, n;
unsigned int i, n;
n = sizeof(dtype) / sizeof(dtype[0]);
for (i = 0; i < n; i++) {
+82 -86
View File
@@ -33,7 +33,6 @@
#include <time.h>
#include <unistd.h>
#include <isc/app.h>
#include <isc/atomic.h>
#include <isc/attributes.h>
#include <isc/base32.h>
@@ -43,6 +42,8 @@
#include <isc/file.h>
#include <isc/hash.h>
#include <isc/hex.h>
#include <isc/job.h>
#include <isc/loop.h>
#include <isc/managers.h>
#include <isc/md.h>
#include <isc/mem.h>
@@ -57,6 +58,7 @@
#include <isc/stdio.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/tid.h>
#include <isc/time.h>
#include <isc/util.h>
@@ -145,6 +147,7 @@ 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_loopmgr_t *loopmgr = NULL;
static isc_taskmgr_t *taskmgr = NULL;
static dns_db_t *gdb; /* The database */
static dns_dbversion_t *gversion; /* The database version */
@@ -156,7 +159,7 @@ static dns_iterations_t nsec3iter = 0U;
static unsigned char saltbuf[255];
static unsigned char *gsalt = saltbuf;
static size_t salt_length = 0;
static isc_task_t *main_task = NULL;
static isc_task_t *write_task = NULL;
static unsigned int ntasks = 0;
static atomic_bool shuttingdown;
static atomic_bool finished;
@@ -212,7 +215,7 @@ dumpnode(dns_name_t *name, dns_dbnode_t *node) {
isc_buffer_t *buffer = NULL;
isc_region_t r;
isc_result_t result;
unsigned bufsize = 4096;
unsigned int bufsize = 4096;
if (outputformat != dns_masterformat_text) {
return;
@@ -1567,7 +1570,9 @@ signapex(void) {
result = dns_dbiterator_current(gdbiter, &node, name);
check_dns_dbiterator_current(result);
signname(node, name);
LOCK(&namelock);
dumpnode(name, node);
UNLOCK(&namelock);
cleannode(gdb, gversion, node);
dns_db_detachnode(gdb, &node);
result = dns_dbiterator_first(gdbiter);
@@ -1584,11 +1589,11 @@ signapex(void) {
* lock.
*/
static void
assignwork(isc_task_t *task, isc_task_t *worker) {
dns_fixedname_t *fname;
dns_name_t *name;
dns_dbnode_t *node;
sevent_t *sevent;
assignwork(isc_task_t *task) {
dns_fixedname_t *fname = NULL;
dns_name_t *name = NULL;
dns_dbnode_t *node = NULL;
sevent_t *sevent = NULL;
dns_rdataset_t nsec;
bool found;
isc_result_t result;
@@ -1604,8 +1609,8 @@ assignwork(isc_task_t *task, isc_task_t *worker) {
if (atomic_load(&finished)) {
ended++;
if (ended == ntasks) {
isc_task_detach(&task);
isc_app_shutdown();
isc_task_detach(&write_task);
isc_loopmgr_shutdown(loopmgr);
}
goto unlock;
}
@@ -1679,8 +1684,8 @@ assignwork(isc_task_t *task, isc_task_t *worker) {
if (!found) {
ended++;
if (ended == ntasks) {
isc_task_detach(&task);
isc_app_shutdown();
isc_task_detach(&write_task);
isc_loopmgr_shutdown(loopmgr);
}
isc_mem_put(mctx, fname, sizeof(dns_fixedname_t));
goto unlock;
@@ -1690,7 +1695,7 @@ assignwork(isc_task_t *task, isc_task_t *worker) {
sevent->node = node;
sevent->fname = fname;
isc_task_send(worker, ISC_EVENT_PTR(&sevent));
isc_task_send(task, ISC_EVENT_PTR(&sevent));
unlock:
UNLOCK(&namelock);
}
@@ -1699,12 +1704,30 @@ unlock:
* Start a worker task
*/
static void
startworker(isc_task_t *task, isc_event_t *event) {
isc_task_t *worker;
startworker(void *arg) {
isc_task_t **tasks = (isc_task_t **)arg;
isc_result_t result;
int tid;
worker = (isc_task_t *)event->ev_arg;
assignwork(task, worker);
isc_event_free(&event);
REQUIRE(tasks != NULL);
tid = isc_tid();
result = isc_task_create(taskmgr, &tasks[tid], tid);
if (result != ISC_R_SUCCESS) {
fatal("failed to create task: %s", isc_result_totext(result));
}
assignwork(tasks[tid]);
}
/*%
* Finish a worker task
*/
static void
workerdone(void *arg) {
isc_task_t **tasks = (isc_task_t **)arg;
isc_task_detach(&tasks[isc_tid()]);
}
/*%
@@ -1712,15 +1735,15 @@ startworker(isc_task_t *task, isc_event_t *event) {
*/
static void
writenode(isc_task_t *task, isc_event_t *event) {
isc_task_t *worker;
sevent_t *sevent = (sevent_t *)event;
worker = (isc_task_t *)event->ev_sender;
LOCK(&namelock);
dumpnode(dns_fixedname_name(sevent->fname), sevent->node);
UNLOCK(&namelock);
cleannode(gdb, gversion, sevent->node);
dns_db_detachnode(gdb, &sevent->node);
isc_mem_put(mctx, sevent->fname, sizeof(dns_fixedname_t));
assignwork(task, worker);
assignwork(task);
isc_event_free(&event);
}
@@ -1733,18 +1756,20 @@ sign(isc_task_t *task, isc_event_t *event) {
dns_dbnode_t *node;
sevent_t *sevent, *wevent;
UNUSED(task);
sevent = (sevent_t *)event;
node = sevent->node;
fname = sevent->fname;
isc_event_free(&event);
signname(node, dns_fixedname_name(fname));
wevent = (sevent_t *)isc_event_allocate(mctx, task, SIGNER_EVENT_WRITE,
writenode, NULL,
sizeof(sevent_t));
wevent = (sevent_t *)isc_event_allocate(mctx, write_task,
SIGNER_EVENT_WRITE, writenode,
NULL, sizeof(sevent_t));
wevent->node = node;
wevent->fname = fname;
isc_task_send(main_task, ISC_EVENT_PTR(&wevent));
isc_task_send(write_task, ISC_EVENT_PTR(&wevent));
}
/*%
@@ -2040,8 +2065,7 @@ addnsec3param(const unsigned char *salt, size_t salt_len,
rdatalist.rdclass = rdata.rdclass;
rdatalist.type = rdata.type;
ISC_LIST_APPEND(rdatalist.rdata, &rdata, link);
result = dns_rdatalist_tordataset(&rdatalist, &rdataset);
check_result(result, "dns_rdatalist_tordataset()");
dns_rdatalist_tordataset(&rdatalist, &rdataset);
result = dns_db_findnode(gdb, gorigin, true, &node);
check_result(result, "dns_db_findnode(gorigin)");
@@ -2102,8 +2126,7 @@ addnsec3(dns_name_t *name, dns_dbnode_t *node, const unsigned char *salt,
rdatalist.type = rdata.type;
rdatalist.ttl = ttl;
ISC_LIST_APPEND(rdatalist.rdata, &rdata, link);
result = dns_rdatalist_tordataset(&rdatalist, &rdataset);
check_result(result, "dns_rdatalist_tordataset()");
dns_rdatalist_tordataset(&rdatalist, &rdataset);
result = dns_db_findnsec3node(gdb, dns_fixedname_name(&hashname), true,
&nsec3node);
check_result(result, "addnsec3: dns_db_findnode()");
@@ -2204,8 +2227,7 @@ nsec3clean(dns_name_t *name, dns_dbnode_t *node, unsigned int hashalg,
dns_rdata_init(&delrdata);
dns_rdata_clone(&rdata, &delrdata);
ISC_LIST_APPEND(rdatalist.rdata, &delrdata, link);
result = dns_rdatalist_tordataset(&rdatalist, &delrdataset);
check_result(result, "dns_rdatalist_tordataset()");
dns_rdatalist_tordataset(&rdatalist, &delrdataset);
result = dns_db_subtractrdataset(gdb, node, gversion,
&delrdataset, 0, NULL);
dns_rdataset_disassociate(&delrdataset);
@@ -3327,7 +3349,7 @@ print_stats(isc_time_t *timer_start, isc_time_t *timer_finish,
int
main(int argc, char *argv[]) {
int i, ch;
int ch;
char *startstr = NULL, *endstr = NULL, *classname = NULL;
char *dnskey_endstr = NULL;
char *origin = NULL, *file = NULL, *output = NULL;
@@ -3388,12 +3410,7 @@ main(int argc, char *argv[]) {
masterstyle = &dns_master_style_explicitttl;
check_result(isc_app_start(), "isc_app_start");
isc_mem_create(&mctx);
isc_commandline_errprint = false;
while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
switch (ch) {
case '3':
@@ -3671,12 +3688,6 @@ main(int argc, char *argv[]) {
}
}
result = dst_lib_init(mctx, engine);
if (result != ISC_R_SUCCESS) {
fatal("could not initialize dst: %s",
isc_result_totext(result));
}
isc_stdtime_get(&now);
if (startstr != NULL) {
@@ -3706,7 +3717,7 @@ main(int argc, char *argv[]) {
}
if (ntasks == 0) {
ntasks = isc_os_ncpus() * 2;
ntasks = isc_os_ncpus();
}
vbprintf(4, "using %d cpus\n", ntasks);
@@ -3716,6 +3727,19 @@ main(int argc, char *argv[]) {
directory = ".";
}
isc_managers_create(&mctx, ntasks, &loopmgr, &netmgr, &taskmgr);
result = isc_task_create(taskmgr, &write_task, 0);
if (result != ISC_R_SUCCESS) {
fatal("failed to create task: %s", isc_result_totext(result));
}
result = dst_lib_init(mctx, engine);
if (result != ISC_R_SUCCESS) {
fatal("could not initialize dst: %s",
isc_result_totext(result));
}
setup_logging(mctx, &log);
argc -= isc_commandline_index;
@@ -3904,7 +3928,7 @@ main(int argc, char *argv[]) {
hashlist_init(&hashlist,
dns_db_nodecount(gdb, dns_dbtree_main) * 2,
hash_length);
result = dns_nsec_nseconly(gdb, gversion, &answer);
result = dns_nsec_nseconly(gdb, gversion, NULL, &answer);
if (result == ISC_R_NOTFOUND) {
fprintf(stderr,
"%s: warning: NSEC3 generation "
@@ -3998,24 +4022,6 @@ main(int argc, char *argv[]) {
print_time(outfp);
print_version(outfp);
isc_managers_create(mctx, ntasks, 0, &netmgr, &taskmgr, NULL);
main_task = NULL;
result = isc_task_create(taskmgr, 0, &main_task, 0);
if (result != ISC_R_SUCCESS) {
fatal("failed to create task: %s", isc_result_totext(result));
}
tasks = isc_mem_get(mctx, ntasks * sizeof(isc_task_t *));
for (i = 0; i < (int)ntasks; i++) {
tasks[i] = NULL;
result = isc_task_create(taskmgr, 0, &tasks[i], i);
if (result != ISC_R_SUCCESS) {
fatal("failed to create task: %s",
isc_result_totext(result));
}
}
isc_mutex_init(&namelock);
if (printstats) {
@@ -4030,27 +4036,21 @@ main(int argc, char *argv[]) {
* There is more work to do. Spread it out over multiple
* processors if possible.
*/
for (i = 0; i < (int)ntasks; i++) {
result = isc_app_onrun(mctx, main_task, startworker,
tasks[i]);
if (result != ISC_R_SUCCESS) {
fatal("failed to start task: %s",
isc_result_totext(result));
}
}
(void)isc_app_run();
tasks = isc_mem_getx(mctx, ntasks * sizeof(isc_task_t *),
ISC_MEM_ZERO);
isc_loopmgr_setup(loopmgr, startworker, tasks);
isc_loopmgr_teardown(loopmgr, workerdone, tasks);
isc_loopmgr_run(loopmgr);
if (!atomic_load(&finished)) {
fatal("process aborted by user");
}
} else {
isc_task_detach(&main_task);
isc_mem_put(mctx, tasks, ntasks * sizeof(isc_task_t *));
}
atomic_store(&shuttingdown, true);
for (i = 0; i < (int)ntasks; i++) {
isc_task_detach(&tasks[i]);
}
isc_managers_destroy(&netmgr, &taskmgr, NULL);
isc_mem_put(mctx, tasks, ntasks * sizeof(isc_task_t *));
postsign();
TIME_NOW(&sign_finish);
@@ -4082,11 +4082,6 @@ main(int argc, char *argv[]) {
check_result(result, "dns_master_dumptostream3");
}
isc_mutex_destroy(&namelock);
if (printstats) {
isc_mutex_destroy(&statslock);
}
if (!output_stdout) {
result = isc_stdio_close(outfp);
check_result(result, "isc_stdio_close");
@@ -4130,15 +4125,16 @@ main(int argc, char *argv[]) {
if (verbose > 10) {
isc_mem_stats(mctx, stdout);
}
isc_mem_destroy(&mctx);
(void)isc_app_finish();
isc_managers_destroy(&mctx, &loopmgr, &netmgr, &taskmgr);
if (printstats) {
TIME_NOW(&timer_finish);
print_stats(&timer_start, &timer_finish, &sign_start,
&sign_finish);
isc_mutex_destroy(&statslock);
}
isc_mutex_destroy(&namelock);
return (vresult == ISC_R_SUCCESS ? 0 : 1);
}
-4
View File
@@ -17,7 +17,6 @@
#include <stdlib.h>
#include <time.h>
#include <isc/app.h>
#include <isc/attributes.h>
#include <isc/base32.h>
#include <isc/commandline.h>
@@ -206,7 +205,6 @@ main(int argc, char *argv[]) {
}
}
isc_commandline_reset = true;
check_result(isc_app_start(), "isc_app_start");
isc_mem_create(&mctx);
@@ -346,7 +344,5 @@ main(int argc, char *argv[]) {
}
isc_mem_destroy(&mctx);
(void)isc_app_finish();
return (result == ISC_R_SUCCESS ? 0 : 1);
}
+1 -1
View File
@@ -406,7 +406,7 @@ cmp_dtype(const void *ap, const void *bp) {
void
add_dtype(unsigned int dt) {
unsigned i, n;
unsigned int i, n;
/* ensure there is space for a zero terminator */
n = sizeof(dtype) / sizeof(dtype[0]) - 1;
+7 -1
View File
@@ -14,6 +14,7 @@ AM_CPPFLAGS += \
$(MAXMINDDB_CFLAGS) \
$(DNSTAP_CFLAGS) \
$(LIBUV_CFLAGS) \
$(LIBSYSTEMD_CFLAGS) \
$(ZLIB_CFLAGS)
if HAVE_JSON_C
@@ -109,7 +110,7 @@ named_LDADD = \
$(MAXMINDDB_LIBS) \
$(DNSTAP_LIBS) \
$(LIBUV_LIBS) \
$(LIBXML2_LIBS) \
$(LIBSYSTEMD_LIBS) \
$(ZLIB_LIBS)
if HAVE_JSON_C
@@ -121,3 +122,8 @@ if HAVE_LIBNGHTTP2
named_LDADD += \
$(LIBNGHTTP2_LIBS)
endif HAVE_LIBNGHTTP2
if HAVE_LIBXML2
named_LDADD += \
$(LIBXML2_LIBS)
endif HAVE_LIBXML2
+14 -27
View File
@@ -681,35 +681,22 @@ named_config_getname(isc_mem_t *mctx, const cfg_obj_t *obj,
return (ISC_R_SUCCESS);
}
#define grow_array(mctx, array, newlen, oldlen) \
if (newlen >= oldlen) { \
size_t newsize = (newlen + 16) * sizeof(array[0]); \
size_t oldsize = oldlen * sizeof(array[0]); \
void *tmp = isc_mem_get(mctx, newsize); \
memset(tmp, 0, newsize); \
if (oldlen != 0) { \
memmove(tmp, array, oldsize); \
isc_mem_put(mctx, array, oldsize); \
} \
array = tmp; \
oldlen = newlen + 16; \
#define grow_array(mctx, array, newlen, oldlen) \
if (newlen >= oldlen) { \
size_t newsize = (newlen + 16) * sizeof(array[0]); \
size_t oldsize = oldlen * sizeof(array[0]); \
array = isc_mem_regetx(mctx, array, oldsize, newsize, \
ISC_MEM_ZERO); \
oldlen = newlen + 16; \
}
#define shrink_array(mctx, array, newlen, oldlen) \
if (newlen < oldlen) { \
void *tmp = NULL; \
size_t newsize = newlen * sizeof(array[0]); \
size_t oldsize = oldlen * sizeof(array[0]); \
if (newlen != 0) { \
tmp = isc_mem_get(mctx, newsize); \
memset(tmp, 0, newsize); \
memmove(tmp, array, newsize); \
} else { \
tmp = NULL; \
} \
isc_mem_put(mctx, array, oldsize); \
array = tmp; \
oldlen = newlen; \
#define shrink_array(mctx, array, newlen, oldlen) \
if (newlen < oldlen) { \
size_t newsize = newlen * sizeof(array[0]); \
size_t oldsize = oldlen * sizeof(array[0]); \
array = isc_mem_regetx(mctx, array, oldsize, newsize, \
ISC_MEM_ZERO); \
oldlen = newlen; \
}
isc_result_t
+2 -4
View File
@@ -15,7 +15,6 @@
#include <stdbool.h>
#include <isc/app.h>
#include <isc/event.h>
#include <isc/lex.h>
#include <isc/mem.h>
@@ -175,9 +174,8 @@ named_control_docommand(isccc_sexpr_t *message, bool readonly,
named_smf_want_disable = 1;
}
/*
* If named_smf_got_instance = 0, named_smf_chroot
* is not relevant and we fall through to
* isc_app_shutdown below.
* If named_smf_got_instance = 0, named_smf_chroot is
* not relevant and we fall through to shutdown below.
*/
#endif /* ifdef HAVE_LIBSCF */
/* Do not flush master files */
+4 -5
View File
@@ -16,7 +16,6 @@
#include <inttypes.h>
#include <stdbool.h>
#include <isc/app.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/event.h>
@@ -49,6 +48,7 @@
#include <named/config.h>
#include <named/control.h>
#include <named/log.h>
#include <named/main.h>
#include <named/server.h>
typedef struct controlkey controlkey_t;
@@ -149,9 +149,7 @@ free_listener(controllistener_t *listener) {
isc_refcount_destroy(&listener->refs);
if (listener->sock != NULL) {
isc_nmsocket_close(&listener->sock);
}
REQUIRE(listener->sock == NULL);
free_controlkeylist(&listener->keys, listener->mctx);
@@ -192,6 +190,7 @@ shutdown_listener(controllistener_t *listener) {
}
isc_nm_stoplistening(listener->sock);
isc_nmsocket_close(&listener->sock);
maybe_free_listener(listener);
}
@@ -226,7 +225,7 @@ control_senddone(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
conn->sending = false;
if (conn->result == ISC_R_SHUTTINGDOWN) {
isc_app_shutdown();
isc_loopmgr_shutdown(named_g_loopmgr);
goto cleanup_sendhandle;
}
+6 -8
View File
@@ -225,12 +225,11 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
isc_mem_create(&mctx);
cd = isc_mem_get(mctx, sizeof(*cd));
memset(cd, 0, sizeof(*cd));
cd->mctx = mctx;
cd->dl_path = isc_mem_strdup(cd->mctx, argv[1]);
cd->dlzname = isc_mem_strdup(cd->mctx, dlzname);
*cd = (dlopen_data_t){
.mctx = mctx,
.dl_path = isc_mem_strdup(mctx, argv[1]),
.dlzname = isc_mem_strdup(mctx, dlzname),
};
/* Initialize the lock */
isc_mutex_init(&cd->lock);
@@ -532,8 +531,7 @@ dlz_dlopen_init(isc_mem_t *mctx) {
mctx, &dlz_dlopen);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"dns_sdlzregister() failed: %s",
UNEXPECTED_ERROR("dns_sdlzregister() failed: %s",
isc_result_totext(result));
result = ISC_R_UNEXPECTED;
}
+7 -7
View File
@@ -25,8 +25,8 @@
#include <string.h>
#include <unistd.h>
#include <isc/app.h>
#include <isc/condition.h>
#include <isc/loop.h>
#include <isc/mutex.h>
#include <isc/thread.h>
#include <isc/util.h>
@@ -126,7 +126,7 @@ fuzz_thread_client(void *arg) {
close(sockfd);
named_server_flushonshutdown(named_g_server,
false);
isc_app_shutdown();
isc_loopmgr_shutdown(named_g_loopmgr);
return (NULL);
}
raise(SIGSTOP);
@@ -159,7 +159,7 @@ fuzz_thread_client(void *arg) {
close(sockfd);
named_server_flushonshutdown(named_g_server, false);
isc_app_shutdown();
isc_loopmgr_shutdown(named_g_loopmgr);
return (NULL);
}
@@ -374,7 +374,7 @@ fuzz_thread_resolver(void *arg) {
close(listenfd);
named_server_flushonshutdown(named_g_server,
false);
isc_app_shutdown();
isc_loopmgr_shutdown(named_g_loopmgr);
return (NULL);
}
raise(SIGSTOP);
@@ -574,7 +574,7 @@ fuzz_thread_resolver(void *arg) {
close(sockfd);
close(listenfd);
named_server_flushonshutdown(named_g_server, false);
isc_app_shutdown();
isc_loopmgr_shutdown(named_g_loopmgr);
#ifdef __AFL_LOOP
/*
@@ -716,7 +716,7 @@ fuzz_thread_tcp(void *arg) {
free(buf);
close(sockfd);
named_server_flushonshutdown(named_g_server, false);
isc_app_shutdown();
isc_loopmgr_shutdown(named_g_loopmgr);
return (NULL);
}
@@ -733,7 +733,7 @@ named_fuzz_notify(void) {
#ifdef ENABLE_AFL
if (getenv("AFL_CMIN")) {
named_server_flushonshutdown(named_g_server, false);
isc_app_shutdown();
isc_loopmgr_shutdown(named_g_loopmgr);
return;
}
+17 -15
View File
@@ -18,6 +18,7 @@
#include <stdbool.h>
#include <isc/log.h>
#include <isc/loop.h>
#include <isc/net.h>
#include <isc/netmgr.h>
#include <isc/rwlock.h>
@@ -50,6 +51,8 @@ EXTERN isc_mem_t *named_g_mctx INIT(NULL);
EXTERN unsigned int named_g_cpus INIT(0);
EXTERN unsigned int named_g_udpdisp INIT(0);
EXTERN isc_taskmgr_t *named_g_taskmgr INIT(NULL);
EXTERN isc_loop_t *named_g_mainloop INIT(NULL);
EXTERN isc_loopmgr_t *named_g_loopmgr INIT(NULL);
EXTERN dns_dispatchmgr_t *named_g_dispatchmgr INIT(NULL);
EXTERN unsigned int named_g_cpus_detected INIT(1);
@@ -61,21 +64,20 @@ EXTERN bool named_g_run_done INIT(false);
* for really short timers, another for client timers, and one
* for zone timers.
*/
EXTERN isc_timermgr_t *named_g_timermgr 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);
EXTERN const char *named_g_product INIT(PACKAGE_NAME);
EXTERN const char *named_g_description INIT(PACKAGE_DESCRIPTION);
EXTERN const char *named_g_srcid INIT(PACKAGE_SRCID);
EXTERN const char *named_g_configargs INIT(PACKAGE_CONFIGARGS);
EXTERN const char *named_g_builder INIT(PACKAGE_BUILDER);
EXTERN in_port_t named_g_port INIT(0);
EXTERN in_port_t named_g_tlsport INIT(0);
EXTERN in_port_t named_g_httpsport INIT(0);
EXTERN in_port_t named_g_httpport INIT(0);
EXTERN isc_dscp_t named_g_dscp INIT(-1);
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);
EXTERN const char *named_g_product INIT(PACKAGE_NAME);
EXTERN const char *named_g_description INIT(PACKAGE_DESCRIPTION);
EXTERN const char *named_g_srcid INIT(PACKAGE_SRCID);
EXTERN const char *named_g_configargs INIT(PACKAGE_CONFIGARGS);
EXTERN const char *named_g_builder INIT(PACKAGE_BUILDER);
EXTERN in_port_t named_g_port INIT(0);
EXTERN in_port_t named_g_tlsport INIT(0);
EXTERN in_port_t named_g_httpsport INIT(0);
EXTERN in_port_t named_g_httpport INIT(0);
EXTERN isc_dscp_t named_g_dscp INIT(-1);
EXTERN in_port_t named_g_http_listener_clients INIT(0);
EXTERN in_port_t named_g_http_streams_per_conn INIT(0);
+3
View File
@@ -34,3 +34,6 @@ named_main_earlywarning(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
void
named_main_setmemstats(const char *);
void
named_main_shutdown(void *arg, int signum);
+6 -2
View File
@@ -21,6 +21,7 @@
#include <isc/log.h>
#include <isc/magic.h>
#include <isc/quota.h>
#include <isc/signal.h>
#include <isc/sockaddr.h>
#include <isc/tls.h>
#include <isc/types.h>
@@ -42,7 +43,8 @@
#define NAMED_EVENT_DELZONE (NAMED_EVENTCLASS + 1)
#define NAMED_EVENT_COMMAND (NAMED_EVENTCLASS + 2)
#define NAMED_EVENT_TATSEND (NAMED_EVENTCLASS + 3)
#define NAMED_EVENT_SHUTDOWN (NAMED_EVENTCLASS + 4)
#define NAMED_EVENT_RUN (NAMED_EVENTCLASS + 4)
#define NAMED_EVENT_SHUTDOWN (NAMED_EVENTCLASS + 5)
/*%
* Name server state. Better here than in lots of separate global variables.
@@ -116,6 +118,8 @@ struct named_server {
isc_tlsctx_cache_t *tlsctx_server_cache;
isc_tlsctx_cache_t *tlsctx_client_cache;
isc_signal_t *sighup;
};
#define NAMED_SERVER_MAGIC ISC_MAGIC('S', 'V', 'E', 'R')
@@ -142,7 +146,7 @@ named_server_shutdown(named_server_t *server);
*/
void
named_server_reloadwanted(named_server_t *server);
named_server_reloadwanted(void *arg, int signum);
/*%<
* Inform a server that a reload is wanted. This function
* may be called asynchronously, from outside the server's task.
+3 -7
View File
@@ -44,9 +44,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
*/
bool
named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, const cfg_obj_t *config,
cfg_aclconfctx_t *actx);
named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig);
/*%<
* If 'zone' can be safely reconfigured according to the configuration
* data in 'zconfig', return true. If the configuration data is so
@@ -55,12 +53,10 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
*/
bool
named_zone_inlinesigning(dns_zone_t *zone, const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, const cfg_obj_t *config,
cfg_aclconfctx_t *actx);
named_zone_inlinesigning(const cfg_obj_t *zconfig);
/*%<
* Determine if zone uses inline-signing. This is true if inline-signing
* is set to yes, or if there is a dnssec-policy on a non-dynamic zone.
* is set to yes.
*/
isc_result_t
+4 -1
View File
@@ -51,6 +51,7 @@ isc_result_t
named_log_init(bool safe) {
isc_result_t result;
isc_logconfig_t *lcfg = NULL;
isc_mem_t *log_mctx = NULL;
named_g_categories = categories;
named_g_modules = modules;
@@ -58,7 +59,9 @@ named_log_init(bool safe) {
/*
* Setup a logging context.
*/
isc_log_create(named_g_mctx, &named_g_lctx, &lcfg);
isc_mem_create(&log_mctx);
isc_log_create(log_mctx, &named_g_lctx, &lcfg);
isc_mem_detach(&log_mctx);
/*
* named-checktool.c:setup_logging() needs to be kept in sync.
+155 -87
View File
@@ -24,7 +24,6 @@
#include <protobuf-c/protobuf-c.h>
#endif
#include <isc/app.h>
#include <isc/attributes.h>
#include <isc/backtrace.h>
#include <isc/commandline.h>
@@ -38,12 +37,14 @@
#include <isc/print.h>
#include <isc/resource.h>
#include <isc/result.h>
#include <isc/signal.h>
#include <isc/stdio.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/timer.h>
#include <isc/util.h>
#include <isc/uv.h>
#include <isc/xml.h>
#include <dns/dispatch.h>
#include <dns/dyndb.h>
@@ -240,12 +241,12 @@ assertion_failed(const char *file, int line, isc_assertiontype_t type,
}
noreturn static void
library_fatal_error(const char *file, int line, const char *format,
va_list args) ISC_FORMAT_PRINTF(3, 0);
library_fatal_error(const char *file, int line, const char *func,
const char *format, va_list args) ISC_FORMAT_PRINTF(3, 0);
static void
library_fatal_error(const char *file, int line, const char *format,
va_list args) {
library_fatal_error(const char *file, int line, const char *func,
const char *format, va_list args) {
/*
* Handle isc_error_fatal() calls from our libraries.
*/
@@ -259,7 +260,7 @@ library_fatal_error(const char *file, int line, const char *format,
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL,
"%s:%d: fatal error:", file, line);
"%s:%d:%s(): fatal error: ", file, line, func);
isc_log_vwrite(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL, format,
args);
@@ -267,7 +268,7 @@ library_fatal_error(const char *file, int line, const char *format,
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL,
"exiting (due to fatal error in library)");
} else {
fprintf(stderr, "%s:%d: fatal error: ", file, line);
fprintf(stderr, "%s:%d:%s(): fatal error: ", file, line, func);
vfprintf(stderr, format, args);
fprintf(stderr, "\n");
fflush(stderr);
@@ -280,12 +281,13 @@ library_fatal_error(const char *file, int line, const char *format,
}
static void
library_unexpected_error(const char *file, int line, const char *format,
va_list args) ISC_FORMAT_PRINTF(3, 0);
library_unexpected_error(const char *file, int line, const char *func,
const char *format, va_list args)
ISC_FORMAT_PRINTF(3, 0);
static void
library_unexpected_error(const char *file, int line, const char *format,
va_list args) {
library_unexpected_error(const char *file, int line, const char *func,
const char *format, va_list args) {
/*
* Handle isc_error_unexpected() calls from our libraries.
*/
@@ -293,12 +295,13 @@ library_unexpected_error(const char *file, int line, const char *format,
if (named_g_lctx != NULL) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_ERROR,
"%s:%d: unexpected error:", file, line);
"%s:%d:%s(): unexpected error: ", file, line,
func);
isc_log_vwrite(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_ERROR, format,
args);
} else {
fprintf(stderr, "%s:%d: fatal error: ", file, line);
fprintf(stderr, "%s:%d:%s(): fatal error: ", file, line, func);
vfprintf(stderr, format, args);
fprintf(stderr, "\n");
fflush(stderr);
@@ -462,11 +465,104 @@ set_flags(const char *arg, struct flag_def *defs, unsigned int *ret) {
}
}
static void
list_dnssec_algorithms(isc_buffer_t *b) {
for (dst_algorithm_t i = DST_ALG_UNKNOWN; i < DST_MAX_ALGS; i++) {
if (i == DST_ALG_DH || i == DST_ALG_GSSAPI ||
(i >= DST_ALG_HMAC_FIRST && i <= DST_ALG_HMAC_LAST))
{
continue;
}
if (dst_algorithm_supported(i)) {
isc_buffer_putstr(b, " ");
(void)dns_secalg_totext(i, b);
}
}
}
static void
list_ds_algorithms(isc_buffer_t *b) {
for (size_t i = 0; i < 256; i++) {
if (dst_ds_digest_supported(i)) {
isc_buffer_putstr(b, " ");
(void)dns_dsdigest_totext(i, b);
}
}
}
static void
list_hmac_algorithms(isc_buffer_t *b) {
isc_buffer_t sb = *b;
for (dst_algorithm_t i = DST_ALG_HMAC_FIRST; i <= DST_ALG_HMAC_LAST;
i++) {
if (dst_algorithm_supported(i)) {
isc_buffer_putstr(b, " ");
isc_buffer_putstr(b, dst_hmac_algorithm_totext(i));
}
}
for (unsigned char *s = isc_buffer_used(&sb); s != isc_buffer_used(b);
s++) {
*s = toupper(*s);
}
}
static void
logit(isc_buffer_t *b) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_WARNING, "%.*s",
(int)isc_buffer_usedlength(b),
(char *)isc_buffer_base(b));
}
static void
printit(isc_buffer_t *b) {
printf("%.*s\n", (int)isc_buffer_usedlength(b),
(char *)isc_buffer_base(b));
}
static void
format_supported_algorithms(void (*emit)(isc_buffer_t *b)) {
isc_buffer_t b;
char buf[512];
isc_buffer_init(&b, buf, sizeof(buf));
isc_buffer_putstr(&b, "DNSSEC algorithms:");
list_dnssec_algorithms(&b);
(*emit)(&b);
isc_buffer_init(&b, buf, sizeof(buf));
isc_buffer_putstr(&b, "DS algorithms:");
list_ds_algorithms(&b);
(*emit)(&b);
isc_buffer_init(&b, buf, sizeof(buf));
isc_buffer_putstr(&b, "HMAC algorithms:");
list_hmac_algorithms(&b);
(*emit)(&b);
isc_buffer_init(&b, buf, sizeof(buf));
isc_buffer_printf(&b, "TKEY mode 2 support (Diffie-Hellman): %s",
(dst_algorithm_supported(DST_ALG_DH) &&
dst_algorithm_supported(DST_ALG_HMACMD5))
? "yes"
: "non");
(*emit)(&b);
isc_buffer_init(&b, buf, sizeof(buf));
isc_buffer_printf(&b, "TKEY mode 3 support (GSS-API): %s",
dst_algorithm_supported(DST_ALG_GSSAPI) ? "yes"
: "no");
(*emit)(&b);
}
static void
printversion(bool verbose) {
char rndcconf[PATH_MAX], *dot = NULL;
#if defined(HAVE_GEOIP2)
isc_mem_t *mctx = NULL;
isc_result_t result;
isc_buffer_t b;
char buf[512];
#if defined(HAVE_GEOIP2)
cfg_parser_t *parser = NULL;
cfg_obj_t *config = NULL;
const cfg_obj_t *defaults = NULL, *obj = NULL;
@@ -538,7 +634,18 @@ printversion(bool verbose) {
printf("compiled with protobuf-c version: %s\n", PROTOBUF_C_VERSION);
printf("linked to protobuf-c version: %s\n", protobuf_c_version());
#endif /* if defined(HAVE_DNSTAP) */
printf("threads support is enabled\n\n");
printf("threads support is enabled\n");
isc_mem_create(&mctx);
result = dst_lib_init(mctx, named_g_engine);
if (result == ISC_R_SUCCESS) {
isc_buffer_init(&b, buf, sizeof(buf));
format_supported_algorithms(printit);
printf("\n");
} else {
printf("DST initialization failure: %s\n",
isc_result_totext(result));
}
/*
* The default rndc.conf and rndc.key paths are in the same
@@ -564,7 +671,6 @@ printversion(bool verbose) {
printf(" named lock file: %s\n", named_g_defaultlockfile);
#if defined(HAVE_GEOIP2)
#define RTC(x) RUNTIME_CHECK((x) == ISC_R_SUCCESS)
isc_mem_create(&mctx);
RTC(cfg_parser_create(mctx, named_g_lctx, &parser));
RTC(named_config_parsedefaults(parser, &config));
RTC(cfg_map_get(config, "options", &defaults));
@@ -899,13 +1005,14 @@ parse_command_line(int argc, char *argv[]) {
static isc_result_t
create_managers(void) {
isc_result_t result;
/*
* Set the default named_g_cpus if it was not set from the command line
*/
INSIST(named_g_cpus_detected > 0);
if (named_g_cpus == 0) {
named_g_cpus = named_g_cpus_detected;
}
isc_log_write(
named_g_lctx, NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
ISC_LOG_INFO, "found %u CPU%s, using %u worker thread%s",
@@ -922,24 +1029,14 @@ create_managers(void) {
"using %u UDP listener%s per interface", named_g_udpdisp,
named_g_udpdisp == 1 ? "" : "s");
result = isc_managers_create(named_g_mctx, named_g_cpus,
0 /* quantum */, &named_g_netmgr,
&named_g_taskmgr, &named_g_timermgr);
if (result != ISC_R_SUCCESS) {
return (result);
}
isc_managers_create(&named_g_mctx, named_g_cpus, &named_g_loopmgr,
&named_g_netmgr, &named_g_taskmgr);
isc_nm_maxudp(named_g_netmgr, maxudp);
return (ISC_R_SUCCESS);
}
static void
destroy_managers(void) {
isc_managers_destroy(&named_g_netmgr, &named_g_taskmgr,
&named_g_timermgr);
}
static void
setup(void) {
isc_result_t result;
@@ -1011,16 +1108,6 @@ setup(void) {
named_os_daemonize();
}
/*
* We call isc_app_start() here as some versions of FreeBSD's fork()
* destroys all the signal handling it sets up.
*/
result = isc_app_start();
if (result != ISC_R_SUCCESS) {
named_main_earlyfatal("isc_app_start() failed: %s",
isc_result_totext(result));
}
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
"starting %s%s <id:%s>", PACKAGE_STRING,
@@ -1212,6 +1299,12 @@ setup(void) {
ENSURE(named_g_server != NULL);
sctx = named_g_server->sctx;
/*
* Report supported algorithms now that dst_lib_init() has
* been called via named_server_create().
*/
format_supported_algorithms(logit);
/*
* Modify server context according to command line options
*/
@@ -1258,10 +1351,6 @@ setup(void) {
static void
cleanup(void) {
named_server_shutdown(named_g_server);
destroy_managers();
if (named_g_mapped != NULL) {
dns_acl_detach(&named_g_mapped);
}
@@ -1319,8 +1408,7 @@ named_smf_get_instance(char **ins_name, int debug, isc_mem_t *mctx) {
if ((h = scf_handle_create(SCF_VERSION)) == NULL) {
if (debug) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"scf_handle_create() failed: %s",
UNEXPECTED_ERROR("scf_handle_create() failed: %s",
scf_strerror(scf_error()));
}
return (ISC_R_FAILURE);
@@ -1328,8 +1416,7 @@ named_smf_get_instance(char **ins_name, int debug, isc_mem_t *mctx) {
if (scf_handle_bind(h) == -1) {
if (debug) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"scf_handle_bind() failed: %s",
UNEXPECTED_ERROR("scf_handle_bind() failed: %s",
scf_strerror(scf_error()));
}
scf_handle_destroy(h);
@@ -1338,8 +1425,7 @@ named_smf_get_instance(char **ins_name, int debug, isc_mem_t *mctx) {
if ((namelen = scf_myname(h, NULL, 0)) == -1) {
if (debug) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"scf_myname() failed: %s",
UNEXPECTED_ERROR("scf_myname() failed: %s",
scf_strerror(scf_error()));
}
scf_handle_destroy(h);
@@ -1347,8 +1433,7 @@ named_smf_get_instance(char **ins_name, int debug, isc_mem_t *mctx) {
}
if ((instance = isc_mem_allocate(mctx, namelen + 1)) == NULL) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"named_smf_get_instance memory "
UNEXPECTED_ERROR("named_smf_get_instance memory "
"allocation failed: %s",
isc_result_totext(ISC_R_NOMEMORY));
scf_handle_destroy(h);
@@ -1357,8 +1442,7 @@ named_smf_get_instance(char **ins_name, int debug, isc_mem_t *mctx) {
if (scf_myname(h, instance, namelen + 1) == -1) {
if (debug) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"scf_myname() failed: %s",
UNEXPECTED_ERROR("scf_myname() failed: %s",
scf_strerror(scf_error()));
}
scf_handle_destroy(h);
@@ -1385,10 +1469,6 @@ main(int argc, char *argv[]) {
(void)ProfilerStart(NULL);
#endif /* ifdef HAVE_GPERFTOOLS_PROFILER */
#ifdef HAVE_LIBXML2
xmlInitThreads();
#endif /* HAVE_LIBXML2 */
/*
* Technically, this call is superfluous because on startup of the main
* program, the portable "C" locale is selected by default. This
@@ -1453,38 +1533,23 @@ main(int argc, char *argv[]) {
}
}
isc_mem_create(&named_g_mctx);
isc_mem_setname(named_g_mctx, "main");
setup();
isc_mem_setname(named_g_mctx, "main");
INSIST(named_g_server != NULL);
/*
* Start things running and then wait for a shutdown request
* or reload.
* Start things running
*/
do {
result = isc_app_run();
isc_signal_start(named_g_server->sighup);
if (result == ISC_R_RELOAD) {
named_server_reloadwanted(named_g_server);
} else if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_app_run(): %s",
isc_result_totext(result));
/*
* Force exit.
*/
result = ISC_R_SUCCESS;
}
} while (result != ISC_R_SUCCESS);
isc_loopmgr_run(named_g_loopmgr);
#ifdef HAVE_LIBSCF
if (named_smf_want_disable == 1) {
result = named_smf_get_instance(&instance, 1, named_g_mctx);
if (result == ISC_R_SUCCESS && instance != NULL) {
if (smf_disable_instance(instance, 0) != 0) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"smf_disable_instance() "
UNEXPECTED_ERROR("smf_disable_instance() "
"failed for %s : %s",
instance,
scf_strerror(scf_error()));
@@ -1510,21 +1575,24 @@ main(int argc, char *argv[]) {
(void)isc_stdio_close(fp);
}
}
isc_mem_destroy(&named_g_mctx);
isc_managers_destroy(&named_g_mctx, &named_g_loopmgr, &named_g_netmgr,
&named_g_taskmgr);
#if ENABLE_LEAK_DETECTION
isc__tls_setdestroycheck(true);
isc__uv_setdestroycheck(true);
isc__xml_setdestroycheck(true);
#endif
isc_mem_checkdestroyed(stderr);
named_main_setmemstats(NULL);
isc_app_finish();
named_os_closedevnull();
named_os_shutdown();
#ifdef HAVE_LIBXML2
xmlCleanupThreads();
#endif /* HAVE_LIBXML2 */
#ifdef HAVE_GPERFTOOLS_PROFILER
ProfilerStop();
#endif /* ifdef HAVE_GPERFTOOLS_PROFILER */
+13 -8
View File
@@ -96,13 +96,17 @@ Options
.. option:: -M option
This option sets the default memory context options. If set to ``external``,
the internal memory manager is bypassed in favor of
system-provided memory allocation functions. If set to ``fill``, blocks
of memory are filled with tag values when allocated or freed, to
assist debugging of memory problems. ``nofill`` disables this behavior,
and is the default unless :program:`named` has been compiled with developer
options.
This option sets the default (comma-separated) memory context
options. The possible flags are:
- ``fill``: fill blocks of memory with tag values when they are
allocated or freed, to assist debugging of memory problems; this is
the implicit default if :program:`named` has been compiled with
``--enable-developer``.
- ``nofill``: disable the behavior enabled by ``fill``; this is the
implicit default unless :program:`named` has been compiled with
``--enable-developer``.
.. option:: -m flag
@@ -199,7 +203,8 @@ Options
.. option:: -V
This option reports the version number and build options, and exits.
This option reports the version number, build options, supported
cryptographics algorithms, and exits.
.. option:: -X lock-file
+4 -2
View File
@@ -485,13 +485,15 @@ ns_os_uid(void) {
void
named_os_adjustnofile(void) {
#if defined(__linux__)
#if defined(__linux__) || defined(__sun)
isc_result_t result;
isc_resourcevalue_t newvalue;
/*
* Linux: max number of open files specified by one thread doesn't seem
* to apply to other threads on Linux.
* Sun: restriction needs to be removed sooner when hundreds of CPUs
* are available.
*/
newvalue = ISC_RESOURCE_UNLIMITED;
@@ -499,7 +501,7 @@ named_os_adjustnofile(void) {
if (result != ISC_R_SUCCESS) {
named_main_earlywarning("couldn't adjust limit on open files");
}
#endif /* if defined(__linux__) */
#endif /* if defined(__linux__) || defined(__sun) */
}
void
+603 -461
View File
File diff suppressed because it is too large Load Diff
+140 -166
View File
@@ -1713,7 +1713,7 @@ cleanup:
#if defined(EXTENDED_STATS)
static void
dnssecsignstat_dump(dns_keytag_t tag, uint64_t val, void *arg) {
dnssecsignstat_dump(uint32_t kval, uint64_t val, void *arg) {
FILE *fp;
char tagbuf[64];
stats_dumparg_t *dumparg = arg;
@@ -1725,7 +1725,11 @@ dnssecsignstat_dump(dns_keytag_t tag, uint64_t val, void *arg) {
json_object *zoneobj, *obj;
#endif /* ifdef HAVE_JSON_C */
snprintf(tagbuf, sizeof(tagbuf), "%u", tag);
/*
* kval is '(algorithm << 16) | keyid'.
*/
snprintf(tagbuf, sizeof(tagbuf), "%u+%u", (kval >> 16) & 0xff,
kval & 0xffff);
switch (dumparg->type) {
case isc_statsformat_file:
@@ -2372,20 +2376,14 @@ wrap_xmlfree(isc_buffer_t *buffer, void *arg) {
}
static isc_result_t
render_xml(uint32_t flags, const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg, const char **mimetype,
isc_buffer_t *b, isc_httpdfree_t **freecb, void **freecb_args) {
render_xml(uint32_t flags, void *arg, unsigned int *retcode,
const char **retmsg, const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
unsigned char *msg = NULL;
int msglen;
named_server_t *server = arg;
isc_result_t result;
UNUSED(url);
UNUSED(urlinfo);
UNUSED(headers);
UNUSED(querystring);
result = generatexml(server, flags, &msglen, &msg);
if (result == ISC_R_SUCCESS) {
@@ -2406,91 +2404,91 @@ render_xml(uint32_t flags, const char *url, isc_httpdurl_t *urlinfo,
}
static isc_result_t
render_xml_all(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_xml_all(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b, isc_httpdfree_t **freecb,
void **freecb_args) {
return (render_xml(STATS_XML_ALL, url, urlinfo, querystring, headers,
arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_xml(STATS_XML_ALL, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
}
static isc_result_t
render_xml_status(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_xml_status(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
return (render_xml(STATS_XML_STATUS, url, urlinfo, querystring, headers,
arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_xml(STATS_XML_STATUS, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
}
static isc_result_t
render_xml_server(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_xml_server(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
return (render_xml(STATS_XML_SERVER, url, urlinfo, querystring, headers,
arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_xml(STATS_XML_SERVER, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
}
static isc_result_t
render_xml_zones(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_xml_zones(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
return (render_xml(STATS_XML_ZONES, url, urlinfo, querystring, headers,
arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_xml(STATS_XML_ZONES, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
}
static isc_result_t
render_xml_net(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_xml_net(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b, isc_httpdfree_t **freecb,
void **freecb_args) {
return (render_xml(STATS_XML_NET, url, urlinfo, querystring, headers,
arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_xml(STATS_XML_NET, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
}
static isc_result_t
render_xml_tasks(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_xml_tasks(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
return (render_xml(STATS_XML_TASKS, url, urlinfo, querystring, headers,
arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_xml(STATS_XML_TASKS, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
}
static isc_result_t
render_xml_mem(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_xml_mem(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b, isc_httpdfree_t **freecb,
void **freecb_args) {
return (render_xml(STATS_XML_MEM, url, urlinfo, querystring, headers,
arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_xml(STATS_XML_MEM, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
}
static isc_result_t
render_xml_traffic(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_xml_traffic(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
return (render_xml(STATS_XML_TRAFFIC, url, urlinfo, querystring,
headers, arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_xml(STATS_XML_TRAFFIC, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
}
#endif /* HAVE_LIBXML2 */
@@ -3316,10 +3314,9 @@ cleanup:
}
static isc_result_t
render_json(uint32_t flags, const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg, const char **mimetype,
isc_buffer_t *b, isc_httpdfree_t **freecb, void **freecb_args) {
render_json(uint32_t flags, void *arg, unsigned int *retcode,
const char **retmsg, const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
isc_result_t result;
json_object *bindstats = NULL;
named_server_t *server = arg;
@@ -3327,11 +3324,6 @@ render_json(uint32_t flags, const char *url, isc_httpdurl_t *urlinfo,
size_t msglen = 0;
char *p;
UNUSED(url);
UNUSED(urlinfo);
UNUSED(headers);
UNUSED(querystring);
result = generatejson(server, &msglen, &msg, &bindstats, flags);
if (result == ISC_R_SUCCESS) {
*retcode = 200;
@@ -3352,156 +3344,139 @@ render_json(uint32_t flags, const char *url, isc_httpdurl_t *urlinfo,
}
static isc_result_t
render_json_all(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_json_all(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
return (render_json(STATS_JSON_ALL, url, urlinfo, querystring, headers,
arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_json(STATS_JSON_ALL, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
}
static isc_result_t
render_json_status(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_json_status(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
return (render_json(STATS_JSON_STATUS, url, urlinfo, querystring,
headers, arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_json(STATS_JSON_STATUS, arg, retcode, retmsg, mimetype,
b, freecb, freecb_args));
}
static isc_result_t
render_json_server(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_json_server(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
return (render_json(STATS_JSON_SERVER, url, urlinfo, querystring,
headers, arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_json(STATS_JSON_SERVER, arg, retcode, retmsg, mimetype,
b, freecb, freecb_args));
}
static isc_result_t
render_json_zones(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_json_zones(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
return (render_json(STATS_JSON_ZONES, url, urlinfo, querystring,
headers, arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_json(STATS_JSON_ZONES, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
}
static isc_result_t
render_json_mem(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_json_mem(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
return (render_json(STATS_JSON_MEM, url, urlinfo, querystring, headers,
arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_json(STATS_JSON_MEM, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
}
static isc_result_t
render_json_tasks(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_json_tasks(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
return (render_json(STATS_JSON_TASKS, url, urlinfo, querystring,
headers, arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_json(STATS_JSON_TASKS, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
}
static isc_result_t
render_json_net(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_json_net(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
return (render_json(STATS_JSON_NET, url, urlinfo, querystring, headers,
arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_json(STATS_JSON_NET, arg, retcode, retmsg, mimetype, b,
freecb, freecb_args));
}
static isc_result_t
render_json_traffic(const char *url, isc_httpdurl_t *urlinfo,
const char *querystring, const char *headers, void *arg,
unsigned int *retcode, const char **retmsg,
render_json_traffic(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo,
void *arg, unsigned int *retcode, const char **retmsg,
const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
return (render_json(STATS_JSON_TRAFFIC, url, urlinfo, querystring,
headers, arg, retcode, retmsg, mimetype, b, freecb,
freecb_args));
UNUSED(httpd);
UNUSED(urlinfo);
return (render_json(STATS_JSON_TRAFFIC, arg, retcode, retmsg, mimetype,
b, freecb, freecb_args));
}
#endif /* HAVE_JSON_C */
static isc_result_t
render_xsl(const char *url, isc_httpdurl_t *urlinfo, const char *querystring,
const char *headers, void *args, unsigned int *retcode,
const char **retmsg, const char **mimetype, isc_buffer_t *b,
isc_httpdfree_t **freecb, void **freecb_args) {
render_xsl(const isc_httpd_t *httpd, const isc_httpdurl_t *urlinfo, void *args,
unsigned int *retcode, const char **retmsg, const char **mimetype,
isc_buffer_t *b, isc_httpdfree_t **freecb, void **freecb_args) {
isc_result_t result;
char *_headers = NULL;
char *p;
char *p = NULL;
UNUSED(url);
UNUSED(querystring);
UNUSED(httpd);
UNUSED(args);
*freecb = NULL;
*freecb_args = NULL;
*mimetype = "text/xslt+xml";
if (urlinfo->isstatic) {
isc_time_t when;
char *line, *saveptr;
const char *if_modified_since = "If-Modified-Since: ";
_headers = strdup(headers);
if (isc_httpdurl_isstatic(urlinfo)) {
time_t t1, t2;
const isc_time_t *when;
const isc_time_t *loadtime;
if (_headers == NULL) {
when = isc_httpd_if_modified_since(httpd);
if (isc_time_isepoch(when)) {
goto send;
}
saveptr = NULL;
for (line = strtok_r(_headers, "\n", &saveptr); line;
line = strtok_r(NULL, "\n", &saveptr))
{
if (strncasecmp(line, if_modified_since,
strlen(if_modified_since)) == 0) {
time_t t1, t2;
line += strlen(if_modified_since);
result = isc_time_parsehttptimestamp(line,
&when);
if (result != ISC_R_SUCCESS) {
goto send;
}
result = isc_time_secondsastimet(&when, &t1);
if (result != ISC_R_SUCCESS) {
goto send;
}
result = isc_time_secondsastimet(
&urlinfo->loadtime, &t2);
if (result != ISC_R_SUCCESS) {
goto send;
}
if (t1 < t2) {
goto send;
}
*retcode = 304;
*retmsg = "Not modified";
goto end;
}
result = isc_time_secondsastimet(when, &t1);
if (result != ISC_R_SUCCESS) {
goto send;
}
loadtime = isc_httpdurl_loadtime(urlinfo);
result = isc_time_secondsastimet(loadtime, &t2);
if (result != ISC_R_SUCCESS) {
goto send;
}
if (t1 < t2) {
goto send;
}
*retcode = 304;
*retmsg = "Not modified";
goto end;
}
send:
@@ -3511,7 +3486,6 @@ send:
isc_buffer_reinit(b, p, strlen(xslmsg));
isc_buffer_add(b, strlen(xslmsg));
end:
free(_headers);
return (ISC_R_SUCCESS);
}
@@ -3752,7 +3726,7 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
const cfg_listelt_t *element, *element2;
char socktext[ISC_SOCKADDR_FORMATSIZE];
RUNTIME_CHECK(isc_once_do(&once, init_desc) == ISC_R_SUCCESS);
isc_once_do(&once, init_desc);
ISC_LIST_INIT(new_listeners);
@@ -3909,7 +3883,7 @@ named_stats_dump(named_server_t *server, FILE *fp) {
uint64_t sockstat_values[isc_sockstatscounter_max];
uint64_t gluecachestats_values[dns_gluecachestatscounter_max];
RUNTIME_CHECK(isc_once_do(&once, init_desc) == ISC_R_SUCCESS);
isc_once_do(&once, init_desc);
/* Set common fields */
dumparg.type = isc_statsformat_file;
+23 -93
View File
@@ -621,17 +621,14 @@ configure_staticstub(const cfg_obj_t *zconfig, dns_zone_t *zone,
CHECK(dns_db_findnode(db, &apexname, false, &apexnode));
/* Add NS RRset */
RUNTIME_CHECK(dns_rdatalist_tordataset(&rdatalist_ns, &rdataset) ==
ISC_R_SUCCESS);
dns_rdatalist_tordataset(&rdatalist_ns, &rdataset);
CHECK(dns_db_addrdataset(db, apexnode, dbversion, 0, &rdataset, 0,
NULL));
dns_rdataset_disassociate(&rdataset);
/* Add glue A RRset, if any */
if (!ISC_LIST_EMPTY(rdatalist_a.rdata)) {
RUNTIME_CHECK(
dns_rdatalist_tordataset(&rdatalist_a, &rdataset) ==
ISC_R_SUCCESS);
dns_rdatalist_tordataset(&rdatalist_a, &rdataset);
CHECK(dns_db_addrdataset(db, apexnode, dbversion, 0, &rdataset,
0, NULL));
dns_rdataset_disassociate(&rdataset);
@@ -639,9 +636,7 @@ configure_staticstub(const cfg_obj_t *zconfig, dns_zone_t *zone,
/* Add glue AAAA RRset, if any */
if (!ISC_LIST_EMPTY(rdatalist_aaaa.rdata)) {
RUNTIME_CHECK(
dns_rdatalist_tordataset(&rdatalist_aaaa, &rdataset) ==
ISC_R_SUCCESS);
dns_rdatalist_tordataset(&rdatalist_aaaa, &rdataset);
CHECK(dns_db_addrdataset(db, apexnode, dbversion, 0, &rdataset,
0, NULL));
dns_rdataset_disassociate(&rdataset);
@@ -907,6 +902,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_stats_t *dnssecsignstats;
dns_zonestat_level_t statlevel = dns_zonestat_none;
int seconds;
dns_ttl_t maxttl = 0; /* unlimited */
dns_zone_t *mayberaw = (raw != NULL) ? raw : zone;
isc_dscp_t dscp;
@@ -1065,20 +1061,6 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
}
}
obj = NULL;
result = named_config_get(maps, "max-zone-ttl", &obj);
if (result == ISC_R_SUCCESS) {
dns_ttl_t maxttl = 0; /* unlimited */
if (cfg_obj_isduration(obj)) {
maxttl = cfg_obj_asduration(obj);
}
dns_zone_setmaxttl(zone, maxttl);
if (raw != NULL) {
dns_zone_setmaxttl(raw, maxttl);
}
}
obj = NULL;
result = named_config_get(maps, "max-records", &obj);
INSIST(result == ISC_R_SUCCESS && obj != NULL);
@@ -1531,6 +1513,22 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setjournalsize(zone, journal_size);
}
if (use_kasp) {
maxttl = dns_kasp_zonemaxttl(dns_zone_getkasp(zone));
} else {
obj = NULL;
result = named_config_get(maps, "max-zone-ttl", &obj);
if (result == ISC_R_SUCCESS) {
if (cfg_obj_isduration(obj)) {
maxttl = cfg_obj_asduration(obj);
}
}
}
dns_zone_setmaxttl(zone, maxttl);
if (raw != NULL) {
dns_zone_setmaxttl(raw, maxttl);
}
/*
* Configure update-related options. These apply to
* primary servers only.
@@ -2046,9 +2044,7 @@ named_zone_configure_writeable_dlz(dns_dlzdb_t *dlzdatabase, dns_zone_t *zone,
}
bool
named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, const cfg_obj_t *config,
cfg_aclconfctx_t *actx) {
named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig) {
const cfg_obj_t *zoptions = NULL;
const cfg_obj_t *obj = NULL;
const char *cfilename;
@@ -2082,8 +2078,7 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
has_raw = false;
}
inline_signing = named_zone_inlinesigning(zone, zconfig, vconfig,
config, actx);
inline_signing = named_zone_inlinesigning(zconfig);
if (!inline_signing && has_raw) {
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"not reusable: old zone was inline-signing");
@@ -2120,80 +2115,15 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
}
bool
named_zone_inlinesigning(dns_zone_t *zone, const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, const cfg_obj_t *config,
cfg_aclconfctx_t *actx) {
isc_result_t res;
named_zone_inlinesigning(const cfg_obj_t *zconfig) {
const cfg_obj_t *zoptions = NULL;
const cfg_obj_t *voptions = NULL;
const cfg_obj_t *options = NULL;
const cfg_obj_t *signing = NULL;
const cfg_obj_t *allowupdate = NULL;
const cfg_obj_t *updatepolicy = NULL;
bool zone_is_dynamic = false;
bool inline_signing = false;
(void)cfg_map_get(config, "options", &options);
zoptions = cfg_tuple_get(zconfig, "options");
if (vconfig != NULL) {
voptions = cfg_tuple_get(vconfig, "options");
}
inline_signing = (cfg_map_get(zoptions, "inline-signing", &signing) ==
ISC_R_SUCCESS &&
cfg_obj_asboolean(signing));
if (inline_signing) {
return (true);
}
if (cfg_map_get(zoptions, "update-policy", &updatepolicy) ==
ISC_R_SUCCESS) {
zone_is_dynamic = true;
} else {
res = cfg_map_get(zoptions, "allow-update", &allowupdate);
if (res != ISC_R_SUCCESS && voptions != NULL) {
res = cfg_map_get(voptions, "allow-update",
&allowupdate);
}
if (res != ISC_R_SUCCESS && options != NULL) {
res = cfg_map_get(options, "allow-update",
&allowupdate);
}
if (res == ISC_R_SUCCESS) {
dns_acl_t *acl = NULL;
res = cfg_acl_fromconfig(
allowupdate, config, named_g_lctx, actx,
dns_zone_getmctx(zone), 0, &acl);
if (res == ISC_R_SUCCESS && acl != NULL &&
!dns_acl_isnone(acl)) {
zone_is_dynamic = true;
}
if (acl != NULL) {
dns_acl_detach(&acl);
}
}
}
/*
* If inline-signing is not set, perhaps implictly through a
* dnssec-policy. Since automated DNSSEC maintenance requires
* a dynamic zone, or inline-siging to be enabled, check if
* the zone with dnssec-policy allows updates. If not, enable
* inline-signing.
*/
signing = NULL;
if (!inline_signing && !zone_is_dynamic &&
cfg_map_get(zoptions, "dnssec-policy", &signing) == ISC_R_SUCCESS &&
signing != NULL)
{
if (strcmp(cfg_obj_asstring(signing), "none") != 0) {
inline_signing = true;
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"inline-signing: "
"implicitly through dnssec-policy");
}
}
return (inline_signing);
}
+207 -76
View File
@@ -21,7 +21,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <isc/app.h>
#include <isc/attributes.h>
#include <isc/base64.h>
#include <isc/buffer.h>
@@ -29,8 +28,10 @@
#include <isc/event.h>
#include <isc/file.h>
#include <isc/hash.h>
#include <isc/job.h>
#include <isc/lex.h>
#include <isc/log.h>
#include <isc/loop.h>
#include <isc/managers.h>
#include <isc/mem.h>
#include <isc/netmgr.h>
@@ -45,6 +46,7 @@
#include <isc/stdio.h>
#include <isc/string.h>
#include <isc/task.h>
#include <isc/tls.h>
#include <isc/types.h>
#include <isc/util.h>
@@ -67,6 +69,7 @@
#include <dns/rdatatype.h>
#include <dns/request.h>
#include <dns/tkey.h>
#include <dns/transport.h>
#include <dns/tsig.h>
#include <dst/dst.h>
@@ -119,6 +122,7 @@ static bool memdebugging = false;
static bool have_ipv4 = false;
static bool have_ipv6 = false;
static bool is_dst_up = false;
static bool use_tls = false;
static bool usevc = false;
static bool usegsstsig = false;
static bool use_win2k_gsstsig = false;
@@ -126,8 +130,8 @@ 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_loopmgr_t *loopmgr = NULL;
static isc_task_t *global_task = NULL;
static isc_event_t *global_event = NULL;
static isc_log_t *glctx = NULL;
static isc_mem_t *gmctx = NULL;
static dns_dispatchmgr_t *dispatchmgr = NULL;
@@ -146,6 +150,14 @@ static dns_tsigkey_t *tsigkey = NULL;
static dst_key_t *sig0key = NULL;
static isc_sockaddr_t *servers = NULL;
static isc_sockaddr_t *primary_servers = NULL;
static dns_transport_list_t *transport_list = NULL;
static dns_transport_t *transport = NULL;
static isc_tlsctx_cache_t *tls_ctx_cache = NULL;
static char *tls_hostname = NULL;
static char *tls_client_key_file = NULL;
static char *tls_client_cert_file = NULL;
static char *tls_ca_file = NULL;
static bool tls_always_verify_remote = true;
static bool default_servers = true;
static int ns_inuse = 0;
static int primary_inuse = 0;
@@ -176,6 +188,8 @@ static bool default_ttl_set = false;
static bool checknames = true;
static const char *resolvconf = RESOLV_CONF;
bool done = false;
typedef struct nsu_requestinfo {
dns_message_t *msg;
isc_sockaddr_t *addr;
@@ -187,6 +201,9 @@ sendrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
static void
send_update(dns_name_t *zonename, isc_sockaddr_t *primary);
static void
getinput(void *arg);
noreturn static void
fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
@@ -681,8 +698,6 @@ setup_keyfile(isc_mem_t *mctx, isc_log_t *lctx) {
static void
doshutdown(void) {
isc_task_detach(&global_task);
/*
* The isc_mem_put of primary_servers must be before the
* isc_mem_put of servers as it sets the servers pointer
@@ -752,7 +767,9 @@ maybeshutdown(void) {
}
static void
shutdown_program(void) {
shutdown_program(void *arg) {
UNUSED(arg);
ddebug("shutdown_program()");
shuttingdown = true;
@@ -787,6 +804,19 @@ set_source_ports(dns_dispatchmgr_t *manager) {
isc_portset_destroy(gmctx, &v6portset);
}
static isc_result_t
create_name(const char *str, char *namedata, size_t len, dns_name_t *name) {
isc_buffer_t namesrc, namebuf;
dns_name_init(name, NULL);
isc_buffer_constinit(&namesrc, str, strlen(str));
isc_buffer_add(&namesrc, strlen(str));
isc_buffer_init(&namebuf, namedata, len);
return (dns_name_fromtext(name, &namesrc, dns_rootname,
DNS_NAME_DOWNCASE, &namebuf));
}
static void
setup_system(void) {
isc_result_t result;
@@ -794,6 +824,8 @@ setup_system(void) {
isc_sockaddrlist_t *nslist;
isc_logconfig_t *logconfig = NULL;
irs_resconf_t *resconf = NULL;
dns_name_t tlsname;
char namedata[DNS_NAME_FORMATSIZE + 1];
ddebug("setup_system()");
@@ -905,13 +937,10 @@ setup_system(void) {
irs_resconf_destroy(&resconf);
result = isc_managers_create(gmctx, 1, 0, &netmgr, &taskmgr, NULL);
check_result(result, "isc_managers_create");
result = dns_dispatchmgr_create(gmctx, netmgr, &dispatchmgr);
check_result(result, "dns_dispatchmgr_create");
result = isc_task_create(taskmgr, 0, &global_task, 0);
result = isc_task_create(taskmgr, &global_task, 0);
check_result(result, "isc_task_create");
result = dst_lib_init(gmctx, NULL);
@@ -933,6 +962,31 @@ setup_system(void) {
&dispatchv4);
check_result(result, "dns_dispatch_createudp (v4)");
}
transport_list = dns_transport_list_new(gmctx);
tls_ctx_cache = isc_tlsctx_cache_new(gmctx);
if (tls_client_key_file == NULL) {
result = create_name("tls-non-auth-client", namedata,
sizeof(namedata), &tlsname);
check_result(result, "create_name (tls-non-auth-client)");
transport = dns_transport_new(&tlsname, DNS_TRANSPORT_TLS,
transport_list);
dns_transport_set_tlsname(transport, "tls-non-auth-client");
} else {
result = create_name("tls-auth-client", namedata,
sizeof(namedata), &tlsname);
check_result(result, "create_name (tls-auth-client)");
transport = dns_transport_new(&tlsname, DNS_TRANSPORT_TLS,
transport_list);
dns_transport_set_tlsname(transport, "tls-auth-client");
dns_transport_set_keyfile(transport, tls_client_key_file);
dns_transport_set_certfile(transport, tls_client_cert_file);
}
dns_transport_set_cafile(transport, tls_ca_file);
dns_transport_set_remote_hostname(transport, tls_hostname);
dns_transport_set_always_verify_remote(transport,
tls_always_verify_remote);
result = dns_requestmgr_create(gmctx, taskmgr, dispatchmgr, dispatchv4,
dispatchv6, &requestmgr);
@@ -959,9 +1013,9 @@ get_addresses(char *host, in_port_t port, isc_sockaddr_t *sockaddr,
int count = 0;
isc_result_t result;
isc_app_block();
isc_loopmgr_blocking(loopmgr);
result = bind9_getaddresses(host, port, sockaddr, naddrs, &count);
isc_app_unblock();
isc_loopmgr_nonblocking(loopmgr);
if (result != ISC_R_SUCCESS) {
error("couldn't get address for '%s': %s", host,
isc_result_totext(result));
@@ -969,7 +1023,7 @@ get_addresses(char *host, in_port_t port, isc_sockaddr_t *sockaddr,
return (count);
}
#define PARSE_ARGS_FMT "46C:dDghilL:Mok:p:Pr:R:t:Tu:vVy:"
#define PARSE_ARGS_FMT "46A:C:dDE:ghH:iK:lL:MoOk:p:Pr:R:St:Tu:vVy:"
static void
pre_parse_args(int argc, char **argv) {
@@ -1012,7 +1066,9 @@ pre_parse_args(int argc, char **argv) {
fprintf(stderr, "usage: nsupdate [-CdDi] [-L level] "
"[-l] [-g | -o | -y keyname:secret "
"| -k keyfile] [-p port] "
"[-v] [-V] [-P] [-T] [-4 | -6] "
"[ -S [-K tlskeyfile] [-E tlscertfile] "
"[-A tlscafile] [-H tlshostname] "
"[-O] ] [-v] [-V] [-P] [-T] [-4 | -6] "
"[filename]\n");
exit(1);
@@ -1084,6 +1140,11 @@ parse_args(int argc, char **argv) {
fatal("can't find IPv6 networking");
}
break;
case 'A':
use_tls = true;
usevc = true;
tls_ca_file = isc_commandline_argument;
break;
case 'C':
resolvconf = isc_commandline_argument;
break;
@@ -1094,12 +1155,27 @@ parse_args(int argc, char **argv) {
debugging = true;
ddebugging = true;
break;
case 'E':
use_tls = true;
usevc = true;
tls_client_cert_file = isc_commandline_argument;
break;
case 'H':
use_tls = true;
usevc = true;
tls_hostname = isc_commandline_argument;
break;
case 'M':
break;
case 'i':
force_interactive = true;
interactive = true;
break;
case 'K':
use_tls = true;
usevc = true;
tls_client_key_file = isc_commandline_argument;
break;
case 'l':
local_only = true;
break;
@@ -1132,6 +1208,11 @@ parse_args(int argc, char **argv) {
usegsstsig = true;
use_win2k_gsstsig = true;
break;
case 'O':
use_tls = true;
usevc = true;
tls_always_verify_remote = false;
break;
case 'p':
result = isc_parse_uint16(&dnsport,
isc_commandline_argument, 10);
@@ -1143,6 +1224,10 @@ parse_args(int argc, char **argv) {
exit(1);
}
break;
case 'S':
use_tls = true;
usevc = true;
break;
case 't':
result = isc_parse_uint32(&timeout,
isc_commandline_argument, 10);
@@ -1208,6 +1293,24 @@ parse_args(int argc, char **argv) {
}
#endif /* HAVE_GSSAPI */
if (use_tls) {
if ((tls_client_key_file == NULL) !=
(tls_client_cert_file == NULL)) {
fprintf(stderr,
"%s: cannot specify the -K option without"
"the -E option, and vice versa.\n",
argv[0]);
exit(1);
}
if (tls_ca_file != NULL && tls_always_verify_remote == false) {
fprintf(stderr,
"%s: cannot specify the -A option in "
"conjuction with the -O option.\n",
argv[0]);
exit(1);
}
}
if (argv[isc_commandline_index] != NULL) {
if (strcmp(argv[isc_commandline_index], "-") == 0) {
input = stdin;
@@ -1491,9 +1594,8 @@ evaluate_server(char *cmdline) {
ns_alloc = MAX_SERVERADDRS;
ns_inuse = 0;
servers = isc_mem_get(gmctx, ns_alloc * sizeof(isc_sockaddr_t));
memset(servers, 0, ns_alloc * sizeof(isc_sockaddr_t));
servers = isc_mem_getx(gmctx, ns_alloc * sizeof(isc_sockaddr_t),
ISC_MEM_ZERO);
ns_total = get_addresses(server, (in_port_t)port, servers, ns_alloc);
if (ns_total == 0) {
return (STATUS_SYNTAX);
@@ -2238,7 +2340,6 @@ get_next_command(void) {
char cmdlinebuf[MAXCMD];
char *cmdline = NULL, *ptr = NULL;
isc_app_block();
if (interactive) {
cmdline = ptr = readline("> ");
if (ptr != NULL && *ptr != 0) {
@@ -2247,7 +2348,6 @@ get_next_command(void) {
} else {
cmdline = fgets(cmdlinebuf, MAXCMD, input);
}
isc_app_unblock();
if (cmdline != NULL) {
char *tmp = cmdline;
@@ -2285,9 +2385,9 @@ user_interaction(void) {
static void
done_update(void) {
isc_event_t *event = global_event;
ddebug("done_update()");
isc_task_send(global_task, &event);
isc_job_run(loopmgr, getinput, NULL);
}
static void
@@ -2447,8 +2547,10 @@ static void
send_update(dns_name_t *zone, isc_sockaddr_t *primary) {
isc_result_t result;
dns_request_t *request = NULL;
unsigned int options = DNS_REQUESTOPT_CASE;
isc_sockaddr_t *srcaddr;
unsigned int options = DNS_REQUESTOPT_CASE | DNS_REQUESTOPT_LARGE;
dns_transport_t *req_transport = NULL;
isc_tlsctx_cache_t *req_tls_ctx_cache = NULL;
ddebug("send_update()");
@@ -2456,7 +2558,12 @@ send_update(dns_name_t *zone, isc_sockaddr_t *primary) {
if (usevc) {
options |= DNS_REQUESTOPT_TCP;
if (use_tls) {
req_transport = transport;
req_tls_ctx_cache = tls_ctx_cache;
}
}
if (tsigkey == NULL && sig0key != NULL) {
result = dns_message_setsig0key(updatemsg, sig0key);
check_result(result, "dns_message_setsig0key");
@@ -2476,14 +2583,14 @@ send_update(dns_name_t *zone, isc_sockaddr_t *primary) {
/* Windows doesn't like the tsig name to be compressed. */
if (updatemsg->tsigname) {
updatemsg->tsigname->attributes |= DNS_NAMEATTR_NOCOMPRESS;
updatemsg->tsigname->attributes.nocompress = true;
}
result = dns_request_createvia(requestmgr, updatemsg, srcaddr, primary,
-1, options, tsigkey, timeout,
udp_timeout, udp_retries, global_task,
update_completed, NULL, &request);
check_result(result, "dns_request_createvia");
result = dns_request_create(
requestmgr, updatemsg, srcaddr, primary, req_transport,
req_tls_ctx_cache, -1, options, tsigkey, timeout, udp_timeout,
udp_retries, global_task, update_completed, NULL, &request);
check_result(result, "dns_request_create");
if (debugging) {
show_message(stdout, updatemsg, "Outgoing update query:");
@@ -2573,6 +2680,10 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
result = dns_request_getresponse(request, rcvmsg,
DNS_MESSAGEPARSE_PRESERVEORDER);
if (result == DNS_R_TSIGERRORSET && servers != NULL) {
unsigned int options = DNS_REQUESTOPT_CASE;
dns_transport_t *req_transport = NULL;
isc_tlsctx_cache_t *req_tls_ctx_cache = NULL;
dns_message_detach(&rcvmsg);
ddebug("Destroying request [%p]", request);
dns_request_destroy(&request);
@@ -2582,17 +2693,26 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
dns_message_renderreset(soaquery);
ddebug("retrying soa request without TSIG");
if (usevc) {
options |= DNS_REQUESTOPT_TCP;
if (!default_servers && use_tls) {
req_transport = transport;
req_tls_ctx_cache = tls_ctx_cache;
}
}
if (isc_sockaddr_pf(addr) == AF_INET6) {
srcaddr = localaddr6;
} else {
srcaddr = localaddr4;
}
result = dns_request_createvia(
requestmgr, soaquery, srcaddr, addr, -1, 0, NULL,
FIND_TIMEOUT * 20, FIND_TIMEOUT, 3, global_task,
recvsoa, reqinfo, &request);
check_result(result, "dns_request_createvia");
result = dns_request_create(
requestmgr, soaquery, srcaddr, addr, req_transport,
req_tls_ctx_cache, -1, options, NULL, FIND_TIMEOUT * 20,
FIND_TIMEOUT, 3, global_task, recvsoa, reqinfo,
&request);
check_result(result, "dns_request_create");
requests++;
return;
}
@@ -2733,9 +2853,7 @@ lookforsoa:
}
primary_alloc = MAX_SERVERADDRS;
size = primary_alloc * sizeof(isc_sockaddr_t);
primary_servers = isc_mem_get(gmctx, size);
memset(primary_servers, 0, size);
primary_servers = isc_mem_getx(gmctx, size, ISC_MEM_ZERO);
primary_total = get_addresses(serverstr, dnsport,
primary_servers, primary_alloc);
if (primary_total == 0) {
@@ -2796,6 +2914,17 @@ sendrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
isc_result_t result;
nsu_requestinfo_t *reqinfo;
isc_sockaddr_t *srcaddr;
unsigned int options = DNS_REQUESTOPT_CASE;
dns_transport_t *req_transport = NULL;
isc_tlsctx_cache_t *req_tls_ctx_cache = NULL;
if (usevc) {
options |= DNS_REQUESTOPT_TCP;
if (!default_servers && use_tls) {
req_transport = transport;
req_tls_ctx_cache = tls_ctx_cache;
}
}
reqinfo = isc_mem_get(gmctx, sizeof(nsu_requestinfo_t));
reqinfo->msg = msg;
@@ -2807,11 +2936,12 @@ sendrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
srcaddr = localaddr4;
}
result = dns_request_createvia(requestmgr, msg, srcaddr, destaddr, -1,
0, default_servers ? NULL : tsigkey,
FIND_TIMEOUT * 20, FIND_TIMEOUT, 3,
global_task, recvsoa, reqinfo, request);
check_result(result, "dns_request_createvia");
result = dns_request_create(requestmgr, msg, srcaddr, destaddr,
req_transport, req_tls_ctx_cache, -1,
options, default_servers ? NULL : tsigkey,
FIND_TIMEOUT * 20, FIND_TIMEOUT, 3,
global_task, recvsoa, reqinfo, request);
check_result(result, "dns_request_create");
requests++;
}
@@ -2952,7 +3082,7 @@ start_gssrequest(dns_name_t *primary) {
}
/* Windows doesn't recognize name compression in the key name. */
keyname->attributes |= DNS_NAMEATTR_NOCOMPRESS;
keyname->attributes.nocompress = true;
rmsg = NULL;
dns_message_create(gmctx, DNS_MESSAGE_INTENTRENDER, &rmsg);
@@ -2990,8 +3120,15 @@ send_gssrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
dns_request_t **request, gss_ctx_id_t context) {
isc_result_t result;
nsu_gssinfo_t *reqinfo;
unsigned int options = 0;
isc_sockaddr_t *srcaddr;
unsigned int options = DNS_REQUESTOPT_CASE | DNS_REQUESTOPT_TCP;
dns_transport_t *req_transport = NULL;
isc_tlsctx_cache_t *req_tls_ctx_cache = NULL;
if (!default_servers && use_tls) {
req_transport = transport;
req_tls_ctx_cache = tls_ctx_cache;
}
debug("send_gssrequest");
REQUIRE(destaddr != NULL);
@@ -3001,19 +3138,17 @@ send_gssrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
reqinfo->addr = destaddr;
reqinfo->context = context;
options |= DNS_REQUESTOPT_TCP;
if (isc_sockaddr_pf(destaddr) == AF_INET6) {
srcaddr = localaddr6;
} else {
srcaddr = localaddr4;
}
result = dns_request_createvia(requestmgr, msg, srcaddr, destaddr, -1,
options, tsigkey, FIND_TIMEOUT * 20,
FIND_TIMEOUT, 3, global_task, recvgss,
reqinfo, request);
check_result(result, "dns_request_createvia");
result = dns_request_create(
requestmgr, msg, srcaddr, destaddr, req_transport,
req_tls_ctx_cache, -1, options, tsigkey, FIND_TIMEOUT * 20,
FIND_TIMEOUT, 3, global_task, recvgss, reqinfo, request);
check_result(result, "dns_request_create");
if (debugging) {
show_message(stdout, msg, "Outgoing update query:");
}
@@ -3270,15 +3405,20 @@ static void
cleanup(void) {
ddebug("cleanup()");
if (tls_ctx_cache != NULL) {
isc_tlsctx_cache_detach(&tls_ctx_cache);
}
if (transport_list != NULL) {
dns_transport_list_detach(&transport_list);
}
LOCK(&answer_lock);
if (answer != NULL) {
dns_message_detach(&answer);
}
UNLOCK(&answer_lock);
ddebug("Shutting down managers");
isc_managers_destroy(&netmgr, &taskmgr, NULL);
#if HAVE_GSSAPI
if (tsigkey != NULL) {
ddebug("detach tsigkey x%p", tsigkey);
@@ -3294,9 +3434,6 @@ cleanup(void) {
dst_key_free(&sig0key);
}
ddebug("Destroying event");
isc_event_free(&global_event);
#ifdef HAVE_GSSAPI
/*
* Cleanup GSSAPI resources after taskmgr has been destroyed.
@@ -3324,7 +3461,6 @@ cleanup(void) {
if (memdebugging) {
isc_mem_stats(gmctx, stderr);
}
isc_mem_destroy(&gmctx);
isc_mutex_destroy(&answer_lock);
@@ -3333,44 +3469,44 @@ cleanup(void) {
dst_lib_destroy();
is_dst_up = false;
}
ddebug("Shutting down managers");
isc_managers_destroy(&gmctx, &loopmgr, &netmgr, &taskmgr);
}
static void
getinput(isc_task_t *task, isc_event_t *event) {
getinput(void *arg) {
bool more;
UNUSED(task);
UNUSED(arg);
if (shuttingdown) {
maybeshutdown();
return;
}
if (global_event == NULL) {
global_event = event;
}
reset_system();
isc_loopmgr_blocking(loopmgr);
more = user_interaction();
isc_loopmgr_nonblocking(loopmgr);
if (!more) {
isc_app_shutdown();
isc_task_detach(&global_task);
isc_loopmgr_shutdown(loopmgr);
return;
}
done = false;
start_update();
return;
}
int
main(int argc, char **argv) {
isc_result_t result;
style = &dns_master_style_debug;
input = stdin;
interactive = isatty(0);
isc_app_start();
if (isc_net_probeipv4() == ISC_R_SUCCESS) {
have_ipv4 = true;
}
@@ -3383,23 +3519,18 @@ main(int argc, char **argv) {
pre_parse_args(argc, argv);
isc_mem_create(&gmctx);
isc_managers_create(&gmctx, 1, &loopmgr, &netmgr, &taskmgr);
parse_args(argc, argv);
setup_system();
result = isc_app_onrun(gmctx, global_task, getinput, NULL);
check_result(result, "isc_app_onrun");
(void)isc_app_run();
shutdown_program();
isc_loopmgr_setup(loopmgr, getinput, NULL);
isc_loopmgr_teardown(loopmgr, shutdown_program, NULL);
isc_loopmgr_run(loopmgr);
cleanup();
isc_app_finish();
if (seenerror) {
return (2);
} else {
+49 -1
View File
@@ -19,7 +19,7 @@ nsupdate - dynamic DNS update utility
Synopsis
~~~~~~~~
:program:`nsupdate` [**-d**] [**-D**] [**-i**] [**-L** level] [ [**-g**] | [**-o**] | [**-l**] | [**-y** [hmac:]keyname:secret] | [**-k** keyfile] ] [**-t** timeout] [**-u** udptimeout] [**-r** udpretries] [**-v**] [**-T**] [**-P**] [**-V**] [ [**-4**] | [**-6**] ] [filename]
:program:`nsupdate` [**-d**] [**-D**] [**-i**] [**-L** level] [ [**-g**] | [**-o**] | [**-l**] | [**-y** [hmac:]keyname:secret] | [**-k** keyfile] ] [ [**-S**] [**-K** tlskeyfile] [**-E** tlscertfile] [**-A** tlscafile] [**-H** tlshostname] [-O] ] [**-t** timeout] [**-u** udptimeout] [**-r** udpretries] [**-v**] [**-T**] [**-P**] [**-V**] [ [**-4**] | [**-6**] ] [filename]
Description
~~~~~~~~~~~
@@ -71,6 +71,15 @@ Options
This option sets use of IPv6 only.
.. option:: -A tlscafile
This option specifies the file of the certificate authorities (CA) certificates
(in PEM format) in order to verify the remote server TLS certificate when
using DNS-over-TLS (DoT), to achieve Strict or Mutual TLS. When used, it will
override the certificates from the global certificates store, which are
otherwise used by default when :option:`-S` is enabled. This option can not
be used in conjuction with :option:`-O`, and it implies :option:`-S`.
.. option:: -C
Overrides the default `resolv.conf` file. This is only intended for testing.
@@ -84,10 +93,23 @@ Options
This option sets extra debug mode.
.. option:: -E tlscertfile
This option sets the certificate(s) file for authentication for the
DNS-over-TLS (DoT) transport to the remote server. The certificate
chain file is expected to be in PEM format. This option implies :option:`-S`,
and can only be used with :option:`-K`.
.. option:: -g
This option enables standard GSS-TSIG mode.
.. option:: -H tlshostname
This option makes :program:`nsupdate` use the provided hostname during remote
server TLS certificate verification. Otherwise, the DNS server name
is used. This option implies :option:`-S`.
.. option:: -i
This option forces interactive mode, even when standard input is not a terminal.
@@ -104,6 +126,13 @@ Options
key used to authenticate Dynamic DNS update requests. In this case,
the key specified is not an HMAC-MD5 key.
.. option:: -K tlskeyfile
This option sets the key file for authenticated encryption for the
DNS-over-TLS (DoT) transport with the remote server. The private key file is
expected to be in PEM format. This option implies :option:`-S`, and can only
be used with :option:`-E`.
.. option:: -l
This option sets local-host only mode, which sets the server address to localhost
@@ -123,6 +152,14 @@ Options
This option enables a non-standards-compliant variant of GSS-TSIG
used by Windows 2000.
.. option:: -O
This option enables Opportunistic TLS. When used, the remote peer's TLS
certificate will not be verified. This option should be used for debugging
purposes only, and it is not recommended to use it in production. This
option can not be used in conjuction with :option:`-A`, and it implies
:option:`-S`.
.. option:: -p port
This option sets the port to use for connections to a name server. The default is
@@ -138,6 +175,15 @@ Options
This option sets the number of UDP retries. The default is 3. If zero, only one update
request is made.
.. option:: -S
This option indicates whether to use DNS-over-TLS (DoT) when querying
name servers specified by ``server servername port`` syntax in the input
file, and the primary server discovered through a SOA request. When the
:option:`-K` and :option:`-E` options are used, then the specified TLS
client certificate and private key pair are used for authentication
(Mutual TLS). This option implies :option:`-v`.
.. option:: -t timeout
This option sets the maximum time an update request can take before it is aborted. The
@@ -216,6 +262,8 @@ The command formats and their meanings are as follows:
update requests are sent. If no port number is specified, the default
DNS port number of 53 is used.
.. note:: This command has no effect when GSS-TSIG is in use.
``local address port``
This command sends all dynamic update requests using the local ``address``. When
no local statement is provided, :program:`nsupdate` sends updates using
+1 -1
View File
@@ -339,7 +339,7 @@ plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
cfg_file, cfg_line, parameters != NULL ? "with" : "no");
inst = isc_mem_get(mctx, sizeof(*inst));
memset(inst, 0, sizeof(*inst));
*inst = (filter_instance_t){ 0 };
isc_mem_attach(mctx, &inst->mctx);
if (parameters != NULL) {
+2 -1
View File
@@ -342,7 +342,8 @@ plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
cfg_file, cfg_line, parameters != NULL ? "with" : "no");
inst = isc_mem_get(mctx, sizeof(*inst));
memset(inst, 0, sizeof(*inst));
*inst = (filter_instance_t){ 0 };
isc_mem_attach(mctx, &inst->mctx);
if (parameters != NULL) {
+16 -27
View File
@@ -17,13 +17,13 @@
#include <stdbool.h>
#include <stdlib.h>
#include <isc/app.h>
#include <isc/atomic.h>
#include <isc/attributes.h>
#include <isc/buffer.h>
#include <isc/commandline.h>
#include <isc/file.h>
#include <isc/log.h>
#include <isc/loop.h>
#include <isc/managers.h>
#include <isc/mem.h>
#include <isc/net.h>
@@ -61,6 +61,7 @@ bool verbose;
static isc_nm_t *netmgr = NULL;
static isc_taskmgr_t *taskmgr = NULL;
static isc_loopmgr_t *loopmgr = NULL;
static isc_task_t *rndc_task = NULL;
static const char *admin_conffile = NULL;
@@ -307,7 +308,8 @@ rndc_senddone(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
atomic_load_acquire(&recvs) == 0)
{
shuttingdown = true;
isc_app_shutdown();
isc_task_detach(&rndc_task);
isc_loopmgr_shutdown(loopmgr);
}
}
@@ -388,11 +390,12 @@ rndc_recvdone(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
REQUIRE(recvdone_handle == handle);
isc_nmhandle_detach(&recvdone_handle);
if (atomic_load_acquire(&sends) == 0 &&
atomic_fetch_sub_release(&recvs, 1) == 1)
if (atomic_fetch_sub_release(&recvs, 1) == 1 &&
atomic_load_acquire(&sends) == 0)
{
shuttingdown = true;
isc_app_shutdown();
isc_task_detach(&rndc_task);
isc_loopmgr_shutdown(loopmgr);
}
}
@@ -601,10 +604,8 @@ rndc_startconnect(isc_sockaddr_t *addr) {
}
static void
rndc_start(isc_task_t *task, isc_event_t *event) {
isc_event_free(&event);
UNUSED(task);
rndc_start(void *arg) {
UNUSED(arg);
currentaddr = 0;
rndc_startconnect(&serveraddrs[currentaddr]);
@@ -914,11 +915,6 @@ main(int argc, char **argv) {
isc_sockaddr_any(&local4);
isc_sockaddr_any6(&local6);
result = isc_app_start();
if (result != ISC_R_SUCCESS) {
fatal("isc_app_start() failed: %s", isc_result_totext(result));
}
isc_commandline_errprint = false;
preparse_args(argc, argv);
@@ -1026,9 +1022,10 @@ main(int argc, char **argv) {
serial = isc_random32();
isc_mem_create(&rndc_mctx);
isc_managers_create(rndc_mctx, 1, 0, &netmgr, &taskmgr, NULL);
DO("create task", isc_task_create(taskmgr, 0, &rndc_task, 0));
isc_managers_create(&rndc_mctx, 1, &loopmgr, &netmgr, &taskmgr);
isc_loopmgr_setup(loopmgr, rndc_start, rndc_task);
DO("create task", isc_task_create(taskmgr, &rndc_task, 0));
isc_log_create(rndc_mctx, &log, &logconfig);
isc_log_setcontext(log);
isc_log_settag(logconfig, progname);
@@ -1074,15 +1071,7 @@ main(int argc, char **argv) {
get_addresses(servername, (in_port_t)remoteport);
}
DO("post event", isc_app_onrun(rndc_mctx, rndc_task, rndc_start, NULL));
result = isc_app_run();
if (result != ISC_R_SUCCESS) {
fatal("isc_app_run() failed: %s", isc_result_totext(result));
}
isc_task_detach(&rndc_task);
isc_managers_destroy(&netmgr, &taskmgr, NULL);
isc_loopmgr_run(loopmgr);
/*
* Note: when TCP connections are shut down, there will be a final
@@ -1106,7 +1095,7 @@ main(int argc, char **argv) {
isc_mem_stats(rndc_mctx, stderr);
}
isc_mem_destroy(&rndc_mctx);
isc_managers_destroy(&rndc_mctx, &loopmgr, &netmgr, &taskmgr);
if (failed) {
return (1);
+2
View File
@@ -1,5 +1,7 @@
include $(top_srcdir)/Makefile.top
EXTRA_DIST = convert-trs-to-junit.py
SUBDIRS = system
noinst_PROGRAMS = \
+3 -15
View File
@@ -23,7 +23,6 @@ check_PROGRAMS = \
feature-test \
makejournal \
pipelined/pipequeries \
resolve \
rndc/gencheck \
rpz/dnsrps \
tkey/keycreate \
@@ -49,14 +48,6 @@ 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)
@@ -105,10 +96,12 @@ TESTS += \
checknames \
checkzone \
database \
dialup \
dlzexternal \
dns64 \
dscp \
dsdigest \
dupsigs \
dyndb \
ecdsa \
eddsa \
@@ -170,12 +163,6 @@ TESTS += \
xferquota \
zonechecks
# The "stress" test is not run by default since it creates enough
# load on the machine to make it unusable to other users.
# The "dialup", "delzone", and "dupsigs" tests are also not run by
# default because they take a very long time to complete.
# TESTS += delzone dialup dupsigs stress
if HAVE_LMDB
TESTS += nzd2nzf
endif # HAVE_LMDB
@@ -188,6 +175,7 @@ TESTS += \
nsupdate \
resolver \
statistics \
stress \
upforwd \
zero
+2 -1
View File
@@ -161,7 +161,8 @@ grep "status: NOERROR" dig.out.3.${t} > /dev/null 2>&1 || ret=1
$DIG -p ${PORT} soa example. \
@10.53.0.2 -b 10.53.0.8 > dig.out.4.${t}
grep "status: NOERROR" dig.out.4.${t} > /dev/null 2>&1 && ret=1
grep "connection timed out" dig.out.4.${t} > /dev/null 2>&1 || ret=1
grep "timed out" dig.out.4.${t} > /dev/null 2>&1 || ret=1
grep ";; no servers could be reached" dig.out.4.${t} > /dev/null 2>&1 || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=`expr $status + $ret`
+7
View File
@@ -95,6 +95,7 @@ $DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret
grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null || ret=1
grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
nextpart ns2/named.run | grep 'recursion not enabled for view' > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -636,11 +637,13 @@ status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "test $n: default allow-recursion configuration"
ret=0
nextpart ns3/named.run > /dev/null
$DIG -p ${PORT} @10.53.0.3 -b 127.0.0.1 a.normal.example a > dig.out.ns3.1.$n
grep 'status: NOERROR' dig.out.ns3.1.$n > /dev/null || ret=1
$DIG -p ${PORT} @10.53.0.3 -b 10.53.0.1 a.normal.example a > dig.out.ns3.2.$n
grep 'status: REFUSED' dig.out.ns3.2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns3.2.$n > /dev/null || ret=1
nextpart ns3/named.run | grep 'allow-recursion did not match' > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -653,6 +656,7 @@ grep 'status: NOERROR' dig.out.ns3.1.$n > /dev/null || ret=1
$DIG -p ${PORT} @10.53.0.3 -b 10.53.0.1 ns . > dig.out.ns3.2.$n
grep 'status: REFUSED' dig.out.ns3.2.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns3.2.$n > /dev/null || ret=1
nextpart ns3/named.run | grep 'allow-recursion did not match' > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -671,6 +675,7 @@ grep 'ANSWER: 1' dig.out.ns3.1.$n > /dev/null || ret=1
$DIG -p ${PORT} @10.53.0.3 b.normal.example a > dig.out.ns3.2.$n
grep 'recursion requested but not available' dig.out.ns3.2.$n > /dev/null || ret=1
grep 'ANSWER: 0' dig.out.ns3.2.$n > /dev/null || ret=1
nextpart ns3/named.run | grep 'allow-recursion-on did not match' > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -697,6 +702,7 @@ $DIG -p ${PORT} @10.53.1.2 d.normal.example a > dig.out.ns3.4.$n
grep 'recursion requested but not available' dig.out.ns3.4.$n > /dev/null || ret=1
grep 'status: REFUSED' dig.out.ns3.4.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns3.4.$n > /dev/null || ret=1
nextpart ns3/named.run | grep 'allow-recursion-on did not match' > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -723,6 +729,7 @@ $DIG -p ${PORT} @10.53.1.2 f.normal.example a > dig.out.ns3.4.$n
grep 'recursion requested but not available' dig.out.ns3.4.$n > /dev/null || ret=1
grep 'status: REFUSED' dig.out.ns3.4.$n > /dev/null || ret=1
grep 'EDE: 18 (Prohibited)' dig.out.ns3.4.$n > /dev/null || ret=1
nextpart ns3/named.run | grep 'allow-recursion-on did not match' > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
+1 -1
View File
@@ -49,7 +49,7 @@ rm -f ns3/kskonly.example.db
rm -f ns3/named.ns3.prev
rm -f ns3/noksk.example.db
rm -f ns3/nozsk.example.db ns3/inaczsk.example.db
rm -f ns3/nsec.example.db
rm -f ns3/nsec-only.example.db
rm -f ns3/nsec3-to-nsec.example.db
rm -f ns3/nsec3.example.db
rm -f ns3/nsec3.nsec3.example.db
+11 -11
View File
@@ -19,20 +19,20 @@ infile=root.db.in
(cd ../ns2 && $SHELL keygen.sh )
cat $infile ../ns2/dsset-example. > $zonefile
cat $infile ../ns2/dsset-example. ../ns2/dsset-bar. > $zonefile
zskact=`$KEYGEN -3 -a RSASHA1 -q $zone`
zskvanish=`$KEYGEN -3 -a RSASHA1 -q $zone`
zskdel=`$KEYGEN -3 -a RSASHA1 -q -D now $zone`
zskinact=`$KEYGEN -3 -a RSASHA1 -q -I now $zone`
zskunpub=`$KEYGEN -3 -a RSASHA1 -q -G $zone`
zsksby=`$KEYGEN -3 -a RSASHA1 -q -A none $zone`
zskactnowpub1d=`$KEYGEN -3 -a RSASHA1 -q -A now -P +1d $zone`
zsknopriv=`$KEYGEN -3 -a RSASHA1 -q $zone`
zskact=$($KEYGEN -3 -a ${DEFAULT_ALGORITHM} -q $zone)
zskvanish=$($KEYGEN -3 -a ${DEFAULT_ALGORITHM} -q $zone)
zskdel=$($KEYGEN -3 -a ${DEFAULT_ALGORITHM} -q -D now $zone)
zskinact=$($KEYGEN -3 -a ${DEFAULT_ALGORITHM} -q -I now $zone)
zskunpub=$($KEYGEN -3 -a ${DEFAULT_ALGORITHM} -q -G $zone)
zsksby=$($KEYGEN -3 -a ${DEFAULT_ALGORITHM} -q -A none $zone)
zskactnowpub1d=$($KEYGEN -3 -a ${DEFAULT_ALGORITHM} -q -A now -P +1d $zone)
zsknopriv=$($KEYGEN -3 -a ${DEFAULT_ALGORITHM} -q $zone)
rm $zsknopriv.private
ksksby=`$KEYGEN -3 -a RSASHA1 -q -P now -A now+15s -fk $zone`
kskrev=`$KEYGEN -3 -a RSASHA1 -q -R now+15s -fk $zone`
ksksby=$($KEYGEN -3 -a ${DEFAULT_ALGORITHM} -q -P now -A now+15s -fk $zone)
kskrev=$($KEYGEN -3 -a ${DEFAULT_ALGORITHM} -q -R now+15s -fk $zone)
keyfile_to_static_ds $ksksby > trusted.conf
cp trusted.conf ../ns2/trusted.conf
@@ -1,5 +0,0 @@
; This is a key-signing key, keyid 30676, for bar.
; Created: Sat Dec 26 03:13:10 2009
; Publish: Sat Dec 26 03:13:10 2009
; Activate: Sat Dec 26 03:13:10 2009
bar. IN DNSKEY 257 3 5 AwEAAc7ppysDZjlldTwsvcXcTTOYJd5TvW5RUWWYKRsee+ozwY6C7vNI 0Xp1PiY+H31GhcnNMCjQU00y8Vezo42oJ4kpRTDevL0STksExXi1/wG+ M4j1CFMh2wgJ/9XLFzHaEWzt4sflVBAVZVXa/qNkRWDXYjsr30MWyylA wHCIxEuyA+NxAL6UL+ZuFo1j84AvfwkGcMbXTcOBSCaHT6AJToSXAcCa X4fnKJIzG4RyJoN2GK4TVdj4qSzLxL1lRkYHNqJvcmMjezxUs9A5fHNI iBEBRPs7NKrQJxegAGVn9ALylKHyhJW6uyBjleOWUDom4ej2J1vGrpQT /KCA35toCvU=
@@ -1,13 +0,0 @@
Private-key-format: v1.3
Algorithm: 5 (RSASHA1)
Modulus: zumnKwNmOWV1PCy9xdxNM5gl3lO9blFRZZgpGx576jPBjoLu80jRenU+Jj4ffUaFyc0wKNBTTTLxV7OjjagniSlFMN68vRJOSwTFeLX/Ab4ziPUIUyHbCAn/1csXMdoRbO3ix+VUEBVlVdr+o2RFYNdiOyvfQxbLKUDAcIjES7ID43EAvpQv5m4WjWPzgC9/CQZwxtdNw4FIJodPoAlOhJcBwJpfh+cokjMbhHImg3YYrhNV2PipLMvEvWVGRgc2om9yYyN7PFSz0Dl8c0iIEQFE+zs0qtAnF6AAZWf0AvKUofKElbq7IGOV45ZQOibh6PYnW8aulBP8oIDfm2gK9Q==
PublicExponent: AQAB
PrivateExponent: BcfjYsFCjuH1x4ucdbW09ncOv8ppJXbiJkt9AoP0hFOT2c5wrJ1hNOGnrdvYd2CMBlpUOR+w5BxDP+cF78Q97ogXpcjjTwj+5PuqJLg4+qx8thvacrAkdXIKEsgMytjD2d4/ksQmeBiQ7zgiGyCHC7CYzvxnzXEKlgl4FuzLRy4SH1YiSTxKfw1ANKKHxmw8Xvav9ljubrzNdBEQNs6eJNkC6c3aGqiPFyTWGa90s6t1mwTXSxFqBUR1WlbfyYfuiAK2CAvFHeNo7VuC934ri7ceEq8jeOSuY0IqDq2pA3gVWVOyR4NFLXJWeDA3pjqi109t/WGg9IGydD/hsleP4Q==
Prime1: /hz+WxAL+9bO1l/857ME/OhxImSp86Xi7eA920sAo5ukOIQAQ6hbaKemYxyUbwBmGHEX9d0GOU+xAgZWUU9PbZgXw0fdf+uw6Hrgfce0rWY+uJpUcVHfjLPFgMC/XYrfcVQ8tsCXqRsIbqL+ynsEkQ4vybLhlSAyFqGqYFk/Qt0=
Prime2: 0HLxXynoSxUcNW15cbuMRHD34ri8sUQsqCtezofPWcCo/17jqf42W7X9YGO70+BvmG3awSr3LaLf862ovCR5+orwE2MqamAV6JZMyR7nvMNGSHTdg3Kk7Jv7T5Gu7Cg6K+on8pMRW3aIms4gs/Z16j0Gxz74ES9IP3vsvC+q6vk=
Exponent1: NLeXHRUrJ0fdCSRIt1iwRDeEoPn5OA7GEUtgCcp5i3eSjhb0ZxTaQc/l+NHJCW4vwApWSi9cRy99LUpbResKM1ZGN8EE9rDStqgnQnDXztFTWcDKm+e8VNhGtPtHuARDbqNnJRK3Y+Gz0iAGc8Mpo14qE9IEcoeHXKKVUf+x3BE=
Exponent2: dKCbJB+SdM/u5IXH+TZyGKkMSLIMATKfucfqV6vs+86rv5Yb0zUEvPNqPNAQe0+LoMF2L7YWblY+71wumHXgOaobAP3u8W2pVGUjuTOtfRPU8x1QAwfV9vye87oTINaxFXkBuNtITuBXNiY2bfprpw9WB4zXxuWpiruPjQsumiE=
Coefficient: qk8HX5fy74Sx6z3niBfTM/SUEjcsnJCTTmsXy6e7nOXWBK5ihKkmMw7LDhaY4OwjXvaVQH0Z190dfyOkWYTbXInIyNNnqCD+xZXkuzuvsUwLNgvXEFhVnzrrj3ozNiizZsyeAhFCKcITz3ci15HB3y8ZLChGYBPFU1ui7MsSkc8=
Created: 20091226021310
Publish: 20091226021310
Activate: 20091226021310
@@ -1,5 +0,0 @@
; This is a key-signing key, keyid 30804, for bar.
; Created: Sat Dec 26 03:13:10 2009
; Publish: Sat Dec 26 03:13:10 2009
; Activate: Sat Dec 26 03:13:10 2009
bar. IN DNSKEY 257 3 5 AwEAgc7ppysDZjlldTwsvcXcTTOYJd5TvW5RUWWYKRsee+ozwY6C7vNI 0Xp1PiY+H31GhcnNMCjQU00y8Vezo42oJ4kpRTDevL0STksExXi1/wG+ M4j1CFMh2wgJ/9XLFzHaEWzt4sflVBAVZVXa/qNkRWDXYjsr30MWyylA wHCIxEuyA+NxAL6UL+ZuFo1j84AvfwkGcMbXTcOBSCaHT6AJToSXAcCa X4fnKJIzG4RyJoN2GK4TVdj4qSzLxL1lRkYHNqJvcmMjezxUs9A5fHNI iBEBRPs7NKrQJxegAGVn9ALylKHyhJW6uyBjleOWUDom4ej2J1vGrpQT /KCA35toCvU=
@@ -1,13 +0,0 @@
Private-key-format: v1.3
Algorithm: 5 (RSASHA1)
Modulus: zumnKwNmOWV1PCy9xdxNM5gl3lO9blFRZZgpGx576jPBjoLu80jRenU+Jj4ffUaFyc0wKNBTTTLxV7OjjagniSlFMN68vRJOSwTFeLX/Ab4ziPUIUyHbCAn/1csXMdoRbO3ix+VUEBVlVdr+o2RFYNdiOyvfQxbLKUDAcIjES7ID43EAvpQv5m4WjWPzgC9/CQZwxtdNw4FIJodPoAlOhJcBwJpfh+cokjMbhHImg3YYrhNV2PipLMvEvWVGRgc2om9yYyN7PFSz0Dl8c0iIEQFE+zs0qtAnF6AAZWf0AvKUofKElbq7IGOV45ZQOibh6PYnW8aulBP8oIDfm2gK9Q==
PublicExponent: AQCB
PrivateExponent: I5TcRq2sbSi1u5a+jL6VVBBu3nyY7p3NXeD1WYYYD66b8RWbgJdTtsZxgixD5sKKrW/xT68d3FUsIjs36w7yp5+g99q7lJ3v35VcMuLXbaKitS/LJdTZF/GIWwRs+DHdt+chh0QeNLzclq8ZfBeTAycFxwC7zVDLsqqcL6/JHiJhHT+dNEqj6/AIOgSYJzVeBI34LtZLW94IKf4dHLzREnLK6+64PFjpwjOG12O9klKfwHRIRN9WUsDG4AuzDSABH+qo2Zc6uJusC/D6HADbiG7tXmLYL6IxanWTbTrx4Hfp01fF+JQCuyOCRmN47X/nCumvDXKMn9Ve5+OlYi0vAQ==
Prime1: /hz+WxAL+9bO1l/857ME/OhxImSp86Xi7eA920sAo5ukOIQAQ6hbaKemYxyUbwBmGHEX9d0GOU+xAgZWUU9PbZgXw0fdf+uw6Hrgfce0rWY+uJpUcVHfjLPFgMC/XYrfcVQ8tsCXqRsIbqL+ynsEkQ4vybLhlSAyFqGqYFk/Qt0=
Prime2: 0HLxXynoSxUcNW15cbuMRHD34ri8sUQsqCtezofPWcCo/17jqf42W7X9YGO70+BvmG3awSr3LaLf862ovCR5+orwE2MqamAV6JZMyR7nvMNGSHTdg3Kk7Jv7T5Gu7Cg6K+on8pMRW3aIms4gs/Z16j0Gxz74ES9IP3vsvC+q6vk=
Exponent1: JDLRyjRz53hTP7H2oaKgQYADs/UDswN2lwWpuag0wsPwQmeRAZZY2TiISPSu+3Mvh4XJ6r5UHQd5FbAN1v2mG4aYgWwoYwoxyvdTLcnQXciX2z+7877GcEyKHPno4fYXRqhVH4i1QjKaQl8dw9LFvzbVvGvvwsHGwQeqPprw7hk=
Exponent2: vbnob7AZKqKhiVdEcnnhbeZBGcaKkTpE+RAkUL7spNQDiTPvJgo5fcTk/h6G7ijAXK0j62ZHZ3RS7RnaRa+KhO7usPcYMFiJ/VdAyRlIivhyi+WNQ2x4vSygwDy2VV9elljFeNe4dV1Cb+ssE8kAmbP52JjJD6MkhvVLd0u/jMk=
Coefficient: qk8HX5fy74Sx6z3niBfTM/SUEjcsnJCTTmsXy6e7nOXWBK5ihKkmMw7LDhaY4OwjXvaVQH0Z190dfyOkWYTbXInIyNNnqCD+xZXkuzuvsUwLNgvXEFhVnzrrj3ozNiizZsyeAhFCKcITz3ci15HB3y8ZLChGYBPFU1ui7MsSkc8=
Created: 20091226021310
Publish: 20091226021310
Activate: 20091226021310
@@ -0,0 +1,5 @@
; This is a key-signing key, keyid 59973, for bar.
; Created: 20220623022335 (Thu Jun 23 12:23:35 2022)
; Publish: 20220623022335 (Thu Jun 23 12:23:35 2022)
; Activate: 20220623022335 (Thu Jun 23 12:23:35 2022)
bar. IN DNSKEY 257 3 13 QT6CpMaV4BT072+NaKLY5H01Mj2r1MOgsxgoiTAq1Fbf6rrkEWpnbktu Dh9Ol9kuzcUrefxDuxNwsXJu3iDPxw==
@@ -0,0 +1,6 @@
Private-key-format: v1.3
Algorithm: 13 (ECDSAP256SHA256)
PrivateKey: joFZ8vCdyqkgMb6rZ0zanrdrzOSCg1GyEJV6tp5F+Bw=
Created: 20220623022335
Publish: 20220623022335
Activate: 20220623022335
@@ -0,0 +1,5 @@
; This is a key-signing key, keyid 60101, for bar.
; Created: 20220623022331 (Thu Jun 23 12:23:31 2022)
; Publish: 20220623022331 (Thu Jun 23 12:23:31 2022)
; Activate: 20220623022331 (Thu Jun 23 12:23:31 2022)
bar. IN DNSKEY 257 3 13 dLGGOAE5uJd53Gci9MdymaRTMwsXVn13j05IfGJoVt9ucpeXpoIKVViX JNVE/uO4eJvkHycdEAvdVUWcslEmMQ==
@@ -0,0 +1,6 @@
Private-key-format: v1.3
Algorithm: 13 (ECDSAP256SHA256)
PrivateKey: pTTXxZUTzeVBXHMUJxTMxjh9yU4oxDtEhEvpkj+olf0=
Created: 20220623022331
Publish: 20220623022331
Activate: 20220623022331
+9 -9
View File
@@ -29,16 +29,16 @@ zonefile="${zone}.db"
infile="${zonefile}.in"
cat $infile dsset-*.example. > $zonefile
kskname=`$KEYGEN -a RSASHA1 -3 -q -fk $zone`
$KEYGEN -a RSASHA1 -3 -q $zone > /dev/null
kskname=$($KEYGEN -a ${DEFAULT_ALGORITHM} -3 -q -fk $zone)
$KEYGEN -a ${DEFAULT_ALGORITHM} -3 -q $zone > /dev/null
$DSFROMKEY $kskname.key > dsset-${zone}.
# Create keys for a private secure zone.
zone=private.secure.example
zonefile="${zone}.db"
infile="${zonefile}.in"
ksk=`$KEYGEN -a RSASHA1 -3 -q -fk $zone`
$KEYGEN -a RSASHA1 -3 -q $zone > /dev/null
ksk=$($KEYGEN -a ${DEFAULT_ALGORITHM} -3 -q -fk $zone)
$KEYGEN -a ${DEFAULT_ALGORITHM} -3 -q $zone > /dev/null
keyfile_to_static_ds $ksk > private.conf
cp private.conf ../ns4/private.conf
$SIGNER -S -3 beef -A -o $zone -f $zonefile $infile > /dev/null
@@ -48,10 +48,10 @@ zone=bar
zonefile="${zone}.db"
infile="${zonefile}.in"
cat $infile > $zonefile
for i in Xbar.+005+30676.key Xbar.+005+30804.key Xbar.+005+30676.private \
Xbar.+005+30804.private
for i in Xbar.+013+59973.key Xbar.+013+59973.private \
Xbar.+013+60101.key Xbar.+013+60101.private
do
cp $i `echo $i | sed s/X/K/`
cp $i $(echo $i | sed s/X/K/)
done
$KEYGEN -a RSASHA1 -q $zone > /dev/null
$DSFROMKEY Kbar.+005+30804.key > dsset-bar.
$KEYGEN -a ECDSAP256SHA256 -q $zone > /dev/null
$DSFROMKEY Kbar.+013+60101.key > dsset-bar.
+54 -47
View File
@@ -26,12 +26,12 @@ setup () {
zone="$1"
zonefile="${zone}.db"
infile="${zonefile}.in"
n=`expr ${n:-0} + 1`
n=$((${n:-0} + 1))
}
setup secure.example
cp $infile $zonefile
ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -a $DEFAULT_ALGORITHM -3 -q $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -40,7 +40,7 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup secure.nsec3.example
cp $infile $zonefile
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -49,7 +49,7 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup nsec3.nsec3.example
cp $infile $zonefile
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -62,7 +62,7 @@ count=1
while [ $count -le 1000 ]
do
echo "label${count} IN TXT label${count}" >> $zonefile
count=`expr $count + 1`
count=$((count + 1))
done
# Don't create keys just yet, because the scenario we want to test
# is an unsigned zone that has a NSEC3PARAM record added with
@@ -73,7 +73,7 @@ done
#
setup optout.nsec3.example
cp $infile $zonefile
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -82,7 +82,7 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup nsec3.example
cat $infile dsset-*.${zone}. > $zonefile
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -91,9 +91,9 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup autonsec3.example
cat $infile > $zonefile
ksk=`$KEYGEN -G -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -G -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
echo $ksk > ../autoksk.key
zsk=`$KEYGEN -G -q -a $DEFAULT_ALGORITHM -3 $zone 2> kg.out` || dumpit kg.out
zsk=$($KEYGEN -G -q -a $DEFAULT_ALGORITHM -3 $zone 2> kg.out) || dumpit kg.out
echo $zsk > ../autozsk.key
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -102,7 +102,7 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup secure.optout.example
cp $infile $zonefile
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -111,7 +111,7 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup nsec3.optout.example
cp $infile $zonefile
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -120,7 +120,7 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup optout.optout.example
cp $infile $zonefile
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -129,7 +129,7 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup optout.example
cat $infile dsset-*.${zone}. > $zonefile
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -138,8 +138,8 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup rsasha256.example
cp $infile $zonefile
ksk=`$KEYGEN -q -a RSASHA256 -b 2048 -fk $zone 2> kg.out` || dumpit kg.out
$KEYGEN -q -a RSASHA256 -b 1024 $zone > kg.out 2>&1 || dumpit kg.out
ksk=$($KEYGEN -q -a RSASHA256 -b 2048 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a RSASHA256 -b 2048 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
#
@@ -147,18 +147,25 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup rsasha512.example
cp $infile $zonefile
ksk=`$KEYGEN -q -a RSASHA512 -b 2048 -fk $zone 2> kg.out` || dumpit kg.out
$KEYGEN -q -a RSASHA512 -b 1024 $zone > kg.out 2>&1 || dumpit kg.out
ksk=$($KEYGEN -q -a RSASHA512 -b 2048 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a RSASHA512 -b 2048 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
#
# NSEC-only zone.
# NSEC-only zone. A zone using NSEC-only DNSSEC algorithms.
# None of these algorithms are supported for signing in FIPS mode
# as they are MD5 and SHA1 based.
#
setup nsec.example
cp $infile $zonefile
ksk=`$KEYGEN -q -a RSASHA1 -fk $zone 2> kg.out` || dumpit kg.out
$KEYGEN -q -a RSASHA1 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
if (cd ..; $SHELL ../testcrypto.sh -q RSASHA1)
then
setup nsec-only.example
cp $infile $zonefile
ksk=$($KEYGEN -q -a RSASHA1 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a RSASHA1 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
else
echo_i "skip: nsec-only.example - signing with RSASHA1 not supported"
fi
#
# Signature refresh test zone. Signatures are set to expire long
@@ -170,7 +177,7 @@ count=1
while [ $count -le 1000 ]
do
echo "label${count} IN TXT label${count}" >> $zonefile
count=`expr $count + 1`
count=$((count + 1))
done
$KEYGEN -q -a $DEFAULT_ALGORITHM -fk $zone > kg.out 2>&1 || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM $zone > kg.out 2>&1 || dumpit kg.out
@@ -181,8 +188,8 @@ mv $zonefile.signed $zonefile
# NSEC3->NSEC transition test zone.
#
setup nsec3-to-nsec.example
$KEYGEN -q -a RSASHA512 -b 2048 -fk $zone > kg.out 2>&1 || dumpit kg.out
$KEYGEN -q -a RSASHA512 -b 1024 $zone > kg.out 2>&1 || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM -fk $zone > kg.out 2>&1 || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM $zone > kg.out 2>&1 || dumpit kg.out
$SIGNER -S -3 beef -A -o $zone -f $zonefile $infile > s.out || dumpit s.out
#
@@ -199,9 +206,9 @@ $SIGNER -S -o $zone -f $zonefile $infile > s.out || dumpit s.out
# removal of keys on schedule.
#
setup secure-to-insecure2.example
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
echo $ksk > ../del1.key
zsk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone 2> kg.out` || dumpit kg.out
zsk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone 2> kg.out) || dumpit kg.out
echo $zsk > ../del2.key
$SIGNER -S -3 beef -o $zone -f $zonefile $infile > s.out || dumpit s.out
@@ -246,9 +253,9 @@ $KEYGEN -a $DEFAULT_ALGORITHM -3 -q -L 180 $zone > kg.out 2>&1 || dumpit kg.out
# A zone with a DNSKEY RRset that is published before it's activated
#
setup delay.example
ksk=`$KEYGEN -G -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -G -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
echo $ksk > ../delayksk.key
zsk=`$KEYGEN -G -q -a $DEFAULT_ALGORITHM -3 $zone 2> kg.out` || dumpit kg.out
zsk=$($KEYGEN -G -q -a $DEFAULT_ALGORITHM -3 $zone 2> kg.out) || dumpit kg.out
echo $zsk > ../delayzsk.key
#
@@ -256,8 +263,8 @@ echo $zsk > ../delayzsk.key
# is missing.
#
setup noksk.example
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
zsk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
zsk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone 2> kg.out) || dumpit kg.out
$SIGNER -S -P -s now-1mo -e now-1mi -o $zone -f $zonefile ${zonefile}.in > s.out || dumpit s.out
echo $ksk > ../noksk-ksk.key
rm -f ${ksk}.private
@@ -267,8 +274,8 @@ rm -f ${ksk}.private
# is missing.
#
setup nozsk.example
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
zsk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
zsk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone 2> kg.out) || dumpit kg.out
$SIGNER -S -P -s now-1mo -e now-1mi -o $zone -f $zonefile ${zonefile}.in > s.out || dumpit s.out
echo $ksk > ../nozsk-ksk.key
echo $zsk > ../nozsk-zsk.key
@@ -279,8 +286,8 @@ rm -f ${zsk}.private
# is inactive.
#
setup inaczsk.example
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
zsk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
zsk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone 2> kg.out) || dumpit kg.out
$SIGNER -S -P -s now-1mo -e now-1mi -o $zone -f $zonefile ${zonefile}.in > s.out || dumpit s.out
echo $ksk > ../inaczsk-ksk.key
echo $zsk > ../inaczsk-zsk.key
@@ -299,7 +306,7 @@ $KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out
#
setup sync.example
cp $infile $zonefile
ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk -P sync now $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk -P sync now $zone 2> kg.out) || dumpit kg.out
$KEYGEN -a $DEFAULT_ALGORITHM -3 -q $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
echo ns3/$ksk > ../sync.key
@@ -309,7 +316,7 @@ echo ns3/$ksk > ../sync.key
#
setup kskonly.example
cp $infile $zonefile
ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk -P sync now $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk -P sync now $zone 2> kg.out) || dumpit kg.out
$KEYGEN -a $DEFAULT_ALGORITHM -3 -q $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -318,7 +325,7 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup inacksk2.example
cp $infile $zonefile
ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -Pnow -A now+3600 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -a $DEFAULT_ALGORITHM -3 -q -Pnow -A now+3600 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -a $DEFAULT_ALGORITHM -3 -q $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -327,7 +334,7 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup inaczsk2.example
cp $infile $zonefile
ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -P now -A now+3600 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -337,7 +344,7 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
setup inacksk3.example
cp $infile $zonefile
$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -P now -A now+3600 -fk $zone > kg.out 2>&1 || dumpit kg.out
ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -a $DEFAULT_ALGORITHM -3 -q $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -346,7 +353,7 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup inaczsk3.example
cp $infile $zonefile
ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -a $DEFAULT_ALGORITHM -3 -q $zone > kg.out 2>&1 || dumpit kg.out
$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -P now -A now+3600 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -357,9 +364,9 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup delzsk.example
cp $infile $zonefile
ksk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -a $DEFAULT_ALGORITHM -3 -q -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -a $DEFAULT_ALGORITHM -3 -q $zone > kg.out 2>&1 || dumpit kg.out
zsk=`$KEYGEN -a $DEFAULT_ALGORITHM -3 -q -I now-1w $zone 2>kg.out` || dumpit kg.out
zsk=$($KEYGEN -a $DEFAULT_ALGORITHM -3 -q -I now-1w $zone 2>kg.out) || dumpit kg.out
echo $zsk > ../delzsk.key
#
@@ -367,7 +374,7 @@ echo $zsk > ../delzsk.key
#
setup dname-at-apex-nsec3.example
cp $infile $zonefile
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -376,7 +383,7 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup cds-delete.example
cp $infile $zonefile
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
@@ -386,6 +393,6 @@ $DSFROMKEY $ksk.key > dsset-${zone}.
#
setup cdnskey-delete.example
cp $infile $zonefile
ksk=`$KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out` || dumpit kg.out
ksk=$($KEYGEN -q -a $DEFAULT_ALGORITHM -3 -fk $zone 2> kg.out) || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM -3 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
+2 -2
View File
@@ -156,9 +156,9 @@ zone "rsasha512.example" {
auto-dnssec maintain;
};
zone "nsec.example" {
zone "nsec-only.example" {
type primary;
file "nsec.example.db";
file "nsec-only.example.db";
allow-update { any; };
auto-dnssec maintain;
};
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -166,14 +166,14 @@ n=`expr $n + 1`
ret=0
echo_i "Checking that default version works for rndc ($n)"
$RNDCCMD 10.53.0.1 status > rndc.status.ns1.$n 2>&1
fgrep "version: $BIND_VERSION_STRING" rndc.status.ns1.$n > /dev/null || ret=1
grep -F "version: $BIND_VERSION_STRING" rndc.status.ns1.$n > /dev/null || ret=1
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
n=`expr $n + 1`
ret=0
echo_i "Checking that custom version works for rndc ($n)"
$RNDCCMD 10.53.0.3 status > rndc.status.ns3.$n 2>&1
fgrep "version: $BIND_VERSION_STRING (this is a test of version)" rndc.status.ns3.$n > /dev/null || ret=1
grep -F "version: $BIND_VERSION_STRING (this is a test of version)" rndc.status.ns3.$n > /dev/null || ret=1
if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
n=`expr $n + 1`
+3 -3
View File
@@ -108,7 +108,7 @@ echo_i "reset and check that records are correctly cached initially ($n)"
ret=0
load_cache
dump_cache
nrecords=`filter_tree flushtest.example ns2/named_dump.db.test$n | egrep '(TXT|ANY)' | wc -l`
nrecords=`filter_tree flushtest.example ns2/named_dump.db.test$n | grep -E '(TXT|ANY)' | wc -l`
[ $nrecords -eq 18 ] || { ret=1; echo_i "found $nrecords records expected 18"; }
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -202,7 +202,7 @@ n=`expr $n + 1`
echo_i "check the number of cached records remaining ($n)"
ret=0
dump_cache
nrecords=`filter_tree flushtest.example ns2/named_dump.db.test$n | grep -v '^;' | egrep '(TXT|ANY)' | wc -l`
nrecords=`filter_tree flushtest.example ns2/named_dump.db.test$n | grep -v '^;' | grep -E '(TXT|ANY)' | wc -l`
[ $nrecords -eq 17 ] || { ret=1; echo_i "found $nrecords records expected 17"; }
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
@@ -220,7 +220,7 @@ n=`expr $n + 1`
echo_i "check the number of cached records remaining ($n)"
ret=0
dump_cache
nrecords=`filter_tree flushtest.example ns2/named_dump.db.test$n | egrep '(TXT|ANY)' | wc -l`
nrecords=`filter_tree flushtest.example ns2/named_dump.db.test$n | grep -E '(TXT|ANY)' | wc -l`
[ $nrecords -eq 1 ] || { ret=1; echo_i "found $nrecords records expected 1"; }
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
+6
View File
@@ -28,6 +28,7 @@ options {
listen-on port @EXTRAPORT1@ { 10.53.0.1; };
listen-on-v6 { none; };
notify no;
notify-delay 0;
recursion no;
allow-transfer { any; };
};
@@ -124,3 +125,8 @@ key tsig_key. {
secret "LSAnCU+Z";
algorithm @DEFAULT_HMAC@;
};
key next_key. {
secret "LaAnCU+Z";
algorithm @DEFAULT_HMAC@;
};
+15
View File
@@ -26,6 +26,7 @@ options {
listen-on { 10.53.0.2; };
listen-on-v6 { fd92:7065:b8e:ffff::2; };
notify no;
notify-delay 0;
recursion no;
serial-query-rate 100;
};
@@ -41,29 +42,38 @@ view "default" {
catalog-zones {
zone "catalog1.example"
default-masters { 10.53.0.1; }
min-update-interval 1s
in-memory no
zone-directory "zonedir";
zone "catalog2.example"
default-primaries { 10.53.0.1 port @EXTRAPORT1@; }
min-update-interval 1s
in-memory yes;
zone "catalog3.example"
default-masters { 10.53.0.1; }
min-update-interval 1s
zone-directory "nonexistent";
#T1 zone "catalog4.example"
#T1 min-update-interval 1s
#T1 default-masters { 10.53.0.1; };
#T2 zone "catalog5.example"
#T2 min-update-interval 1s
#T2 default-primaries { 10.53.0.1; };
zone "catalog-bad1.example"
default-masters { 10.53.0.1; }
min-update-interval 1s
in-memory yes;
zone "catalog-bad2.example"
default-masters { 10.53.0.1; }
min-update-interval 1s
in-memory yes;
zone "catalog-bad3.example"
default-masters { 10.53.0.1; }
min-update-interval 1s
in-memory yes;
zone "catalog-bad4.example"
default-masters { 10.53.0.1; }
min-update-interval 1s
in-memory yes;
};
@@ -167,3 +177,8 @@ key tsig_key. {
secret "LSAnCU+Z";
algorithm @DEFAULT_HMAC@;
};
key next_key. {
secret "LaAnCU+Z";
algorithm @DEFAULT_HMAC@;
};
+1
View File
@@ -26,6 +26,7 @@ options {
listen-on { 10.53.0.2; };
listen-on-v6 { fd92:7065:b8e:ffff::2; };
notify no;
notify-delay 0;
recursion no;
serial-query-rate 100;
};
+1
View File
@@ -28,6 +28,7 @@ options {
listen-on { 10.53.0.3; };
listen-on-v6 { fd92:7065:b8e:ffff::3; };
notify no;
notify-delay 0;
recursion no;
};
+51 -1
View File
@@ -1229,6 +1229,56 @@ wait_for_soa @10.53.0.2 dom9.example. dig.out.test$n || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "change TSIG key name on primary ($n)"
ret=0
rndccmd 10.53.0.1 modzone dom9.example. in default '{type primary; notify yes; file "dom9.example.db"; allow-transfer { key next_key; }; };' || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "update TSIG key name in catalog zone ($n)"
ret=0
$NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
server 10.53.0.1 ${PORT}
update del label1.primaries.ext.f0f989bc71c5c8ca3a1eb9c9ab5246521907e3af.zones.catalog1.example. 3600 IN TXT "tsig_key"
update add label1.primaries.ext.f0f989bc71c5c8ca3a1eb9c9ab5246521907e3af.zones.catalog1.example. 3600 IN TXT "next_key"
send
END
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "waiting for secondary to sync up ($n)"
ret=0
wait_for_message ns2/named.run "catz: modifying zone 'dom9.example' from catalog 'catalog1.example'" || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "update zone contents and reload ($n)"
ret=0
echo "@ 3600 IN SOA . . 2 3600 3600 3600 3600" > ns1/dom9.example.db
echo "@ IN NS ns2" >> ns1/dom9.example.db
echo "ns2 IN A 10.53.0.2" >> ns1/dom9.example.db
rndccmd 10.53.0.1 reload dom9.example. || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "wait for primary to update zone ($n)"
ret=0
wait_for_a @10.53.0.1 ns2.dom9.example. dig.out.test$n || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "wait for secondary to update zone ($n)"
ret=0
wait_for_a @10.53.0.2 ns2.dom9.example. dig.out.test$n || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "deleting domain dom9.example. from catalog1 zone ($n)"
ret=0
@@ -1236,7 +1286,7 @@ $NSUPDATE -d <<END >> nsupdate.out.test$n 2>&1 || ret=1
server 10.53.0.1 ${PORT}
update delete f0f989bc71c5c8ca3a1eb9c9ab5246521907e3af.zones.catalog1.example. 3600 IN PTR dom9.example.
update delete label1.primaries.ext.f0f989bc71c5c8ca3a1eb9c9ab5246521907e3af.zones.catalog1.example. 3600 IN A 10.53.0.1
update delete label1.primaries.ext.f0f989bc71c5c8ca3a1eb9c9ab5246521907e3af.zones.catalog1.example. 3600 IN TXT "tsig_key"
update delete label1.primaries.ext.f0f989bc71c5c8ca3a1eb9c9ab5246521907e3af.zones.catalog1.example. 3600 IN TXT "next_key"
send
END
if [ $ret -ne 0 ]; then echo_i "failed"; fi
+12 -12
View File
@@ -19,9 +19,9 @@ touch empty
Z=cds.test
keyz=`$KEYGEN -q -a RSASHA256 $Z`
key1=`$KEYGEN -q -a RSASHA256 -f KSK $Z`
key2=`$KEYGEN -q -a RSASHA256 -f KSK $Z`
keyz=$($KEYGEN -q -a $DEFAULT_ALGORITHM $Z)
key1=$($KEYGEN -q -a $DEFAULT_ALGORITHM -f KSK $Z)
key2=$($KEYGEN -q -a $DEFAULT_ALGORITHM -f KSK $Z)
idz=$(keyfile_to_key_id $keyz)
id1=$(keyfile_to_key_id $key1)
@@ -44,8 +44,8 @@ convert() {
key=$1
n=$2
$DSFROMKEY -12 $key >DS.$n
grep ' 8 1 ' DS.$n >DS.$n-1
grep ' 8 2 ' DS.$n >DS.$n-2
grep " ${DEFAULT_ALGORITHM_NUMBER} 1 " DS.$n >DS.$n-1
grep " ${DEFAULT_ALGORITHM_NUMBER} 2 " DS.$n >DS.$n-2
sed 's/ IN DS / IN CDS /' <DS.$n >>CDS.$n
sed 's/ IN DS / IN CDS /' <DS.$n-1 >>CDS.$n-1
sed 's/ IN DS / IN CDS /' <DS.$n-2 >>CDS.$n-2
@@ -65,9 +65,9 @@ $PERL -we 'utime time, time - 7200, "DS.inplace" or die'
mangle="$PERL mangle.pl"
$mangle " IN DS $id1 8 1 " <DS.1 >DS.broke1
$mangle " IN DS $id1 8 2 " <DS.1 >DS.broke2
$mangle " IN DS $id1 8 [12] " <DS.1 >DS.broke12
$mangle " IN DS $id1 ${DEFAULT_ALGORITHM_NUMBER} 1 " <DS.1 >DS.broke1
$mangle " IN DS $id1 ${DEFAULT_ALGORITHM_NUMBER} 2 " <DS.1 >DS.broke2
$mangle " IN DS $id1 ${DEFAULT_ALGORITHM_NUMBER} [12] " <DS.1 >DS.broke12
sed 's/^/update add /
$a\
@@ -123,14 +123,14 @@ $mangle '\s+IN\s+RRSIG\s+CDS .* '$idz' '$Z'\. ' \
$mangle '\s+IN\s+RRSIG\s+CDS .* '$id1' '$Z'\. ' \
<sig.cds.1 >brk.rrsig.cds.ksk
$mangle " IN CDS $id1 8 1 " <db.cds.1 |
$mangle " IN CDS $id1 ${DEFAULT_ALGORITHM_NUMBER} 1 " <db.cds.1 |
sign cds-mangled
bad=`$PERL -le "print ($id1 ^ 255);"`
sed 's/IN CDS '$id1' 8 1 /IN CDS '$bad' 8 1 /' <db.cds.1 |
bad=$($PERL -le "print ($id1 ^ 255);")
sed "s/IN CDS $id1 ${DEFAULT_ALGORITHM_NUMBER} 1 /IN CDS $bad ${DEFAULT_ALGORITHM_NUMBER} 1 /" <db.cds.1 |
sign bad-digests
sed '/IN CDS '$id1' 8 /p;s//IN CDS '$bad' 13 /' <db.cds.1 |
sed "/IN CDS $id1 ${DEFAULT_ALGORITHM_NUMBER} /p;s//IN CDS $bad $ALTERNATIVE_ALGORITHM_NUMBER /" <db.cds.1 |
sign bad-algos
rm -f dsset-*
+1 -1
View File
@@ -42,7 +42,7 @@ testcase() {
check_stderr() {
if [ -n "${err:=}" ]; then
egrep "$err" err.$n >/dev/null && return 0
grep -E "$err" err.$n >/dev/null && return 0
echo_d "stderr did not match '$err'"
else
[ -s err.$n ] || return 0
+10 -10
View File
@@ -17,38 +17,38 @@ zone=example.
zonefile=example.db
signedfile=example.db.signed
ksk=`$KEYGEN -q -a RSASHA256 -b 2048 -fk $zone`
zsk=`$KEYGEN -q -a RSASHA256 -b 1024 $zone`
ksk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -b ${DEFAULT_BITS} -fk $zone)
zsk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -b ${DEFAULT_BITS} $zone)
$SIGNER -S -o $zone -f $signedfile $zonefile > /dev/null
zone=wildcard-secure.example.
zonefile=wildcard-secure.db
signedfile=wildcard-secure.example.db.signed
ksk=`$KEYGEN -q -a RSASHA256 -b 2048 -fk $zone`
zsk=`$KEYGEN -q -a RSASHA256 -b 1024 $zone`
ksk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -b ${DEFAULT_BITS} -fk $zone)
zsk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -b ${DEFAULT_BITS} $zone)
$SIGNER -S -o $zone -f $signedfile $zonefile > /dev/null
zone=wildcard-nsec.example.
zonefile=wildcard.db
signedfile=wildcard-nsec.example.db.signed
ksk=`$KEYGEN -q -a RSASHA256 -b 2048 -fk $zone`
zsk=`$KEYGEN -q -a RSASHA256 -b 1024 $zone`
ksk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -b ${DEFAULT_BITS} -fk $zone)
zsk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -b ${DEFAULT_BITS} $zone)
$SIGNER -S -o $zone -f $signedfile $zonefile > /dev/null
zone=wildcard-nsec3.example.
zonefile=wildcard.db
signedfile=wildcard-nsec3.example.db.signed
ksk=`$KEYGEN -q -a RSASHA256 -b 2048 -fk $zone`
zsk=`$KEYGEN -q -a RSASHA256 -b 1024 $zone`
ksk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -b ${DEFAULT_BITS} -fk $zone)
zsk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -b ${DEFAULT_BITS} $zone)
$SIGNER -S -3 - -H 0 -o $zone -f $signedfile $zonefile > /dev/null
zone=wildcard-nsec3-optout.example.
zonefile=wildcard.db
signedfile=wildcard-nsec3-optout.example.db.signed
ksk=`$KEYGEN -q -a RSASHA256 -b 2048 -fk $zone`
zsk=`$KEYGEN -q -a RSASHA256 -b 1024 $zone`
ksk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -b ${DEFAULT_BITS} -fk $zone)
zsk=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -b ${DEFAULT_BITS} $zone)
$SIGNER -S -3 - -H 0 -A -o $zone -f $signedfile $zonefile > /dev/null
@@ -11,24 +11,16 @@
* information regarding copyright ownership.
*/
controls { /* empty */ };
/*
* The dnssec-policy is not defined. Should also be caught if it is inherited.
*/
options {
port 5300;
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
allow-query { any; };
recursion no;
dnssec-validation no;
dnssec-policy default;
};
zone "." {
type hint;
file "../../common/root.hint";
};
zone "inlinesec.example" {
zone "example.net" {
type primary;
file "inlinesec.db";
file "example.db";
max-zone-ttl 600;
};
@@ -0,0 +1,25 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* 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.
*/
dnssec-policy "badnsec3alg" {
keys {
csk lifetime unlimited algorithm rsasha1;
};
nsec3param iterations 0 optout 0 salt-length 0;
};
zone "example.net" {
type primary;
file "example.db";
dnssec-policy "badnsec3alg";
};
@@ -0,0 +1,16 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* 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.
*/
options {
random-device "/dev/urandom";
};
@@ -11,12 +11,13 @@
* information regarding copyright ownership.
*/
key rndc_key {
secret "1234abcd8765";
algorithm hmac-sha256;
zone "example.com." {
type primary;
file "example.com.zone";
};
controls {
inet 10.53.0.2 port 9953 allow { any; } keys { rndc_key; };
options {
response-policy {
zone "example.com." ede unsupported;
};
};
@@ -0,0 +1,21 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* 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.
*/
options {
update-ds { 192.168.1.2; };
};
zone "example.net" {
type primary;
file "example.net.db";
};
@@ -0,0 +1,19 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* 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.
*/
zone "example.net" {
type primary;
file "example.net.db";
update-ds { 192.168.1.1; };
update-ds { 192.168.1.1; };
};
@@ -0,0 +1,18 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* 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.
*/
zone "example.net" {
type primary;
file "example.net.db";
update-ds { };
};
@@ -0,0 +1,18 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* 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.
*/
zone "." {
type mirror;
file "root.mirror";
update-ds { 192.168.1.1; };
};
@@ -0,0 +1,22 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* 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.
*/
parental-agents "com" {
192.168.1.2;
};
zone "example.net" {
type primary;
file "example.net.db";
update-ds { "net"; };
};
@@ -13,6 +13,7 @@
options {
dnssec-validation yes;
max-zone-ttl 600;
};
trusted-keys {
@@ -36,3 +37,9 @@ managed-keys {
RUfhHdY6+cn8HFRm+2hM8AnXGXws9555KrUB5qihylGa8subX2Nn6UwN
R1AkUTV74bU=";
};
zone example.com {
type primary;
file "maxttl-bad.db";
max-zone-ttl 120;
};
@@ -40,15 +40,20 @@ options {
zone "example1" {
type primary;
file "example1.db";
inline-signing yes;
};
zone "example2" {
type primary;
file "example2.db";
allow-update {
"any";
};
dnssec-policy "test";
};
zone "example3" {
type primary;
file "example3.db";
inline-signing yes;
dnssec-policy "default";
};
zone "dnssec-policy-none-shared-zonefile1" {
@@ -46,6 +46,7 @@ view "localhost" {
type primary;
file "localhost/example.com.zone";
dnssec-policy "localhost";
inline-signing yes;
};
};
@@ -56,6 +57,7 @@ view "external" {
type primary;
file "external/example.com.zone";
dnssec-policy "internet";
inline-signing yes;
};
};
@@ -66,5 +68,6 @@ view "internal" {
type primary;
file "internal/example.com.zone";
dnssec-policy "intranet";
inline-signing yes;
};
};
@@ -0,0 +1,23 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* 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.
*/
zone "example.com." {
type primary;
file "example.com.zone";
};
options {
response-policy {
zone "example.com." ede none;
};
};
@@ -0,0 +1,23 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* 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.
*/
zone "example.com." {
type primary;
file "example.com.zone";
};
options {
response-policy {
zone "example.com." ede filtered;
};
};
@@ -30,6 +30,7 @@ server 0.0.0.0 {
request-expire no;
request-ixfr no;
request-nsid no;
require-cookie no;
send-cookie no;
tcp-keepalive no;
tcp-only no;
@@ -52,6 +53,7 @@ server :: {
request-expire no;
request-ixfr no;
request-nsid no;
require-cookie no;
send-cookie no;
tcp-keepalive no;
tcp-only no;
+20
View File
@@ -103,6 +103,7 @@ view "first" {
zone "clone" {
type primary;
file "yyy";
inline-signing yes;
max-ixfr-ratio unlimited;
};
dnssec-validation auto;
@@ -166,9 +167,12 @@ view "third" {
zone "p" {
type primary;
file "pfile";
inline-signing yes;
};
zone "s" {
type secondary;
file "sfile";
inline-signing yes;
primaries {
1.2.3.4;
};
@@ -179,24 +183,34 @@ view "fourth" {
zone "dnssec-test" {
type primary;
file "dnssec-test.db";
inline-signing yes;
parental-agents {
1.2.3.4;
1.2.3.5;
};
update-ds {
"parents";
};
dnssec-policy "test";
parental-source 10.10.10.10 port 53 dscp 55;
};
zone "dnssec-default" {
type primary;
file "dnssec-default.db";
inline-signing yes;
parental-agents {
"parents";
};
update-ds {
1.2.3.4;
1.2.3.5;
};
dnssec-policy "default";
};
zone "dnssec-inherit" {
type primary;
file "dnssec-inherit.db";
inline-signing yes;
};
zone "dnssec-none" {
type primary;
@@ -206,11 +220,13 @@ view "fourth" {
zone "dnssec-view1" {
type primary;
file "dnssec-view41.db";
inline-signing yes;
dnssec-policy "test";
};
zone "dnssec-view2" {
type primary;
file "dnssec-view42.db";
inline-signing yes;
};
zone "dnssec-view3" {
type primary;
@@ -230,17 +246,20 @@ view "fifth" {
zone "dnssec-view1" {
type primary;
file "dnssec-view51.db";
inline-signing yes;
dnssec-policy "test";
};
zone "dnssec-view2" {
type primary;
file "dnssec-view52.db";
inline-signing yes;
dnssec-policy "test";
key-directory "keys";
};
zone "dnssec-view3" {
type primary;
file "dnssec-view53.db";
inline-signing yes;
dnssec-policy "default";
key-directory "keys";
};
@@ -255,6 +274,7 @@ view "chaos" chaos {
zone "hostname.bind" chaos {
type primary;
database "_builtin hostname";
inline-signing yes;
};
};
dyndb "name" "library.so" {
@@ -26,4 +26,3 @@ zone "nsec3.net" {
sig-validity-interval 3600;
update-check-ksk yes;
};
@@ -57,4 +57,5 @@ zone "example.net" {
type primary;
file "example.db";
dnssec-policy "default";
inline-signing yes;
};
@@ -34,11 +34,13 @@ dnssec-policy "bad-sigrefresh-dnskey" {
zone "sigrefresh.example.net" {
type primary;
file "sigrefresh.example.db";
inline-signing yes;
dnssec-policy "bad-sigrefresh";
};
zone "dnskey.example.net" {
type primary;
file "dnskey.example.db";
inline-signing yes;
dnssec-policy "bad-sigrefresh-dnskey";
};
@@ -22,5 +22,6 @@ zone "example.net" {
type primary;
file "example.db";
dnssec-policy "warn-length";
inline-signing yes;
};
@@ -42,18 +42,21 @@ dnssec-policy "warn3" {
zone "warn1.example.net" {
type primary;
file "warn1.example.db";
inline-signing yes;
dnssec-policy "warn1";
};
zone "warn2.example.net" {
type primary;
file "warn2.example.db";
inline-signing yes;
dnssec-policy "warn2";
};
zone "warn3.example.net" {
type primary;
file "warn3.example.db";
inline-signing yes;
dnssec-policy "warn3";
};
+2 -1
View File
@@ -157,6 +157,7 @@ ret=0
$CHECKCONF deprecated.conf > checkconf.out$n.1 2>&1
grep "option 'managed-keys' is deprecated" < checkconf.out$n.1 > /dev/null || ret=1
grep "option 'trusted-keys' is deprecated" < checkconf.out$n.1 > /dev/null || ret=1
grep "option 'max-zone-ttl' is deprecated" < checkconf.out$n.1 > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
# set -i to ignore deprecate warnings
@@ -491,7 +492,7 @@ n=`expr $n + 1`
echo_i "checking named-checkconf kasp errors ($n)"
ret=0
$CHECKCONF kasp-and-other-dnssec-options.conf > checkconf.out$n 2>&1 && ret=1
grep "'inline-signing;' cannot be set to 'no' if dnssec-policy is also set on a non-dynamic DNS zone" < checkconf.out$n > /dev/null || ret=1
grep "'inline-signing yes;' must also be configured explicitly for zones using dnssec-policy without a configured 'allow-update' or 'update-policy'" < checkconf.out$n > /dev/null || ret=1
grep "'auto-dnssec maintain;' cannot be configured if dnssec-policy is also set" < checkconf.out$n > /dev/null || ret=1
grep "dnskey-sig-validity: cannot be configured if dnssec-policy is also set" < checkconf.out$n > /dev/null || ret=1
grep "dnssec-dnskey-kskonly: cannot be configured if dnssec-policy is also set" < checkconf.out$n > /dev/null || ret=1
@@ -49,6 +49,7 @@ zone "." {
zone "dspublished.checkds" {
type primary;
file "dspublished.checkds.db";
inline-signing yes;
dnssec-policy "default";
parental-agents { 10.53.0.2 port @PORT@; };
};
@@ -60,6 +61,7 @@ zone "dspublished.checkds" {
zone "reference.checkds" {
type primary;
file "reference.checkds.db";
inline-signing yes;
dnssec-policy "default";
parental-agents { "ns2"; };
};
@@ -71,6 +73,7 @@ zone "reference.checkds" {
zone "missing-dspublished.checkds" {
type primary;
file "missing-dspublished.checkds.db";
inline-signing yes;
dnssec-policy "default";
parental-agents {
10.53.0.5 port @PORT@; // missing
@@ -85,6 +88,7 @@ zone "missing-dspublished.checkds" {
zone "bad-dspublished.checkds" {
type primary;
file "bad-dspublished.checkds.db";
inline-signing yes;
dnssec-policy "default";
parental-agents {
10.53.0.6 port @PORT@; // bad
@@ -98,6 +102,7 @@ zone "bad-dspublished.checkds" {
zone "multiple-dspublished.checkds" {
type primary;
file "multiple-dspublished.checkds.db";
inline-signing yes;
dnssec-policy "default";
parental-agents {
10.53.0.2 port @PORT@;
@@ -113,6 +118,7 @@ zone "multiple-dspublished.checkds" {
zone "incomplete-dspublished.checkds" {
type primary;
file "incomplete-dspublished.checkds.db";
inline-signing yes;
dnssec-policy "default";
parental-agents {
10.53.0.2 port @PORT@;
@@ -130,6 +136,7 @@ zone "incomplete-dspublished.checkds" {
zone "bad2-dspublished.checkds" {
type primary;
file "bad2-dspublished.checkds.db";
inline-signing yes;
dnssec-policy "default";
parental-agents {
10.53.0.2 port @PORT@;
@@ -150,6 +157,7 @@ zone "bad2-dspublished.checkds" {
zone "dswithdrawn.checkds" {
type primary;
file "dswithdrawn.checkds.db";
inline-signing yes;
dnssec-policy "insecure";
parental-agents { 10.53.0.5 port @PORT@; };
};
@@ -157,6 +165,7 @@ zone "dswithdrawn.checkds" {
zone "missing-dswithdrawn.checkds" {
type primary;
file "missing-dswithdrawn.checkds.db";
inline-signing yes;
dnssec-policy "insecure";
parental-agents {
10.53.0.2 port @PORT@; // still published
@@ -166,6 +175,7 @@ zone "missing-dswithdrawn.checkds" {
zone "bad-dswithdrawn.checkds" {
type primary;
file "bad-dswithdrawn.checkds.db";
inline-signing yes;
dnssec-policy "insecure";
parental-agents {
10.53.0.6 port @PORT@; // bad
@@ -175,6 +185,7 @@ zone "bad-dswithdrawn.checkds" {
zone "multiple-dswithdrawn.checkds" {
type primary;
file "multiple-dswithdrawn.checkds.db";
inline-signing yes;
dnssec-policy "insecure";
parental-agents {
10.53.0.5 port @PORT@;
@@ -185,6 +196,7 @@ zone "multiple-dswithdrawn.checkds" {
zone "incomplete-dswithdrawn.checkds" {
type primary;
file "incomplete-dswithdrawn.checkds.db";
inline-signing yes;
dnssec-policy "insecure";
parental-agents {
10.53.0.2 port @PORT@; // still published
@@ -196,6 +208,7 @@ zone "incomplete-dswithdrawn.checkds" {
zone "bad2-dswithdrawn.checkds" {
type primary;
file "bad2-dswithdrawn.checkds.db";
inline-signing yes;
dnssec-policy "insecure";
parental-agents {
10.53.0.5 port @PORT@;

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