Compare commits

...
Author SHA1 Message Date
Evan Hunt fb7846bf2e 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-12 14:36:47 -07: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ń 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
336 changed files with 14459 additions and 15689 deletions
+48 -16
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
@@ -120,6 +116,10 @@ stages:
image: "$CI_REGISTRY_IMAGE:oraclelinux-8-amd64"
<<: *linux_amd64
.oraclelinux-9-amd64: &oraclelinux_9_amd64_image
image: "$CI_REGISTRY_IMAGE:oraclelinux-9-amd64"
<<: *linux_amd64
# Debian
.debian-buster-amd64: &debian_buster_amd64_image
@@ -181,11 +181,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
@@ -599,7 +599,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
@@ -617,6 +617,30 @@ unit:gcc:oraclelinux8:amd64:
- job: gcc:oraclelinux8:amd64
artifacts: true
# Jobs for regular GCC builds on Oracle Linux 9 (amd64)
gcc:oraclelinux9:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *oraclelinux_9_amd64_image
<<: *build_job
system:gcc:oraclelinux9:amd64:
<<: *oraclelinux_9_amd64_image
<<: *system_test_job
needs:
- job: gcc:oraclelinux9:amd64
artifacts: true
unit:gcc:oraclelinux9:amd64:
<<: *oraclelinux_9_amd64_image
<<: *unit_test_job
needs:
- job: gcc:oraclelinux9:amd64
artifacts: true
# Jobs for regular GCC builds on Debian 10 "buster" (amd64)
gcc:buster:amd64:
@@ -870,7 +894,7 @@ gcc:bionic:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -O2"
EXTRA_CONFIGURE: "--disable-dnstap"
EXTRA_CONFIGURE: "--disable-dnstap --without-cmocka --without-gssapi"
<<: *ubuntu_bionic_amd64_image
<<: *build_job
<<: *api_schedules_tags_triggers_web_triggering_rules
@@ -921,7 +945,7 @@ gcc:jammy:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--with-libidn2"
EXTRA_CONFIGURE: "--with-libidn2 --disable-doh"
<<: *ubuntu_jammy_amd64_image
<<: *build_job
@@ -946,14 +970,12 @@ gcc:asan:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined -Wno-error=stringop-overread"
LDFLAGS: "-fsanitize=address,undefined"
SOFTHSM2_MODULE: "/lib64/libsofthsm2.so"
EXTRA_CONFIGURE: "--with-libidn2 --without-jemalloc"
<<: *fedora_35_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
<<: *system_test_job
@@ -998,14 +1020,12 @@ gcc:tsan:
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
<<: *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
<<: *system_test_tsan_job
@@ -1055,10 +1075,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"
<<: *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:
@@ -1200,10 +1228,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
@@ -1436,9 +1464,13 @@ 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/isc/include/isc/*.h lib/isc/
- cp -f lib/dns/include/dns/*.h lib/dns/
- cp -f lib/dns/include/dns/*.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.
+104
View File
@@ -1,3 +1,107 @@
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]
5962. [placeholder]
5961. [placeholder]
5960. [placeholder]
5959. [placeholder]
5958. [placeholder]
5957. [placeholder]
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
-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>
+113 -85
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) {
@@ -1708,59 +1709,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 +1780,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 +1859,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);
}
+48 -74
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"
@@ -359,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";
@@ -782,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);
}
@@ -799,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);
}
@@ -1552,12 +1552,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;
}
@@ -1613,7 +1613,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");
@@ -1621,33 +1621,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;
@@ -2350,7 +2345,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));
@@ -2836,7 +2831,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;
@@ -2900,38 +2895,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
@@ -2995,8 +2984,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);
@@ -3015,9 +3002,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);
}
@@ -3040,13 +3024,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
@@ -3057,15 +3038,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 */
+8 -28
View File
@@ -432,28 +432,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 +741,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
~~~~~~~~~~~~
+157 -292
View File
@@ -34,12 +34,12 @@
#include <idn2.h>
#endif /* HAVE_LIBIDN2 */
#include <isc/app.h>
#include <isc/base64.h>
#include <isc/file.h>
#include <isc/hex.h>
#include <isc/lang.h>
#include <isc/log.h>
#include <isc/loop.h>
#include <isc/managers.h>
#include <isc/netaddr.h>
#include <isc/netdb.h>
@@ -89,7 +89,7 @@ dig_lookuplist_t lookup_list;
dig_serverlist_t server_list;
dig_searchlistlist_t search_list;
static atomic_bool cancel_now = false;
static bool cancel_now = false;
bool check_ra = false, have_ipv4 = false, have_ipv6 = false,
specified_source = false, free_now = false, usesearch = false,
@@ -103,7 +103,8 @@ isc_mem_t *mctx = NULL;
isc_log_t *lctx = NULL;
isc_nm_t *netmgr = NULL;
isc_taskmgr_t *taskmgr = NULL;
isc_task_t *global_task = NULL;
isc_loopmgr_t *loopmgr = NULL;
isc_loop_t *mainloop = NULL;
isc_sockaddr_t localaddr;
isc_refcount_t sendcount = 0;
isc_refcount_t recvcount = 0;
@@ -115,11 +116,7 @@ static char servercookie[256];
#ifdef HAVE_LIBIDN2
static void
idn_locale_to_ace(const char *src, char *dst, size_t dstlen);
static void
idn_ace_to_locale(const char *src, char **dst);
static isc_result_t
idn_output_filter(isc_buffer_t *buffer, unsigned int used_org);
idn_input(const char *src, char *dst, size_t dstlen);
#endif /* HAVE_LIBIDN2 */
isc_nmhandle_t *keep = NULL;
@@ -151,27 +148,10 @@ bool debugging = false;
bool debugtiming = false;
bool memdebugging = false;
char *progname = NULL;
isc_mutex_t lookup_lock;
dig_lookup_t *current_lookup = NULL;
#define DIG_MAX_ADDRESSES 20
/*%
* Apply and clear locks at the event level in global task.
* Can I get rid of these using shutdown events? XXX
*/
#define LOCK_LOOKUP \
{ \
debug("lock_lookup %s:%d", __FILE__, __LINE__); \
isc_mutex_lock((&lookup_lock)); \
debug("success"); \
}
#define UNLOCK_LOOKUP \
{ \
debug("unlock_lookup %s:%d", __FILE__, __LINE__); \
isc_mutex_unlock((&lookup_lock)); \
}
static void
default_warnerr(const char *format, ...) {
va_list args;
@@ -552,8 +532,10 @@ set_nameserver(char *opt) {
return;
}
isc_loopmgr_blocking(loopmgr);
result = bind9_getaddresses(opt, 0, sockaddrs, DIG_MAX_ADDRESSES,
&count);
isc_loopmgr_nonblocking(loopmgr);
if (result != ISC_R_SUCCESS) {
fatal("couldn't get address for '%s': %s", opt,
isc_result_totext(result));
@@ -599,8 +581,13 @@ clone_server_list(dig_serverlist_t src, dig_serverlist_t *dest) {
dig_lookup_t *
make_empty_lookup(void) {
dig_lookup_t *looknew;
int idnin = false, idnout = false;
#ifdef HAVE_LIBIDN2
bool idn_allowed = isatty(1) ? (getenv("IDN_DISABLE") == NULL) : false;
if (getenv("IDN_DISABLE") == NULL) {
idnin = true;
idnout = isatty(1);
}
#endif /* HAVE_LIBIDN2 */
debug("make_empty_lookup()");
@@ -617,10 +604,8 @@ make_empty_lookup(void) {
.besteffort = true,
.opcode = dns_opcode_query,
.badcookie = true,
#ifdef HAVE_LIBIDN2
.idnin = idn_allowed,
.idnout = idn_allowed,
#endif /* HAVE_LIBIDN2 */
.idnin = idnin,
.idnout = idnout,
.udpsize = -1,
.edns = -1,
.recurse = true,
@@ -1374,8 +1359,7 @@ setup_libs(void) {
fatal("can't find either v4 or v6 networking");
}
isc_mem_create(&mctx);
isc_mem_setname(mctx, "dig");
isc_managers_create(&mctx, 1, &loopmgr, &netmgr, &taskmgr);
isc_log_create(mctx, &lctx, &logconfig);
isc_log_setcontext(lctx);
@@ -1387,17 +1371,12 @@ setup_libs(void) {
isc_log_setdebuglevel(lctx, 0);
isc_managers_create(mctx, 1, 0, &netmgr, &taskmgr, NULL);
result = isc_task_create(taskmgr, 0, &global_task, 0);
check_result(result, "isc_task_create");
isc_task_setname(global_task, "dig", NULL);
isc_mem_setname(mctx, "dig");
mainloop = isc_loop_main(loopmgr);
result = dst_lib_init(mctx, NULL);
check_result(result, "dst_lib_init");
is_dst_up = true;
isc_mutex_init(&lookup_lock);
}
typedef struct dig_ednsoptname {
@@ -1546,6 +1525,10 @@ check_if_done(void) {
INSIST(isc_refcount_current(&recvcount) == 0);
debug("shutting down");
dighost_shutdown();
if (current_lookup == NULL && keep != NULL) {
isc_nmhandle_detach(&keep);
}
}
}
@@ -1773,7 +1756,7 @@ void
start_lookup(void) {
debug("start_lookup()");
if (atomic_load(&cancel_now)) {
if (cancel_now) {
return;
}
@@ -1824,11 +1807,19 @@ clear_current_lookup(void) {
return;
}
if (lookup->cleared) {
debug("current_lookup is already cleared");
return;
}
if (ISC_LIST_HEAD(lookup->q) != NULL) {
debug("still have a worker");
return;
}
lookup->cleared = true;
debug("lookup cleared");
lookup_detach(&lookup);
}
@@ -2228,7 +2219,7 @@ setup_lookup(dig_lookup_t *lookup) {
textname = lookup->textname;
#ifdef HAVE_LIBIDN2
if (lookup->idnin) {
idn_locale_to_ace(textname, idn_textname, sizeof(idn_textname));
idn_input(textname, idn_textname, sizeof(idn_textname));
debug("idn_textname: %s", idn_textname);
textname = idn_textname;
}
@@ -2259,8 +2250,7 @@ setup_lookup(dig_lookup_t *lookup) {
origin = lookup->origin->origin;
#ifdef HAVE_LIBIDN2
if (lookup->idnin) {
idn_locale_to_ace(origin, idn_origin,
sizeof(idn_origin));
idn_input(origin, idn_origin, sizeof(idn_origin));
debug("trying idn origin %s", idn_origin);
origin = idn_origin;
}
@@ -2724,8 +2714,6 @@ send_done(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
INSIST(!free_now);
LOCK_LOOKUP;
isc_nmhandle_detach(&query->sendhandle);
lookup_attach(query->lookup, &l);
@@ -2737,7 +2725,6 @@ send_done(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
}
query_detach(&query);
lookup_detach(&l);
UNLOCK_LOOKUP;
return;
} else if (eresult != ISC_R_SUCCESS) {
debug("send failed: %s", isc_result_totext(eresult));
@@ -2751,7 +2738,6 @@ send_done(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
}
check_if_done();
UNLOCK_LOOKUP;
}
/*%
@@ -2922,6 +2908,8 @@ start_tcp(dig_query_t *query) {
isc_tlsctx_t *tlsctx = NULL;
bool tls_mode = false;
isc_tlsctx_client_session_cache_t *sess_cache = NULL;
int local_timeout;
REQUIRE(DIG_VALID_QUERY(query));
debug("start_tcp(%p)", query);
@@ -2992,69 +2980,67 @@ start_tcp(dig_query_t *query) {
launch_next_query(query);
query_detach(&query);
return;
} else if (keep != NULL) {
isc_nmhandle_detach(&keep);
}
if (timeout != 0) {
local_timeout = timeout * 1000;
} else {
int local_timeout = timeout * 1000;
if (local_timeout == 0) {
local_timeout = TCP_TIMEOUT * 1000;
local_timeout = TCP_TIMEOUT * 1000;
}
if (!specified_source) {
if ((isc_sockaddr_pf(&query->sockaddr) == AF_INET) && have_ipv4)
{
isc_sockaddr_any(&localaddr);
} else {
isc_sockaddr_any6(&localaddr);
}
}
if (keep != NULL) {
isc_nmhandle_detach(&keep);
REQUIRE(query != NULL);
query_attach(query, &connectquery);
if (tls_mode) {
tlsctx = get_create_tls_context(connectquery, false,
&sess_cache);
if (tlsctx == NULL) {
goto failure_tls;
}
isc_nm_tlsdnsconnect(netmgr, &localaddr, &query->sockaddr,
tcp_connected, connectquery, local_timeout,
tlsctx, sess_cache);
#if HAVE_LIBNGHTTP2
} else if (query->lookup->https_mode) {
char uri[4096] = { 0 };
isc_nm_http_makeuri(!query->lookup->http_plain,
&query->sockaddr, query->userarg, port,
query->lookup->https_path, uri,
sizeof(uri));
if (!specified_source) {
if ((isc_sockaddr_pf(&query->sockaddr) == AF_INET) &&
have_ipv4) {
isc_sockaddr_any(&localaddr);
} else {
isc_sockaddr_any6(&localaddr);
}
}
REQUIRE(query != NULL);
query_attach(query, &connectquery);
if (tls_mode) {
tlsctx = get_create_tls_context(connectquery, false,
if (!query->lookup->http_plain) {
tlsctx = get_create_tls_context(connectquery, true,
&sess_cache);
if (tlsctx == NULL) {
goto failure_tls;
}
isc_nm_tlsdnsconnect(netmgr, &localaddr,
&query->sockaddr, tcp_connected,
connectquery, local_timeout,
tlsctx, sess_cache);
#if HAVE_LIBNGHTTP2
} else if (query->lookup->https_mode) {
char uri[4096] = { 0 };
isc_nm_http_makeuri(!query->lookup->http_plain,
&query->sockaddr, query->userarg,
port, query->lookup->https_path,
uri, sizeof(uri));
if (!query->lookup->http_plain) {
tlsctx = get_create_tls_context(
connectquery, true, &sess_cache);
if (tlsctx == NULL) {
goto failure_tls;
}
}
isc_nm_httpconnect(netmgr, &localaddr, &query->sockaddr,
uri, !query->lookup->https_get,
tcp_connected, connectquery, tlsctx,
sess_cache, local_timeout);
#endif
} else {
isc_nm_tcpdnsconnect(netmgr, &localaddr,
&query->sockaddr, tcp_connected,
connectquery, local_timeout);
}
/* XXX: set DSCP */
isc_nm_httpconnect(netmgr, &localaddr, &query->sockaddr, uri,
!query->lookup->https_get, tcp_connected,
connectquery, tlsctx, sess_cache,
local_timeout);
#endif
} else {
isc_nm_tcpdnsconnect(netmgr, &localaddr, &query->sockaddr,
tcp_connected, connectquery,
local_timeout);
}
/* XXX: set DSCP */
return;
failure_tls:
@@ -3137,7 +3123,7 @@ udp_ready(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
query->started = true;
if (atomic_load(&cancel_now)) {
if (cancel_now) {
query_detach(&query);
return;
}
@@ -3147,7 +3133,6 @@ udp_ready(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
debug("udp_ready(%p, %s, %p)", handle, isc_result_totext(eresult),
query);
LOCK_LOOKUP;
lookup_attach(query->lookup, &l);
if (eresult == ISC_R_CANCELED || query->canceled) {
@@ -3158,7 +3143,6 @@ udp_ready(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
query_detach(&query);
lookup_detach(&l);
clear_current_lookup();
UNLOCK_LOOKUP;
return;
}
@@ -3179,7 +3163,6 @@ udp_ready(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
nssearch_next(l, query);
check_if_done();
UNLOCK_LOOKUP;
return;
}
@@ -3214,7 +3197,6 @@ udp_ready(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
}
check_if_done();
UNLOCK_LOOKUP;
return;
}
@@ -3242,7 +3224,6 @@ udp_ready(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
query_detach(&query);
lookup_detach(&l);
UNLOCK_LOOKUP;
}
/*%
@@ -3349,11 +3330,9 @@ force_next(dig_query_t *query) {
debug("force_next()");
LOCK_LOOKUP;
INSIST(!free_now);
if (atomic_load(&cancel_now)) {
UNLOCK_LOOKUP;
if (cancel_now) {
return;
}
@@ -3361,7 +3340,6 @@ force_next(dig_query_t *query) {
if (try_next_server(l)) {
lookup_detach(&l);
UNLOCK_LOOKUP;
return;
}
@@ -3376,7 +3354,6 @@ force_next(dig_query_t *query) {
isc_refcount_current(&recvcount));
query_detach(&query);
clear_current_lookup();
UNLOCK_LOOKUP;
return;
}
@@ -3407,7 +3384,6 @@ force_next(dig_query_t *query) {
cancel_lookup(l);
lookup_detach(&l);
clear_current_lookup();
UNLOCK_LOOKUP;
}
/*%
@@ -3525,7 +3501,7 @@ tcp_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
query->started = true;
if (atomic_load(&cancel_now)) {
if (cancel_now) {
query_detach(&query);
return;
}
@@ -3535,7 +3511,6 @@ tcp_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
debug("tcp_connected(%p, %s, %p)", handle, isc_result_totext(eresult),
query);
LOCK_LOOKUP;
lookup_attach(query->lookup, &l);
if (eresult == ISC_R_CANCELED || eresult == ISC_R_TLSBADPEERCERT ||
@@ -3562,7 +3537,6 @@ tcp_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
query_detach(&query);
lookup_detach(&l);
clear_current_lookup();
UNLOCK_LOOKUP;
return;
}
@@ -3582,9 +3556,7 @@ tcp_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
*/
if (l->ns_search_only && !l->trace_root) {
nssearch_next(l, query);
check_if_done();
UNLOCK_LOOKUP;
return;
}
@@ -3620,7 +3592,6 @@ tcp_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
}
check_if_done();
UNLOCK_LOOKUP;
return;
}
@@ -3639,7 +3610,6 @@ tcp_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) {
launch_next_query(query);
query_detach(&query);
lookup_detach(&l);
UNLOCK_LOOKUP;
}
/*%
@@ -3913,8 +3883,6 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
debug("recv_done(%p, %s, %p, %p)", handle, isc_result_totext(eresult),
region, arg);
LOCK_LOOKUP;
isc_refcount_decrement0(&recvcount);
debug("recvcount=%" PRIuFAST32, isc_refcount_current(&recvcount));
@@ -3929,7 +3897,6 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
query_detach(&query);
lookup_detach(&l);
clear_current_lookup();
UNLOCK_LOOKUP;
return;
}
@@ -3939,7 +3906,7 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
TIME_NOW(&query->time_recv);
}
if ((!l->pending && !l->ns_search_only) || atomic_load(&cancel_now)) {
if ((!l->pending && !l->ns_search_only) || cancel_now) {
debug("no longer pending. Got %s", isc_result_totext(eresult));
goto next_lookup;
@@ -4150,8 +4117,7 @@ recv_done(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
&l->querysig);
check_result(result, "dns_message_getquerytsig");
}
result = dns_message_setquerytsig(msg, l->querysig);
check_result(result, "dns_message_setquerytsig");
dns_message_setquerytsig(msg, l->querysig);
result = dns_message_settsigkey(msg, tsigkey);
check_result(result, "dns_message_settsigkey");
msg->tsigctx = l->tsigctx;
@@ -4522,7 +4488,6 @@ keep_query:
if (donext) {
clear_current_lookup();
}
UNLOCK_LOOKUP;
}
/*%
@@ -4534,16 +4499,10 @@ isc_result_t
get_address(char *host, in_port_t myport, isc_sockaddr_t *sockaddr) {
int count;
isc_result_t result;
bool is_running;
is_running = isc_app_isrunning();
if (is_running) {
isc_app_block();
}
isc_loopmgr_blocking(loopmgr);
result = bind9_getaddresses(host, myport, sockaddr, 1, &count);
if (is_running) {
isc_app_unblock();
}
isc_loopmgr_nonblocking(loopmgr);
if (result != ISC_R_SUCCESS) {
return (result);
}
@@ -4562,8 +4521,10 @@ getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp) {
dig_server_t *srv;
char tmp[ISC_NETADDR_FORMATSIZE];
isc_loopmgr_blocking(loopmgr);
result = bind9_getaddresses(host, 0, sockaddrs, DIG_MAX_ADDRESSES,
&count);
isc_loopmgr_nonblocking(loopmgr);
if (resultp != NULL) {
*resultp = result;
}
@@ -4611,13 +4572,17 @@ do_lookup(dig_lookup_t *lookup) {
* Start everything in action upon task startup.
*/
void
onrun_callback(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
onrun_callback(void *arg) {
UNUSED(arg);
start_lookup();
}
void
run_loop(void *arg) {
UNUSED(arg);
isc_event_free(&event);
LOCK_LOOKUP;
start_lookup();
UNLOCK_LOOKUP;
}
/*%
@@ -4631,12 +4596,12 @@ cancel_all(void) {
debug("cancel_all()");
LOCK_LOOKUP;
if (free_now) {
UNLOCK_LOOKUP;
return;
}
atomic_store(&cancel_now, true);
cancel_now = true;
while (current_lookup != NULL) {
for (q = ISC_LIST_HEAD(current_lookup->q); q != NULL; q = nq) {
nq = ISC_LIST_NEXT(q, link);
@@ -4664,7 +4629,6 @@ cancel_all(void) {
lookup_detach(&l);
l = n;
}
UNLOCK_LOOKUP;
}
/*%
@@ -4673,18 +4637,8 @@ cancel_all(void) {
*/
void
destroy_libs(void) {
if (keep != NULL) {
isc_nmhandle_detach(&keep);
}
debug("destroy_libs()");
if (global_task != NULL) {
debug("freeing task");
isc_task_detach(&global_task);
}
isc_managers_destroy(&netmgr, &taskmgr, NULL);
LOCK_LOOKUP;
isc_refcount_destroy(&recvcount);
isc_refcount_destroy(&sendcount);
@@ -4712,8 +4666,6 @@ destroy_libs(void) {
is_dst_up = false;
}
UNLOCK_LOOKUP;
isc_mutex_destroy(&lookup_lock);
debug("Removing log context");
isc_log_destroy(&lctx);
@@ -4721,63 +4673,53 @@ destroy_libs(void) {
if (memdebugging != 0) {
isc_mem_stats(mctx, stderr);
}
if (mctx != NULL) {
isc_mem_destroy(&mctx);
}
isc_managers_destroy(&mctx, &loopmgr, &netmgr, &taskmgr);
}
#ifdef HAVE_LIBIDN2
static isc_result_t
idn_output_filter(isc_buffer_t *buffer, unsigned int used_org) {
char src[MXNAME], *dst = NULL;
idn_filter(isc_buffer_t *buffer, unsigned start) {
char src[MXNAME];
char *dst = NULL;
size_t srclen, dstlen;
isc_result_t result = ISC_R_SUCCESS;
int res;
/*
* Copy name from 'buffer' to 'src' and terminate it with NULL.
*/
srclen = isc_buffer_usedlength(buffer) - used_org;
if (srclen >= sizeof(src)) {
warn("Input name too long to perform IDN conversion");
goto cleanup;
}
memmove(src, (char *)isc_buffer_base(buffer) + used_org, srclen);
srclen = isc_buffer_usedlength(buffer) - start;
INSIST(srclen < sizeof(src));
memmove(src, (char *)isc_buffer_base(buffer) + start, srclen);
src[srclen] = '\0';
/*
* Try to convert the name; leave it unchanged if conversion fails.
*/
systemlocale(LC_ALL);
/*
* Convert 'src' to the current locale's character encoding.
*/
idn_ace_to_locale(src, &dst);
res = idn2_to_unicode_8zlz(src, &dst, IDN2_NONTRANSITIONAL);
if (res == IDN2_DISALLOWED) {
res = idn2_to_unicode_8zlz(src, &dst, IDN2_TRANSITIONAL);
}
resetlocale(LC_ALL);
/*
* Check whether the converted name will fit back into 'buffer'.
*/
dstlen = strlen(dst);
if (isc_buffer_length(buffer) < used_org + dstlen) {
result = ISC_R_NOSPACE;
goto cleanup;
if (res != IDN2_OK) {
return (ISC_R_SUCCESS);
}
/*
* Put the converted name back into 'buffer'.
* Copy the converted back into 'buffer' if it fits.
*/
dstlen = strlen(dst);
if (isc_buffer_length(buffer) < start + dstlen) {
return (ISC_R_NOSPACE);
}
isc_buffer_subtract(buffer, srclen);
memmove(isc_buffer_used(buffer), dst, dstlen);
isc_buffer_add(buffer, dstlen);
/*
* Clean up.
*/
cleanup:
if (dst != NULL) {
idn2_free(dst);
}
return (result);
idn2_free(dst);
return (ISC_R_SUCCESS);
}
/*%
@@ -4788,119 +4730,42 @@ cleanup:
* 'dst' MUST be large enough to hold any valid domain name.
*/
static void
idn_locale_to_ace(const char *src, char *dst, size_t dstlen) {
const char *final_src;
char *ascii_src;
idn_input(const char *src, char *dst, size_t dstlen) {
char *ascii = NULL;
size_t len;
int res;
systemlocale(LC_ALL);
/*
* We trust libidn2 to return an error if 'src' is too large to be a
* valid domain name.
*
* If conversion fails under IDNA2008 rules, retry with transitional
* rules. The aim is that characters whose interpretation changed will
* be handled under the new rules, but we will accept characters (such
* as emoji) that were OK but are now forbidden.
*/
res = idn2_to_ascii_lz(src, &ascii_src, IDN2_NONTRANSITIONAL);
if (res != IDN2_OK) {
fatal("'%s' is not a legal IDNA2008 name (%s), use +noidnin",
src, idn2_strerror(res));
}
/*
* idn2_to_ascii_lz() normalizes all strings to lower case, but we
* generally don't want to lowercase all input strings; make sure to
* return the original case if the two strings differ only in case.
*/
final_src = (strcasecmp(src, ascii_src) == 0 ? src : ascii_src);
(void)strlcpy(dst, final_src, dstlen);
idn2_free(ascii_src);
resetlocale(LC_ALL);
}
/*%
* Convert 'src', which is an ACE string suitable for use in the DNS, into a
* string using the current locale's character encoding, storing the conversion
* result in 'dst'.
*
* The caller MUST subsequently release 'dst' using idn2_free().
*/
static void
idn_ace_to_locale(const char *src, char **dst) {
char *local_src, *utf8_src;
int res;
systemlocale(LC_ALL);
/*
* We need to:
*
* 1) check whether 'src' is a valid IDNA2008 name,
* 2) if it is, output it in the current locale's character encoding.
*
* Unlike idn2_to_ascii_*(), idn2_to_unicode_*() functions are unable
* to perform IDNA2008 validity checks. Thus, we need to decode any
* Punycode in 'src', check if the resulting name is a valid IDNA2008
* name, and only once we ensure it is, output that name in the current
* locale's character encoding.
*
* We could just use idn2_to_unicode_8zlz() + idn2_to_ascii_lz(), but
* then we would not be able to universally tell invalid names and
* character encoding errors apart (if the current locale uses ASCII
* for character encoding, the former function would fail even for a
* valid IDNA2008 name, as long as it contained any non-ASCII
* character). Thus, we need to take a longer route.
*
* First, convert 'src' to UTF-8, ignoring the current locale.
*/
res = idn2_to_unicode_8z8z(src, &utf8_src, 0);
if (res != IDN2_OK) {
fatal("Bad ACE string '%s' (%s), use +noidnout", src,
idn2_strerror(res));
res = idn2_to_ascii_lz(src, &ascii, IDN2_NONTRANSITIONAL);
if (res == IDN2_DISALLOWED) {
res = idn2_to_ascii_lz(src, &ascii, IDN2_TRANSITIONAL);
}
/*
* Then, check whether decoded 'src' is a valid IDNA2008 name.
*/
res = idn2_to_ascii_8z(utf8_src, NULL, IDN2_NONTRANSITIONAL);
if (res != IDN2_OK) {
fatal("'%s' is not a legal IDNA2008 name (%s), use +noidnout",
src, idn2_strerror(res));
}
/*
* Finally, try converting the decoded 'src' into the current locale's
* character encoding.
*/
res = idn2_to_unicode_8zlz(utf8_src, &local_src, 0);
if (res != IDN2_OK) {
static bool warned = false;
res = idn2_to_ascii_8z(utf8_src, &local_src, 0);
if (res != IDN2_OK) {
fatal("Cannot represent '%s' "
"in the current locale nor ascii (%s), "
"use +noidnout or a different locale",
src, idn2_strerror(res));
} else if (!warned) {
fprintf(stderr,
";; Warning: cannot represent '%s' "
"in the current locale",
local_src);
warned = true;
}
}
/*
* Free the interim conversion result.
*/
idn2_free(utf8_src);
*dst = local_src;
resetlocale(LC_ALL);
/*
* idn2_to_ascii_lz() normalizes all strings to lower case, but
* we generally don't want to lowercase all input strings; make
* sure to return the original case if the two strings differ
* only in case.
*/
if (res == IDN2_OK && strcasecmp(src, ascii) != 0) {
len = strlcpy(dst, ascii, dstlen);
} else {
len = strlcpy(dst, src, dstlen);
}
INSIST(len < dstlen);
idn2_free(ascii);
}
#endif /* HAVE_LIBIDN2 */
void
@@ -4908,7 +4773,7 @@ dig_idnsetup(dig_lookup_t *lookup, bool active) {
#ifdef HAVE_LIBIDN2
isc_result_t result;
result = dns_name_settotextfilter(
(active && lookup->idnout) ? idn_output_filter : NULL);
(active && lookup->idnout) ? idn_filter : NULL);
check_result(result, "dns_name_settotextfilter");
#else
UNUSED(lookup);
+8 -3
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,7 +106,7 @@ 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 */
@@ -263,7 +264,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;
@@ -313,7 +315,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);
}
+6 -6
View File
@@ -808,12 +808,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 +822,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) {
+78 -85
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;
@@ -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,16 @@ main(int argc, char *argv[]) {
directory = ".";
}
isc_managers_create(&mctx, ntasks, &loopmgr, &netmgr, &taskmgr);
isc_task_create(taskmgr, &write_task, 0);
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 +3925,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 +4019,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 +4033,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_get(mctx, ntasks * sizeof(isc_task_t *));
memset(tasks, 0, ntasks * sizeof(isc_task_t *));
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 +4079,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 +4122,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);
}
+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;
}
+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.
+16 -54
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,6 +37,7 @@
#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>
@@ -899,13 +899,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 +923,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 +1002,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,
@@ -1258,10 +1239,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);
}
@@ -1386,7 +1363,7 @@ main(int argc, char *argv[]) {
#endif /* ifdef HAVE_GPERFTOOLS_PROFILER */
#ifdef HAVE_LIBXML2
xmlInitThreads();
xmlInitParser();
#endif /* HAVE_LIBXML2 */
/*
@@ -1453,30 +1430,15 @@ main(int argc, char *argv[]) {
}
}
isc_mem_create(&named_g_mctx);
setup();
isc_mem_setname(named_g_mctx, "main");
setup();
/*
* 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) {
@@ -1510,19 +1472,19 @@ 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);
isc_mem_checkdestroyed(stderr);
named_main_setmemstats(NULL);
isc_app_finish();
named_os_closedevnull();
named_os_shutdown();
#ifdef HAVE_LIBXML2
xmlCleanupThreads();
xmlCleanupParser();
#endif /* HAVE_LIBXML2 */
#ifdef HAVE_GPERFTOOLS_PROFILER
+530 -434
View File
File diff suppressed because it is too large Load Diff
+6 -87
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);
@@ -2049,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;
@@ -2085,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");
@@ -2123,88 +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;
bool dnssec_policy = 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;
res = cfg_map_get(zoptions, "dnssec-policy", &signing);
if (res != ISC_R_SUCCESS && voptions != NULL) {
res = cfg_map_get(voptions, "dnssec-policy", &signing);
}
if (res != ISC_R_SUCCESS && options != NULL) {
res = cfg_map_get(options, "dnssec-policy", &signing);
}
if (res == ISC_R_SUCCESS) {
dnssec_policy = (strcmp(cfg_obj_asstring(signing), "none") !=
0);
}
if (!inline_signing && !zone_is_dynamic && dnssec_policy) {
inline_signing = true;
dns_zone_log(zone, ISC_LOG_DEBUG(1),
"inline-signing: "
"implicitly through dnssec-policy");
}
return (inline_signing);
}
+31 -42
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>
@@ -126,8 +127,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;
@@ -176,6 +177,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 +190,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 +687,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 +756,9 @@ maybeshutdown(void) {
}
static void
shutdown_program(void) {
shutdown_program(void *arg) {
UNUSED(arg);
ddebug("shutdown_program()");
shuttingdown = true;
@@ -905,13 +911,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);
@@ -959,9 +962,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));
@@ -2238,7 +2241,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 +2249,6 @@ get_next_command(void) {
} else {
cmdline = fgets(cmdlinebuf, MAXCMD, input);
}
isc_app_unblock();
if (cmdline != NULL) {
char *tmp = cmdline;
@@ -2285,9 +2286,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
@@ -3276,9 +3277,6 @@ cleanup(void) {
}
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 +3292,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 +3319,6 @@ cleanup(void) {
if (memdebugging) {
isc_mem_stats(gmctx, stderr);
}
isc_mem_destroy(&gmctx);
isc_mutex_destroy(&answer_lock);
@@ -3333,44 +3327,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 +3377,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 {
+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);
@@ -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
+5 -5
View File
@@ -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.
+17 -10
View File
@@ -139,7 +139,7 @@ $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
$KEYGEN -q -a RSASHA256 -b 2048 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${zone}.
#
@@ -148,17 +148,24 @@ $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
$KEYGEN -q -a RSASHA512 -b 2048 $zone > kg.out 2>&1 || dumpit kg.out
$DSFROMKEY $ksk.key > dsset-${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-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}.
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 $DEFAULT_ALGORITHM -b $DEFAULT_BITS -fk $zone > kg.out 2>&1 || dumpit kg.out
$KEYGEN -q -a $DEFAULT_ALGORITHM -b $DEFAULT_BITS $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
#
+20 -8
View File
@@ -312,14 +312,18 @@ update add optout.example. 3600 NSEC3PARAM 1 1 10 BEEF
send
END
# try to convert nsec-only.example; this should fail due to non-NSEC key
echo_i "preset nsec3param in unsigned zone via nsupdate ($n)"
$NSUPDATE > nsupdate.out 2>&1 <<END
if $SHELL ../testcrypto.sh -q RSASHA1
then
# try to convert nsec-only.example; this should fail due to
# non-NSEC3 compatible keys
echo_i "preset nsec3param in unsigned zone via nsupdate ($n)"
$NSUPDATE > nsupdate.out 2>&1 <<END
server 10.53.0.3 ${PORT}
zone nsec-only.example.
update add nsec-only.example. 3600 NSEC3PARAM 1 0 10 BEEF
send
END
fi
echo_i "checking for nsec3param in unsigned zone ($n)"
ret=0
@@ -490,7 +494,12 @@ status=$((status + ret))
echo_i "checking NSEC->NSEC3 conversion failed with NSEC-only key ($n)"
ret=0
grep "failed: REFUSED" nsupdate.out > /dev/null || ret=1
if $SHELL ../testcrypto.sh -q RSASHA1
then
grep "failed: REFUSED" nsupdate.out > /dev/null || ret=1
else
echo_i "skip: RSASHA1 not supported"
fi
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
@@ -1144,7 +1153,7 @@ oldserial=$($DIG $DIGOPTS +short soa . @10.53.0.1 | awk '{print $3}')
sleep 4
echo_i "revoking key to duplicated key ID"
$SETTIME -R now -K ns2 Kbar.+005+30676.key > settime.out.test$n.3 || ret=1
$SETTIME -R now -K ns2 Kbar.+013+59973.key > settime.out.test$n.3 || ret=1
($RNDCCMD 10.53.0.2 loadkeys bar. 2>&1 | sed 's/^/ns2 /' | cat_i) || ret=1
@@ -1178,7 +1187,10 @@ checkprivate nsec3.example 10.53.0.3 || ret=1
checkprivate nsec3.nsec3.example 10.53.0.3 || ret=1
checkprivate nsec3.optout.example 10.53.0.3 || ret=1
checkprivate nsec3-to-nsec.example 10.53.0.3 2 || ret=1 # automatically removed
checkprivate nsec-only.example 10.53.0.3 || ret=1
if $SHELL ../testcrypto.sh -q RSASHA1
then
checkprivate nsec-only.example 10.53.0.3 || ret=1
fi
checkprivate oldsigs.example 10.53.0.3 2 || ret=1 # pre-signed
checkprivate optout.example 10.53.0.3 || ret=1
checkprivate optout.nsec3.example 10.53.0.3 || ret=1
@@ -1311,8 +1323,8 @@ status=$((status + ret))
echo_i "checking revoked key with duplicate key ID ($n)"
ret=0
id=30676
rid=30804
id=59973
rid=60101
$DIG $DIGOPTS +multi dnskey bar @10.53.0.2 > dig.out.ns2.test$n || ret=1
grep '; key id = '"$id"'$' dig.out.ns2.test$n > /dev/null && ret=1
keys=$(grep '; key id = '"$rid"'$' dig.out.ns2.test$n | wc -l)
+1
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; };
};
+10
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;
};
+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;
};
@@ -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,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 unsupported;
};
};
@@ -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;
};
};
+13
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,6 +183,7 @@ view "fourth" {
zone "dnssec-test" {
type primary;
file "dnssec-test.db";
inline-signing yes;
parental-agents {
1.2.3.4;
1.2.3.5;
@@ -189,6 +194,7 @@ view "fourth" {
zone "dnssec-default" {
type primary;
file "dnssec-default.db";
inline-signing yes;
parental-agents {
"parents";
};
@@ -197,6 +203,7 @@ view "fourth" {
zone "dnssec-inherit" {
type primary;
file "dnssec-inherit.db";
inline-signing yes;
};
zone "dnssec-none" {
type primary;
@@ -206,11 +213,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 +239,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 +267,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";
};
+1 -1
View File
@@ -492,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 "'dnssec-policy;' requires dynamic DNS or inline-signing to be configured for the zone" < 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@;
@@ -1 +0,0 @@
example.com. IN DNSKEY 256 3 5 AwEAAaF0z17DdkBAKiYScVNqzsqXw7Vz/Cx5OCw7T/6RnU/KiGv815kl H2obywRZX2ZcEg9R8SUzQiP9ygY0s1xF5IFYi32HsWftNV7V/gNwNrMn GC0gV2e3OawsQ2CYWZZVwObr/fmcKIXuY6eRdJtyOilMRhlvroJdXZw1 CQdicxpZ
@@ -1,10 +0,0 @@
Private-key-format: v1.2
Algorithm: 5 (RSASHA1)
Modulus: oXTPXsN2QEAqJhJxU2rOypfDtXP8LHk4LDtP/pGdT8qIa/zXmSUfahvLBFlfZlwSD1HxJTNCI/3KBjSzXEXkgViLfYexZ+01XtX+A3A2sycYLSBXZ7c5rCxDYJhZllXA5uv9+Zwohe5jp5F0m3I6KUxGGW+ugl1dnDUJB2JzGlk=
PublicExponent: AQAB
PrivateExponent: QrbJmRabHiFlSSYFvbo8iGn9bFTotlfAZkZ732y72+SMSlLHo3g7atThJoLncJxKuhnZ0s1DXyvW9omAM3iN2lxfVDW58at1amj/lWRDYkjI0fM8z6eyrF4U2lHKDM2YEstg+sGAAs5DUZBbli4Y7+zHjhxSKLYvRf4AJvX8aoE=
Prime1: 0259CgdF0JW+miedRZXC6tn3FijZJ4/j5edzd8IpTpdUSZupQg9hMP1ot7crreNq7MnzO0Z2ImbowUx8CDOuXQ==
Prime2: w31/WLM2275Z1tsHEOhrntUQCUk55B4PNOCmM4hjp0vAvA/SVSgAYRNb7rc/ujaLf0DnxnDsnVsFAS2PmvQELQ==
Exponent1: yKPhJNMh/X8dEUzmglJMVnHheLXq3RA/RL0PZmZqrJoO8os1Y+sUYFkaNr0sRie6IFrE50tGb/8YgdcDHQVuQQ==
Exponent2: lVhDuGy5RSjnk1eiz0zwIthctutlOZupPFk/P3E7yGv74vAnXH0BxSe3/Oer3MOc0GuyZYyRhyko6px28AbpRQ==
Coefficient: Hjup1nDnPFkQrxU2qLQBJrDz+ipw0RkNhsjWs6IgAq1Mq4sFV50bR9hOTLDd9oNhhtAwVjF+Oc0WIq+M1Mi6Ow==
@@ -1 +0,0 @@
example.com. IN DNSKEY 257 3 5 AwEAAbuWh5W3eGwixISqPwxszotQ0246KqhUB2Mb6JqNMJd6cWR66IrX YnevpIHsb6oanqJmVzOcJ6Yj3rXOIYtYYXgLbT7EJ8x7BNCZPHxG+w5C 7I1WsDbT6eGf//FLn2c4odKLOXaWCVITeNy61w43IlteIT9Q1egKdt+8 a7X9605j
@@ -1,10 +0,0 @@
Private-key-format: v1.2
Algorithm: 5 (RSASHA1)
Modulus: u5aHlbd4bCLEhKo/DGzOi1DTbjoqqFQHYxvomo0wl3pxZHroitdid6+kgexvqhqeomZXM5wnpiPetc4hi1hheAttPsQnzHsE0Jk8fEb7DkLsjVawNtPp4Z//8UufZzih0os5dpYJUhN43LrXDjciW14hP1DV6Ap237xrtf3rTmM=
PublicExponent: AQAB
PrivateExponent: XZSssv3CL3/wtZYQuewV5d4+e8C8wxiYTtL/aQqCcS7+HnhKRelJEBgpYz9GPX/mH3Iakn6WMQW39s6MYW2HwXUnqhsvHoyabGX0Dbc/1LcY4J2VPgzVHwSXYm+j4unOByOOS4KoBtUAQxJsTBokVZrZ5pKsLUK9X2gdywYw+PE=
Prime1: 9fB7PaygjKoT1nbbeEMy1KYNqetg3zmN49Mk6ilEWxzJXKSSjTIhdkiLGXtYmE8rDBLBiYm8YWNe7YdA9PbQ7Q==
Prime2: w0L7mTOLDecH3XAkC/wvALv8K9KSoZ31ajidKBxV15u8awj5AxDG7gjerYgCLjU1fq1GulMr11j8r4ftQn3Cjw==
Exponent1: Up52yEE1rgt0npdPIxdv+//Ml0h7QoITKHXF8OPsEq+Y9YZTtRsiIpo8IFNPb9somuWyHoImxpCbUzAcoi5IAQ==
Exponent2: uYTbvYx+UsAt9dOFPCnnkqAJEK3qCUomET0m/CQn30mldGC7DpGTIDgnMeLmh3agk/IYIBHDtsBinHfeEe2guw==
Coefficient: FiHAet8On9Yaz1ksEAlCWulwck3zPWIsgqJBM2J4kHhgHTm17mZyxtVxIzLAMBNMIBcFl40FCpmPmTLY5QK5mw==
@@ -0,0 +1,5 @@
; This is a zone-signing key, keyid 18240, for example.com.
; Created: 20211221062121 (Tue Dec 21 17:21:21 2021)
; Publish: 20211221062121 (Tue Dec 21 17:21:21 2021)
; Activate: 20211221062121 (Tue Dec 21 17:21:21 2021)
example.com. IN DNSKEY 256 3 10 AwEAAe5GunnuJFyzmKiGUknSQY3aPtR5UR8vNLLyMCJswffRzoYwY14/ 60ZTsqzh7N+lJV3KAOraocFSsTnmWIM7D7DPpqtaJMQw90ypBG0cnUP1 wKX9L/gdOH/ITlluBiZpCv9Aux3FRECHBO4Gx8Rse8ST2Vag3UuOPW+q HkLsWQt22K/hYuDhEtUWWx2dTIaXUVXNSNbk2zPL+lhC9PaRV+//1Fjo UX4qXCUuUN4TiqlkK2v4UkcIyld1n2R7qTQAkoN9amGFtPu8z5Zw7CxC San03yUSNuKub3fGys11gQRFuEHRX7FxKxvJjmcngG9qCh8AyfHZ8zYb VstTy1unFoM=
@@ -0,0 +1,13 @@
Private-key-format: v1.3
Algorithm: 10 (RSASHA512)
Modulus: 7ka6ee4kXLOYqIZSSdJBjdo+1HlRHy80svIwImzB99HOhjBjXj/rRlOyrOHs36UlXcoA6tqhwVKxOeZYgzsPsM+mq1okxDD3TKkEbRydQ/XApf0v+B04f8hOWW4GJmkK/0C7HcVEQIcE7gbHxGx7xJPZVqDdS449b6oeQuxZC3bYr+Fi4OES1RZbHZ1MhpdRVc1I1uTbM8v6WEL09pFX7//UWOhRfipcJS5Q3hOKqWQra/hSRwjKV3WfZHupNACSg31qYYW0+7zPlnDsLEJJqfTfJRI24q5vd8bKzXWBBEW4QdFfsXErG8mOZyeAb2oKHwDJ8dnzNhtWy1PLW6cWgw==
PublicExponent: AQAB
PrivateExponent: U/ipDv9V4TWJvxpXNZzbbVpUehym8g54y/d97yPU17kgxzmWS0jLaWVluneEOuzAVmUyHZIfHzo9KuJ6nwTZar5DRm/mNR3siR+nZ6yF38VjtxubJB1oI+A7fFjB4hdywLHXP46dlv/+RMQu8pIorAZOubDHTDE8hXW2ZG9WkisJ5P7KoaL4KFHHHXi5vsXAMph4Zphd/zPxVL2tHD3l5c3QXRpQWfTNZNQcZ1f/4yVCuMRibg5LCvpia0ZwRrlygfZdAHUUd0VJDfRO45J5nlIJSAHQtjYtVTL+xNISWOHXovVlInkVyluACqfX94I7qPXTu41yg3SxrrtHE6RTwQ==
Prime1: +/YsRxmUxgvHKUh4SxdjzqNDDEi8b2BtM5IpctjVG3oYsL6J9xJB3U5/lbrGEPgl/1ndBUSXMQ6zQ5WcDE1qBAdW8t0eyniyuiexcgQ9f04Ds7p7oUiSHGLRn8YqQOzmiASXoZmkzfJZ+42pGhT3RZ+aYKtWQGMHqXabwV3zZl0=
Prime2: 8hhnKzPzExy6wv/MV0aYKo1g4azrRjug6743/ctTC7zjnMmDW7RMFTXmq5Tu3pFaIL4N4C4m1b7P3abfTrjm+DwHnrlRIvLWS3zJnvUEM22i4BwqqTLRiJpoT5Bfp4pVsdOPT7Iyx1q5UsJZ7Q4qMpg2TFpGiQyieRB5Xwpu4l8=
Exponent1: ZFPx7Z3SD8pA0793pu75Xx7DY/DSl8bdtNtOhdyxfu9vRXGZnjg24diQFR76H2ewOa2exKo7Sd2ApDi+mmd4/4Gsrag+yoClKlsD3VKy6i42ayqmb+Jly8fNkMFnsdKjOSYa+s4jQZ5vFiuiWjBfBeo3nqabAahtNJ12B9lRQkE=
Exponent2: tNz4TnVsFo4zFLVHsrghvECM7WxjBMBNc3FToT6CV1WRcjO1+A/Ve08eenc0kYBjpex2r1GrX6pC3uPpFoXav/8Q7kqiTArBf/nFIwUHU2iH8wf38xntIjHA1hgU7jTR2p0kBrUpbHfh1esuhYQ8kDnY7ufOpFqVEv70vcUsm98=
Coefficient: 3acDCJ9jCnHAP1km7jRO388mOpiI8U6SMv0PBD8l2UoB4CYwujrFxy6PhgUa486bbm5xZEaOwhYZcbw/g1qyC6Qt5kYOb2fVWOob/lEQmyqbDvHMQWTJoIbqaDTKQN/szI4xVdb/xZ6QR4Bq7JgbJpUACgweS540Y7Lf8Dry8C0=
Created: 20211221062121
Publish: 20211221062121
Activate: 20211221062121
@@ -0,0 +1,5 @@
; This is a key-signing key, keyid 28633, for example.com.
; Created: 20211221062130 (Tue Dec 21 17:21:30 2021)
; Publish: 20211221062130 (Tue Dec 21 17:21:30 2021)
; Activate: 20211221062130 (Tue Dec 21 17:21:30 2021)
example.com. IN DNSKEY 257 3 10 AwEAAc4lt8fDsdCzMCLHxXm8Ok/dw6XDiqx06Rf47LTeLmo6b64xm1Fs 0zloNMrcZDgwS5IxjQ3Breqc5aEc+jehueqCXa/fJXMdIt1VpUG0H7GP 4B+1IVmEiziHfmOozktdkuAyLqcsNhsf+J1+bCoHJSffgz6KbjBks/jR 12uyUnZCDrKGE/KfiR0gpT3watqGqqChO0KXq2N2PsnYfyRDea5FMUjM oPgOOyAT8LIMsM8x4f+EbU6m9Zc3Esafek9iLCS9R1333Pm1EEh5ghQT BsZ7omc5aSvrKUaIneojU3RdofceZouCliIDXmqscfY0y6bivGcmCQI/ LM4XUh7GWlM=
@@ -0,0 +1,13 @@
Private-key-format: v1.3
Algorithm: 10 (RSASHA512)
Modulus: ziW3x8Ox0LMwIsfFebw6T93DpcOKrHTpF/jstN4uajpvrjGbUWzTOWg0ytxkODBLkjGNDcGt6pzloRz6N6G56oJdr98lcx0i3VWlQbQfsY/gH7UhWYSLOId+Y6jOS12S4DIupyw2Gx/4nX5sKgclJ9+DPopuMGSz+NHXa7JSdkIOsoYT8p+JHSClPfBq2oaqoKE7QperY3Y+ydh/JEN5rkUxSMyg+A47IBPwsgywzzHh/4RtTqb1lzcSxp96T2IsJL1HXffc+bUQSHmCFBMGxnuiZzlpK+spRoid6iNTdF2h9x5mi4KWIgNeaqxx9jTLpuK8ZyYJAj8szhdSHsZaUw==
PublicExponent: AQAB
PrivateExponent: Wr3fl99cdjFqDuVA18UzJdTIOj9I24Da2eKIz1S9uaTfZB4R8FWm5K4qDuHUe6dGnKOTI2sN0ygdLD5FJhfabo/UDYZ8RZ+dqS/5/mH7UX2zekGQ3Iargcaiq9uycxpNfMKaJpwfdPEtzqXHlvhuMo8AhpcIyeSKFAzKdm2YPtUqIrum4RARHyfRLfLyWlkIotPdyiaKCVGQxiRbFsTcmIB2Bizmt7zRjlB+Hxf8MooXmaKUFRQtMCLnFGK0ecFI1CWAxmLSanvYVKQ0HxcFkFKzRiZAz1au7ZfMgYDZj0jF72WAGU3Edcmdc0QIQRTWjb/3wcBfwlr9s6lKoF3ngQ==
Prime1: 1EIziKhz7dF41rb/hckdr2qeY8eM7tLrT5jIMPLISHCCuKm5IK2u7PY6m6NjMdhx1ilm7K2RGTt+TTFZaqDIEd8qpzRCxAGcfTVOmB9iHwmi9i9RoPSlY6o+iShft68ZnvPiGJWUF2huRYVK2F0cIWErwSqaBGsFd79mXmlkn98=
Prime2: +KEdNtZj9JyCCR2xbLAw3tnAYxHvJ3skVMjxV3cyUupMWi12NWxGhHH1nnetXxDR2LBBuqIl4pE/4MeXe3sClMHTL3Z9XG+pzQAsHS7yvsfZERdyuWZYYy0ya/7XY2auvRVO6LxN7d47VWjYxAGfoCsbCEivgDxmt1dTZhAtRA0=
Exponent1: d5TcZ69PsLoEtCLhDkRh/wO4PEqeMaaOf4d5sWn2QCly3Apyi+CN3l5SYoDIT7q7V4Z3v/uA9ZA49dBJqfLvBHKQGycsPjUSLtAreTSlGQtazguWl3F9BAtTs/4U/u0dKBoKVQNgLVfeWDhiFEdQo9WUyvzvTHHm4LHqQGJsGE0=
Exponent2: EU2dK+DVygNOZXYEkAzfCdNbuUlZPIUsbR4i9bRc8zpNIAWD8YncioEn1+R6U2BnSk5R9LwuKMt1B568YyKXdmTa3rW/WbyHs7WsXEeVK0PbTn40RMTjp9tQZAWzVb6isJQYDsh0H/bUaEhItbNrOYlmczgjxqftehsAudysWc0=
Coefficient: sl2u/8vttxpiTbspGV4SsaDmKUNdzQH7BgJ5rl3mXPp/aUpLw0Sr7FuARy8W8tq3yVNi9qCOnvGwVl6aQzZP7b8N04KiH8gewlAVdSfxG24yFKJIQNbWGKFZYZFYyjtLVlpK6NYF0f0I1KpAjn58XR0qIBvRFZYWBAkggU9C7ro=
Created: 20211221062130
Publish: 20211221062130
Activate: 20211221062130
@@ -1,6 +1,6 @@
;
; This is a bogus key. It will not have a .private file.
;
; This will be key id 7091
; This will be key id 23221
;
example.com. IN DNSKEY 257 3 5 AwEAAaF0z17DdkBAKiYScVNqzsqXw7Vz/Cx5OCw7T/6RnU/KiGv815kl H2obywRZX2ZcEg9R8SUzQiP9ygY0s1xF5IFYi32HsWftNV7V/gNwNrMn GC0gV2e3OawsQ2CYWZZVwObr/fmcKIXuY6eRdJtyOilMRhlvroJdXZw1 CQdicxpz
example.com. IN DNSKEY 257 3 10 AwEAAbcyptpM++pVjhpYQW2fVtyOw04IBSw4X0SYi/Ke4wVkmDNW2vBm AFkgiVVKmmNbb0IHDYQiIY7seXk0fjEwjzeY2bmeOAZxDdv2KT9VQpoY Matk2y4NTi6F/V04x0lL/CBvyifTeNbZKvY+S1eKFuWHeS5Ss8tiagz9 zdYWUe/msvmin+Hbs2tlLwXVl4hOmABCL9uK9H8R6GPL5VdEXYyFOh/v 71CNhRU5ufrARti69YYkfzH6NpWhlJWyJvDjqAdt2L3H8V71C2vcXbBu S5NscEYl+8JQfwUvOTN553I5IQrG+NQEusW36UM/Rkad8mMnUVM9Vzqk GH86GHKtLMc=
@@ -1,6 +1,6 @@
;
; This is a bogus key. It will not have a .private file.
;
; This will be key id 7092
; This will be key id 48930
;
example.com. IN DNSKEY 256 3 5 AwEAAaF0z17DdkBAKiYScVNqzsqXw7Vz/Cx5OCw7T/6RnU/KiGv815kl H2obywRZX2ZcEg9R8SUzQiP9ygY0s1xF5IFYi32HsWftNV7V/gNwNrMn GC0gV2e3OawsQ2CYWZZVwObr/fmcKIXuY6eRdJtyOilMRhlvroJdXZw1 CQdicxpz
example.com. IN DNSKEY 256 3 10 AwEAAa/0IcnbGutPVkrz04tw5ZIYx6rU+FprB2rlKS8cTK/wiBOqbOC6 QIDdegDpZG1fOdj04ZQGa3pIizqC2CnlIWfxpfR6W+qSLRBuQ8gmwTmS c/Jy/0vAGB3fv3oVIqKslLNqIXZb3CKNiA2kGcut3aUgfeOW970Jga6z PAGKqPpPZTelW1Qy9N5BO4cRTuYo4uvbZveJv1W/2n5RN+UaeqU0f+AE DP0+wqSWNUfZsi6HygLwk08x3eO8PzTBlqBlAMfvNAygrmXqccMREyyH KEc5dVJ1qOXfj8BAdJUPmunyJhIwC9PxzOW7mn1lW7mZO2D5U/Jaxw2k eX2KblmVk8s=
@@ -15,5 +15,5 @@
;
$TTL 3600
example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
$include Kexample.com.+005+07065.key
$include Kexample.com.+005+23362.key
$include Kexample.com.+010+18240.key
$include Kexample.com.+010+28633.key
@@ -15,4 +15,4 @@
;
$TTL 3600
example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
$include Kexample.com.+005+07065.key
$include Kexample.com.+010+18240.key
@@ -15,4 +15,4 @@
;
$TTL 3600
example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
$include Kexample.com.+005+23362.key
$include Kexample.com.+010+28633.key
@@ -15,6 +15,6 @@
;
$TTL 3600
example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
$include Kexample.com.+005+07065.key
$include Kexample.com.+005+23362.key
$include Kexample.com.+010+18240.key
$include Kexample.com.+010+28633.key
$include bogus-zsk.key
@@ -14,6 +14,6 @@
;
$TTL 3600
example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
$include Kexample.com.+005+07065.key
$include Kexample.com.+005+23362.key
$include Kexample.com.+010+18240.key
$include Kexample.com.+010+28633.key
$include bogus-ksk.key
@@ -15,7 +15,7 @@
;
$TTL 3600
example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
$include Kexample.com.+005+07065.key
$include Kexample.com.+005+23362.key
$include Kexample.com.+010+18240.key
$include Kexample.com.+010+28633.key
$include bogus-ksk.key
$include bogus-zsk.key
@@ -15,5 +15,5 @@
;
$TTL 3600
example.com. IN SOA ns hostmaster 00090000 1200 3600 604800 300
$include Kexample.com.+005+23362.key
$include Kexample.com.+010+28633.key
$include bogus-zsk.key
+6 -2
View File
@@ -1804,8 +1804,12 @@ $SIGNER -O raw -f signer.out.5 -Sxt -o example example.db > /dev/null
$SIGNER -O raw=0 -f signer.out.6 -Sxt -o example example.db > /dev/null
$SIGNER -O raw -f - -Sxt -o example example.db > signer.out.7 2> /dev/null
) || ret=1
awk '/IN *SOA/ {if (NF != 11) exit(1)}' signer/signer.out.3 || ret=1
awk '/IN *SOA/ {if (NF != 7) exit(1)}' signer/signer.out.4 || ret=1
awk 'BEGIN { found = 0; }
$1 == "example." && $3 == "IN" && $4 == "SOA" { found = 1; if (NF != 11) exit(1); }
END { if (!found) exit(1); }' signer/signer.out.3 || ret=1
awk 'BEGIN { found = 0; }
$1 == "example." && $3 == "IN" && $4 == "SOA" { found = 1; if (NF != 7) exit(1); }
END { if (!found) exit(1); }' signer/signer.out.4 || ret=1
israw1 signer/signer.out.5 || ret=1
israw0 signer/signer.out.6 || ret=1
israw1 signer/signer.out.7 || ret=1
+16 -8
View File
@@ -344,16 +344,18 @@ status=$((status + ret))
n=$((n + 1))
echo_i "checking DoH query (POST) ($n)"
ret=0
dig_with_https_opts @10.53.0.1 . SOA > dig.out.test$n
dig_with_https_opts +stat @10.53.0.1 . SOA > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep -F "(HTTPS)" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "checking DoH query via IPv6 (POST) ($n)"
ret=0
dig_with_https_opts -6 @fd92:7065:b8e:ffff::1 . SOA > dig.out.test$n
dig_with_https_opts +stat -6 @fd92:7065:b8e:ffff::1 . SOA > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep -F "(HTTPS)" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
@@ -416,16 +418,18 @@ status=$((status + ret))
n=$((n + 1))
echo_i "checking DoH query (GET) ($n)"
ret=0
dig_with_https_opts +https-get @10.53.0.1 . SOA > dig.out.test$n
dig_with_https_opts +stat +https-get @10.53.0.1 . SOA > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep -F "(HTTPS-GET)" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "checking DoH query via IPv6 (GET) ($n)"
ret=0
dig_with_https_opts -6 +https-get @fd92:7065:b8e:ffff::1 . SOA > dig.out.test$n
dig_with_https_opts -6 +stat +https-get @fd92:7065:b8e:ffff::1 . SOA > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep -F "(HTTPS-GET)" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
@@ -488,32 +492,36 @@ status=$((status + ret))
n=$((n + 1))
echo_i "checking unencrypted DoH query (POST) ($n)"
ret=0
dig_with_http_opts @10.53.0.1 . SOA > dig.out.test$n
dig_with_http_opts +stat @10.53.0.1 . SOA > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep -F "(HTTP)" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "checking unencrypted DoH query via IPv6 (POST) ($n)"
ret=0
dig_with_http_opts -6 @fd92:7065:b8e:ffff::1 . SOA > dig.out.test$n
dig_with_http_opts -6 +stat @fd92:7065:b8e:ffff::1 . SOA > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep -F "(HTTP)" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "checking unencrypted DoH query (GET) ($n)"
ret=0
dig_with_http_opts +http-plain-get @10.53.0.1 . SOA > dig.out.test$n
dig_with_http_opts +stat +http-plain-get @10.53.0.1 . SOA > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep -F "(HTTP-GET)" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
echo_i "checking unencrypted DoH query via IPv6 (GET) ($n)"
ret=0
dig_with_http_opts -6 +http-plain-get @fd92:7065:b8e:ffff::1 . SOA > dig.out.test$n
dig_with_http_opts -6 +stat +http-plain-get @fd92:7065:b8e:ffff::1 . SOA > dig.out.test$n
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep -F "(HTTP-GET)" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
@@ -10,13 +10,11 @@ sample_la_SOURCES = \
db.c \
driver.c \
instance.c \
lock.c \
log.c \
syncptr.c \
zone.c \
db.h \
instance.h \
lock.h \
log.h \
syncptr.h \
util.h \
+3 -3
View File
@@ -614,7 +614,7 @@ add_soa(dns_db_t *db, dns_dbversion_t *version, const dns_name_t *name,
rdatalist.rdclass = rdata.rdclass;
rdatalist.ttl = 86400;
ISC_LIST_APPEND(rdatalist.rdata, &rdata, link);
CHECK(dns_rdatalist_tordataset(&rdatalist, &rdataset));
dns_rdatalist_tordataset(&rdatalist, &rdataset);
CHECK(dns_db_findnode(db, name, true, &node));
CHECK(dns_db_addrdataset(db, node, version, 0, &rdataset, 0, NULL));
cleanup:
@@ -652,7 +652,7 @@ add_ns(dns_db_t *db, dns_dbversion_t *version, const dns_name_t *name,
rdatalist.rdclass = rdata.rdclass;
rdatalist.ttl = 86400;
ISC_LIST_APPEND(rdatalist.rdata, &rdata, link);
CHECK(dns_rdatalist_tordataset(&rdatalist, &rdataset));
dns_rdatalist_tordataset(&rdatalist, &rdataset);
CHECK(dns_db_findnode(db, name, true, &node));
CHECK(dns_db_addrdataset(db, node, version, 0, &rdataset, 0, NULL));
cleanup:
@@ -688,7 +688,7 @@ add_a(dns_db_t *db, dns_dbversion_t *version, const dns_name_t *name,
rdatalist.rdclass = rdata.rdclass;
rdatalist.ttl = 86400;
ISC_LIST_APPEND(rdatalist.rdata, &rdata, link);
CHECK(dns_rdatalist_tordataset(&rdatalist, &rdataset));
dns_rdatalist_tordataset(&rdatalist, &rdataset);
CHECK(dns_db_findnode(db, name, true, &node));
CHECK(dns_db_addrdataset(db, node, version, 0, &rdataset, 0, NULL));
cleanup:
-81
View File
@@ -1,81 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0 AND ISC
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*
* Copyright (C) Red Hat
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND AUTHORS DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "lock.h"
#include <isc/task.h>
#include <isc/util.h>
/*
* Lock BIND dispatcher and allow only single task to run.
*
* @warning
* All calls to isc_task_beginexclusive() have to operate on the same task
* otherwise it would not be possible to distinguish recursive locking
* from real conflict on the dispatcher lock.
* For this reason this wrapper function always works with inst->task.
* As a result, this function have to be be called only from inst->task.
*
* Recursive locking is allowed. Auxiliary variable pointed to by "statep"
* stores information if last run_exclusive_enter() operation really locked
* something or if the lock was called recursively and was no-op.
*
* The pair (inst, state) used for run_exclusive_enter() has to be
* used for run_exclusive_exit().
*
* @param[in] inst The instance with the only task which is allowed to
* run.
* @param[in,out] statep Lock state: ISC_R_SUCCESS or ISC_R_LOCKBUSY
*/
void
run_exclusive_enter(sample_instance_t *inst, isc_result_t *statep) {
REQUIRE(statep != NULL);
REQUIRE(*statep == ISC_R_IGNORE);
*statep = isc_task_beginexclusive(inst->task);
RUNTIME_CHECK(*statep == ISC_R_SUCCESS || *statep == ISC_R_LOCKBUSY);
}
/*
* Exit task-exclusive mode.
*
* @param[in] inst The instance used for previous run_exclusive_enter() call.
* @param[in] state Lock state as returned by run_exclusive_enter().
*/
void
run_exclusive_exit(sample_instance_t *inst, isc_result_t state) {
if (state == ISC_R_SUCCESS) {
isc_task_endexclusive(inst->task);
} else {
/* Unlocking recursive lock or the lock was never locked. */
INSIST(state == ISC_R_LOCKBUSY || state == ISC_R_IGNORE);
}
return;
}
-39
View File
@@ -1,39 +0,0 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0 AND ISC
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
/*
* Copyright (C) Red Hat
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND AUTHORS DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#pragma once
#include "instance.h"
#include "util.h"
void
run_exclusive_enter(sample_instance_t *inst, isc_result_t *statep);
void
run_exclusive_exit(sample_instance_t *inst, isc_result_t state);
+3 -4
View File
@@ -35,6 +35,7 @@
#include <inttypes.h>
#include <stdbool.h>
#include <isc/task.h>
#include <isc/util.h>
#include <dns/dyndb.h>
@@ -42,7 +43,6 @@
#include <dns/zone.h>
#include "instance.h"
#include "lock.h"
#include "log.h"
#include "util.h"
@@ -134,7 +134,6 @@ publish_zone(sample_instance_t *inst, dns_zone_t *zone) {
bool freeze = false;
dns_zone_t *zone_in_view = NULL;
dns_view_t *view_in_zone = NULL;
isc_result_t lock_state = ISC_R_IGNORE;
REQUIRE(inst != NULL);
REQUIRE(zone != NULL);
@@ -172,7 +171,7 @@ publish_zone(sample_instance_t *inst, dns_zone_t *zone) {
CLEANUP_WITH(ISC_R_UNEXPECTED);
}
run_exclusive_enter(inst, &lock_state);
isc_task_beginexclusive(inst->task);
if (inst->view->frozen) {
freeze = true;
dns_view_thaw(inst->view);
@@ -194,7 +193,7 @@ cleanup:
if (freeze) {
dns_view_freeze(inst->view);
}
run_exclusive_exit(inst, lock_state);
isc_task_endexclusive(inst->task);
return (result);
}
+50 -56
View File
@@ -22,17 +22,6 @@ export LC_ALL
# This set of tests check the behavior of the IDNA options in "dig".
#
# "dig" supports two IDNA-related options:
#
# +[no]idnin - Translates a domain name into punycode format before sending
# the query to the server.
#
# Should the input name be a punycode name, "dig +idnin" will also
# validate the punycode, rejecting it if it is invalid.
#
# +[no]idnout - Translates the received punycode domain names into appropriate
# unicode characters before displaying.
#
# The tests run "dig" against an authoritative server configured with a minimal
# root zone and nothing else. As a result, all queries will result in an
# NXDOMAIN. The server will return the qname sent, which "dig" will display
@@ -156,11 +145,12 @@ idna_fail() {
ascii_case_preservation_test() {
text="Checking valid ASCII label"
idna_test "$text" "" LocalhosT LocalhosT.
idna_test "$text" "+noidn" LocalhosT LocalhosT.
idna_test "$text" "+noidnin +noidnout" LocalhosT LocalhosT.
idna_test "$text" "+noidnin +idnout" LocalhosT LocalhosT.
idna_test "$text" "+idnin +noidnout" LocalhosT LocalhosT.
idna_test "$text" "+idnin +idnout" LocalhosT LocalhosT.
idna_test "$text" "+idn" LocalhosT LocalhosT.
}
# Function to perform the tests if IDNA is enabled.
@@ -186,12 +176,12 @@ idna_enabled_test() {
# Note that ASCII characters are converted to lower-case.
text="Checking valid non-ASCII label"
idna_test "$text" "" "München" "M\195\188nchen."
idna_test "$text" "+noidn" "München" "M\195\188nchen."
idna_test "$text" "+noidnin +noidnout" "München" "M\195\188nchen."
idna_test "$text" "+noidnin +idnout" "München" "M\195\188nchen."
idna_test "$text" "+idnin +noidnout" "München" "xn--mnchen-3ya."
idna_test "$text" "+idnin +idnout" "München" "münchen."
idna_test "$text" "+idn" "München" "münchen."
# Tests of transitional processing of a valid U-label
#
@@ -206,28 +196,28 @@ idna_enabled_test() {
# under IDNA2003, go to www.fass.example but under IDNA2008 would end up at
# www.fa\195\159.example - a different web site).
#
# BIND has adopted a hard transition, so this test checks that these
# transitional mapping is not used. The tests are essentially the same as
# for the valid U-label.
# BIND has adopted a (mostly) hard transition, so this test checks that
# the transitional mapping is not used for characters that are valid in
# IDNA2008. The tests are essentially the same as for the valid U-label.
text="Checking that non-transitional IDNA processing is used"
idna_test "$text" "" "faß.de" "fa\195\159.de."
idna_test "$text" "+noidn" "faß.de" "fa\195\159.de."
idna_test "$text" "+noidnin +noidnout" "faß.de" "fa\195\159.de."
idna_test "$text" "+noidnin +idnout" "faß.de" "fa\195\159.de."
idna_test "$text" "+idnin +noidnout" "faß.de" "xn--fa-hia.de."
idna_test "$text" "+idnin +idnout" "faß.de" "faß.de."
idna_test "$text" "+idn" "faß.de" "faß.de."
# Another problem character. The final character in the first label mapped
# onto the Greek sigma character ("σ") in IDNA2003.
text="Second check that non-transitional IDNA processing is used"
idna_test "$text" "" "βόλος.com" "\206\178\207\140\206\187\206\191\207\130.com."
idna_test "$text" "+noidn" "βόλος.com" "\206\178\207\140\206\187\206\191\207\130.com."
idna_test "$text" "+noidnin +noidnout" "βόλος.com" "\206\178\207\140\206\187\206\191\207\130.com."
idna_test "$text" "+noidnin +idnout" "βόλος.com" "\206\178\207\140\206\187\206\191\207\130.com."
idna_test "$text" "+idnin +noidnout" "βόλος.com" "xn--nxasmm1c.com."
idna_test "$text" "+idnin +idnout" "βόλος.com" "βόλος.com."
idna_test "$text" "+idn" "βόλος.com" "βόλος.com."
# Tests of a valid A-label (i.e. starting xn--)
#
@@ -239,11 +229,12 @@ idna_enabled_test() {
# The "+[no]idnin" flag has no effect in these cases.
text="Checking valid A-label"
idna_test "$text" "" "xn--nxasmq6b.com" "xn--nxasmq6b.com."
idna_test "$text" "+noidn" "xn--nxasmq6b.com" "xn--nxasmq6b.com."
idna_test "$text" "+noidnin +noidnout" "xn--nxasmq6b.com" "xn--nxasmq6b.com."
idna_test "$text" "+noidnin +idnout" "xn--nxasmq6b.com" "βόλοσ.com."
idna_test "$text" "+idnin +noidnout" "xn--nxasmq6b.com" "xn--nxasmq6b.com."
idna_test "$text" "+idnin +idnout" "xn--nxasmq6b.com" "βόλοσ.com."
idna_test "$text" "+idn" "xn--nxasmq6b.com" "βόλοσ.com."
# Test of valid A-label in locale that cannot display it
#
@@ -258,17 +249,16 @@ idna_enabled_test() {
text="Checking valid A-label in C locale"
label="xn--nxasmq6b.com"
if command -v idn2 >/dev/null && ! idn2 -d "$label" >/dev/null 2>/dev/null; then
idna_test "$text" "" "$label" "$label."
idna_test "$text" "+noidn" "$label" "$label."
idna_test "$text" "+noidnin +noidnout" "$label" "$label."
idna_test "$text" "+noidnin +idnout" "$label" "$label."
idna_test "$text" "+idnin +noidnout" "$label" "$label."
idna_test "$text" "+idnin +idnout" "$label" "$label."
idna_test "$text" "+noidnin +idnout" "$label" "$label."
idna_test "$text" "+idn" "$label" "$label."
fi
LC_ALL="${saved_LC_ALL}"
# Tests of invalid A-labels
#
# +noidnin: The label is sent as-is to the server and dig will display the
@@ -277,42 +267,48 @@ idna_enabled_test() {
#
# +[no]idnout: If the label makes it to the server (via +noidnin), "dig"
# should report an error if +idnout is specified.
#
# +idn=lax: The label is sent and printed as-is.
# The minimum length of a punycode A-label is 7 characters. Check that
# a shorter label is detected and rejected.
text="Checking punycode label shorter than minimum valid length"
idna_test "$text" "" "xn--xx" "xn--xx."
idna_test "$text" "+noidn" "xn--xx" "xn--xx."
idna_test "$text" "+noidnin +noidnout" "xn--xx" "xn--xx."
idna_fail "$text" "+noidnin +idnout" "xn--xx"
idna_fail "$text" "+idnin +noidnout" "xn--xx"
idna_fail "$text" "+idnin +idnout" "xn--xx"
idna_test "$text" "+noidnin +idnout" "xn--xx" "xn--xx."
idna_test "$text" "+idnin +noidnout" "xn--xx" "xn--xx."
idna_test "$text" "+idnin +idnout" "xn--xx" "xn--xx."
idna_test "$text" "+idn" "xn--xx" "xn--xx."
# Fake A-label - the string does not translate to anything.
# This name is a syntax error: IDNA expects be punycode-encoded
# non-ascii characters after the last hyphen, but they are missing
# in this test.
text="Checking fake A-label"
idna_test "$text" "" "xn--ahahah" "xn--ahahah."
idna_test "$text" "+noidnin +noidnout" "xn--ahahah" "xn--ahahah."
idna_fail "$text" "+noidnin +idnout" "xn--ahahah"
idna_fail "$text" "+idnin +noidnout" "xn--ahahah"
idna_fail "$text" "+idnin +idnout" "xn--ahahah"
idna_test "$text" "+noidn" "xn--ah-" "xn--ah-."
idna_test "$text" "+noidnin +noidnout" "xn--ah-" "xn--ah-."
idna_test "$text" "+noidnin +idnout" "xn--ah-" "xn--ah-."
idna_test "$text" "+idnin +noidnout" "xn--ah-" "xn--ah-."
idna_test "$text" "+idnin +idnout" "xn--ah-" "xn--ah-."
idna_test "$text" "+idn" "xn--ah-" "xn--ah-."
# Too long a label. The punycode string is too long (at 64 characters).
# BIND rejects such labels: with +idnin
label="xn--xflod18hstflod18hstflod18hstflod18hstflod18hstflod18-1iejjjj"
text="Checking punycode label longer than maximum valid length"
idna_fail "$text" "" "$label"
idna_fail "$text" "+noidn" "$label"
idna_fail "$text" "+noidnin +noidnout" "$label"
idna_fail "$text" "+noidnin +idnout" "$label"
idna_fail "$text" "+idnin +noidnout" "$label"
idna_fail "$text" "+idnin +idnout" "$label"
idna_fail "$text" "+idn" "$label"
# Tests of a valid unicode string but an invalid U-label (input)
#
# Symbols are not valid IDNA2008 names. Check whether dig rejects them
# when they are supplied on the command line to ensure no IDNA2003
# fallbacks are in place.
# Symbols are not valid IDNA2008 names, but are allowed by IDNA2003.
#
# +noidnin: "dig" should send unicode octets to the server and display the
# returned qname in the same form.
@@ -321,22 +317,16 @@ idna_enabled_test() {
# The +[no]idnout options should not have any effect on the test.
text="Checking invalid input U-label"
idna_test "$text" "" "√.com" "\226\136\154.com."
idna_test "$text" "+noidn" "√.com" "\226\136\154.com."
idna_test "$text" "+noidnin +noidnout" "√.com" "\226\136\154.com."
idna_test "$text" "+noidnin +idnout" "√.com" "\226\136\154.com."
idna_fail "$text" "+idnin +noidnout" "√.com"
idna_fail "$text" "+idnin +idnout" "√.com"
idna_test "$text" "+idnin +noidnout" "√.com" "xn--19g.com."
idna_test "$text" "+idnin +idnout" "√.com" "√.com."
idna_test "$text" "+idn" "√.com" "√.com."
# Tests of a valid unicode string but an invalid U-label (output)
#
# Symbols are not valid IDNA2008 names. Check whether dig rejects them
# when they are received in DNS responses to ensure no IDNA2003 fallbacks
# are in place.
#
# Note that "+idnin +noidnout" is not tested because libidn2 2.2.0+ parses
# Punycode more strictly than older versions and thus dig fails with that
# combination of options with libidn2 2.2.0+ but succeeds with older
# versions.
# Symbols are not valid IDNA2008 names, but are allowed by IDNA2003.
#
# +noidnout: "dig" should send the ACE string to the server and display the
# returned qname.
@@ -345,28 +335,32 @@ idna_enabled_test() {
# The +[no]idnin options should not have any effect on the test.
text="Checking invalid output U-label"
idna_test "$text" "" "xn--19g" "xn--19g."
idna_test "$text" "+noidn" "xn--19g" "xn--19g."
idna_test "$text" "+noidnin +noidnout" "xn--19g" "xn--19g."
idna_fail "$text" "+noidnin +idnout" "xn--19g"
idna_fail "$text" "+idnin +idnout" "xn--19g"
idna_test "$text" "+noidnin +idnout" "xn--19g" "√."
idna_test "$text" "+idnin +noidnout" "xn--19g" "xn--19g."
idna_test "$text" "+idnin +idnout" "xn--19g" "√."
idna_test "$text" "+idn" "xn--19g" "√."
# Test that non-letter characters are preserved in the output. When
# UseSTD3ASCIIRules are enabled, it would mangle non-letter characters like
# `_` (underscore) and `*` (wildcard.
test="Checking valid non-letter characters"
idna_test "$text" "" "*.xn--nxasmq6b.com" "*.xn--nxasmq6b.com."
text="Checking valid non-letter characters"
idna_test "$text" "+noidn" "*.xn--nxasmq6b.com" "*.xn--nxasmq6b.com."
idna_test "$text" "+noidnin +noidnout" "*.xn--nxasmq6b.com" "*.xn--nxasmq6b.com."
idna_test "$text" "+noidnin +idnout" "*.xn--nxasmq6b.com" "*.βόλοσ.com."
idna_test "$text" "+idnin +noidnout" "*.xn--nxasmq6b.com" "*.xn--nxasmq6b.com."
idna_test "$text" "+idnin +idnout" "*.xn--nxasmq6b.com" "*.βόλοσ.com."
idna_test "$text" "+idn" "*.xn--nxasmq6b.com" "*.βόλοσ.com."
idna_test "$text" "" "_tcp.xn--nxasmq6b.com" "_tcp.xn--nxasmq6b.com."
idna_test "$text" "+noidn" "_tcp.xn--nxasmq6b.com" "_tcp.xn--nxasmq6b.com."
idna_test "$text" "+noidnin +noidnout" "_tcp.xn--nxasmq6b.com" "_tcp.xn--nxasmq6b.com."
idna_test "$text" "+noidnin +idnout" "_tcp.xn--nxasmq6b.com" "_tcp.βόλοσ.com."
idna_test "$text" "+idnin +noidnout" "_tcp.xn--nxasmq6b.com" "_tcp.xn--nxasmq6b.com."
idna_test "$text" "+idnin +idnout" "_tcp.xn--nxasmq6b.com" "_tcp.βόλοσ.com."
idna_test "$text" "+idn=strict" "_tcp.xn--nxasmq6b.com" "_tcp.βόλοσ.com."
idna_test "$text" "+idn=lax" "_tcp.xn--nxasmq6b.com" "_tcp.βόλοσ.com."
}
+8
View File
@@ -24,6 +24,10 @@
# We also set the MTU on the 1500 bytes to match the default MTU on physical
# interfaces, so we can properly test the cases with packets bigger than
# interface MTU.
#
# See also org.isc.bind.system (a version of this script for use on macOS)
# and testsock.pl (which checks the interfaces are configured)
#
top_srcdir=@abs_top_srcdir@
@@ -237,6 +241,10 @@ sequence() (
# 'ns' in the namserver being configured.
# 'int' interface identifier.
#
# See also `org.isc.bind.system`.
#
# This `max` setting is grepped out for use by testsock.pl
#
max=11
case $1 in
start|up|stop|down)
+6 -12
View File
@@ -796,22 +796,16 @@ mv ns2/named.conf.new ns2/named.conf
$RNDCCMD 10.53.0.2 reconfig || ret=1
# Request ns3 to retransfer the "retransfer3" zone.
$RNDCCMD 10.53.0.3 retransfer retransfer3 || ret=1
# Wait until ns3 finishes building the NSEC3 chain for "retransfer3". There is
# no need to immediately set ret=1 if building the NSEC3 chain is not finished
# within the time limit because the query we will send shortly will detect any
# problems anyway.
# Check whether "retransfer3" uses NSEC3 as requested.
for i in 0 1 2 3 4 5 6 7 8 9
do
$RNDCCMD 10.53.0.3 signing -list retransfer3 > signing.out.test$n.$i 2>&1
keys_done=$(grep "Done signing" signing.out.test$n.$i | wc -l)
nsec3_pending=$(grep "NSEC3 chain" signing.out.test$n.$i | wc -l)
test $keys_done -eq 2 -a $nsec3_pending -eq 0 && break
ret=0
$DIG $DIGOPTS @10.53.0.3 nonexist.retransfer3 A > dig.out.ns3.post.test$n.$i
grep "status: NXDOMAIN" dig.out.ns3.post.test$n.$i > /dev/null || ret=1
grep "NSEC3" dig.out.ns3.post.test$n.$i > /dev/null || ret=1
test $ret -eq 0 && break
sleep 1
done
# Check whether "retransfer3" uses NSEC3 as requested.
$DIG $DIGOPTS @10.53.0.3 nonexist.retransfer3 A > dig.out.ns3.post.test$n
grep "status: NXDOMAIN" dig.out.ns3.post.test$n > /dev/null || ret=1
grep "NSEC3" dig.out.ns3.post.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
+1
View File
@@ -18,6 +18,7 @@ rm -f ./K*.private ./K*.key ./K*.state ./K*.cmp
rm -rf ./keys/
rm -f dig.out* rrsig.out.* keyevent.out.*
rm -f ns*/named.conf ns*/named.memstats ns*/named.run*
rm -f ns*/named-fips.conf
rm -f ns*/policies/*.conf
rm -f ns*/*.jnl ns*/*.jbk
rm -f ns*/K*.private ns*/K*.key ns*/K*.state
+2 -2
View File
@@ -21,7 +21,7 @@ dnssec-policy "kasp" {
keys {
csk key-directory lifetime P1Y algorithm 13;
ksk key-directory lifetime P1Y algorithm 8;
zsk key-directory lifetime P30D algorithm 8 1024;
zsk key-directory lifetime P6M algorithm 8 2000;
zsk key-directory lifetime P30D algorithm 8 2048;
zsk key-directory lifetime P6M algorithm 8 3072;
};
};
+2 -1
View File
@@ -46,8 +46,9 @@ zone "unsigned.tld" {
zone "signed.tld" {
type primary;
dnssec-policy "default";
file "signed.tld.db";
dnssec-policy "default";
inline-signing yes;
};
/* Primary service for ns3 */
+1
View File
@@ -24,5 +24,6 @@ dnssec-policy "ed25519" {
zone "ed25519.kasp" {
type primary;
file "ed25519.kasp.db";
inline-signing yes;
dnssec-policy "ed25519";
};
+1
View File
@@ -24,5 +24,6 @@ dnssec-policy "ed448" {
zone "ed448.kasp" {
type primary;
file "ed448.kasp.db";
inline-signing yes;
dnssec-policy "ed448";
};
@@ -0,0 +1,508 @@
/*
* 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.
*/
// NS3
include "policies/kasp.conf";
include "policies/autosign.conf";
options {
query-source address 10.53.0.3;
notify-source 10.53.0.3;
transfer-source 10.53.0.3;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.3; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
dnssec-policy "rsasha256";
};
key rndc_key {
secret "1234abcd8765";
algorithm @DEFAULT_HMAC@;
};
controls {
inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
/* Zones that are getting initially signed */
/* The default case: No keys created, using default policy. */
zone "default.kasp" {
type primary;
file "default.kasp.db";
inline-signing yes;
dnssec-policy "default";
};
/* checkds: Zone with one KSK. */
zone "checkds-ksk.kasp" {
type primary;
file "checkds-ksk.kasp.db";
inline-signing yes;
dnssec-policy "checkds-ksk";
};
/* checkds: Zone with two KSKs. */
zone "checkds-doubleksk.kasp" {
type primary;
file "checkds-doubleksk.kasp.db";
inline-signing yes;
dnssec-policy "checkds-doubleksk";
};
/* checkds: Zone with one CSK. */
zone "checkds-csk.kasp" {
type primary;
file "checkds-csk.kasp.db";
inline-signing yes;
dnssec-policy "checkds-csk";
};
/* Key lifetime unlimited. */
zone "unlimited.kasp" {
type primary;
file "unlimited.kasp.db";
inline-signing yes;
dnssec-policy "unlimited";
};
/* Manual rollover. */
zone "manual-rollover.kasp" {
type primary;
file "manual-rollover.kasp.db";
inline-signing yes;
dnssec-policy "manual-rollover";
};
/* A zone that inherits dnssec-policy. */
zone "inherit.kasp" {
type primary;
inline-signing yes;
file "inherit.kasp.db";
};
/* A zone that overrides dnssec-policy. */
zone "unsigned.kasp" {
type primary;
file "unsigned.kasp.db";
inline-signing yes;
dnssec-policy "none";
};
/* A zone that is initially set to insecure. */
zone "insecure.kasp" {
type primary;
file "insecure.kasp.db";
inline-signing yes;
dnssec-policy "insecure";
};
/* A primary zone with dnssec-policy but keys already created. */
zone "dnssec-keygen.kasp" {
type primary;
file "dnssec-keygen.kasp.db";
inline-signing yes;
dnssec-policy "rsasha256";
};
/* A secondary zone with dnssec-policy. */
zone "secondary.kasp" {
type secondary;
primaries { 10.53.0.2; };
file "secondary.kasp.db";
inline-signing yes;
dnssec-policy "rsasha256";
};
/* A dynamic zone with dnssec-policy. */
zone "dynamic.kasp" {
type primary;
file "dynamic.kasp.db";
dnssec-policy "default";
allow-update { any; };
};
/* A dynamic inline-signed zone with dnssec-policy. */
zone "dynamic-inline-signing.kasp" {
type primary;
file "dynamic-inline-signing.kasp.db";
dnssec-policy "default";
allow-update { any; };
inline-signing yes;
};
/* An inline-signed zone with dnssec-policy. */
zone "inline-signing.kasp" {
type primary;
file "inline-signing.kasp.db";
dnssec-policy "default";
inline-signing yes;
};
/*
* A configured dnssec-policy but some keys already created.
*/
zone "some-keys.kasp" {
type primary;
file "some-keys.kasp.db";
inline-signing yes;
dnssec-policy "rsasha256";
};
/*
* A configured dnssec-policy but some keys already in use.
*/
zone "legacy-keys.kasp" {
type primary;
file "legacy-keys.kasp.db";
inline-signing yes;
dnssec-policy "migrate-to-dnssec-policy";
};
/*
* A configured dnssec-policy with (too) many keys pregenerated.
*/
zone "pregenerated.kasp" {
type primary;
file "pregenerated.kasp.db";
inline-signing yes;
dnssec-policy "rsasha256";
};
/*
* A configured dnssec-policy with one rumoured key.
* Bugfix case for GL #1593.
*/
zone "rumoured.kasp" {
type primary;
file "rumoured.kasp.db";
inline-signing yes;
dnssec-policy "rsasha256";
};
/* RFC 8901 Multi-signer Model 2. */
zone "multisigner-model2.kasp" {
type primary;
file "multisigner-model2.kasp.db";
dnssec-policy "multisigner-model2";
allow-update { any; };
};
/*
* Different algorithms.
*/
zone "rsasha256.kasp" {
type primary;
file "rsasha256.kasp.db";
inline-signing yes;
dnssec-policy "rsasha256";
};
zone "rsasha512.kasp" {
type primary;
file "rsasha512.kasp.db";
inline-signing yes;
dnssec-policy "rsasha512";
};
zone "ecdsa256.kasp" {
type primary;
file "ecdsa256.kasp.db";
inline-signing yes;
dnssec-policy "ecdsa256";
};
zone "ecdsa384.kasp" {
type primary;
file "ecdsa384.kasp.db";
inline-signing yes;
dnssec-policy "ecdsa384";
};
/*
* Zone with too high TTL.
*/
zone "max-zone-ttl.kasp" {
type primary;
file "max-zone-ttl.kasp.db";
inline-signing yes;
dnssec-policy "ttl";
};
/*
* Zones in different signing states.
*/
/*
* Zone that has expired signatures.
*/
zone "expired-sigs.autosign" {
type primary;
file "expired-sigs.autosign.db";
inline-signing yes;
dnssec-policy "autosign";
};
/*
* Zone that has valid, fresh signatures.
*/
zone "fresh-sigs.autosign" {
type primary;
file "fresh-sigs.autosign.db";
inline-signing yes;
dnssec-policy "autosign";
};
/*
* Zone that has unfresh signatures.
*/
zone "unfresh-sigs.autosign" {
type primary;
file "unfresh-sigs.autosign.db";
inline-signing yes;
dnssec-policy "autosign";
};
/*
* Zone that has missing private KSK.
*/
zone "ksk-missing.autosign" {
type primary;
file "ksk-missing.autosign.db";
inline-signing yes;
dnssec-policy "autosign";
};
/*
* Zone that has missing private ZSK.
*/
zone "zsk-missing.autosign" {
type primary;
file "zsk-missing.autosign.db";
inline-signing yes;
dnssec-policy "autosign";
};
/*
* Zone that has inactive ZSK.
*/
zone "zsk-retired.autosign" {
type primary;
file "zsk-retired.autosign.db";
inline-signing yes;
dnssec-policy "autosign";
};
/*
* Zones for testing enabling DNSSEC.
*/
zone "step1.enable-dnssec.autosign" {
type primary;
file "step1.enable-dnssec.autosign.db";
inline-signing yes;
dnssec-policy "enable-dnssec";
};
zone "step2.enable-dnssec.autosign" {
type primary;
file "step2.enable-dnssec.autosign.db";
inline-signing yes;
dnssec-policy "enable-dnssec";
};
zone "step3.enable-dnssec.autosign" {
type primary;
file "step3.enable-dnssec.autosign.db";
inline-signing yes;
dnssec-policy "enable-dnssec";
};
zone "step4.enable-dnssec.autosign" {
type primary;
file "step4.enable-dnssec.autosign.db";
inline-signing yes;
dnssec-policy "enable-dnssec";
};
/*
* Zones for testing ZSK Pre-Publication steps.
*/
zone "step1.zsk-prepub.autosign" {
type primary;
file "step1.zsk-prepub.autosign.db";
inline-signing yes;
dnssec-policy "zsk-prepub";
};
zone "step2.zsk-prepub.autosign" {
type primary;
file "step2.zsk-prepub.autosign.db";
inline-signing yes;
dnssec-policy "zsk-prepub";
};
zone "step3.zsk-prepub.autosign" {
type primary;
file "step3.zsk-prepub.autosign.db";
inline-signing yes;
dnssec-policy "zsk-prepub";
};
zone "step4.zsk-prepub.autosign" {
type primary;
file "step4.zsk-prepub.autosign.db";
inline-signing yes;
dnssec-policy "zsk-prepub";
};
zone "step5.zsk-prepub.autosign" {
type primary;
file "step5.zsk-prepub.autosign.db";
inline-signing yes;
dnssec-policy "zsk-prepub";
};
zone "step6.zsk-prepub.autosign" {
type primary;
file "step6.zsk-prepub.autosign.db";
inline-signing yes;
dnssec-policy "zsk-prepub";
};
/*
* Zones for testing KSK Double-KSK steps.
*/
zone "step1.ksk-doubleksk.autosign" {
type primary;
file "step1.ksk-doubleksk.autosign.db";
inline-signing yes;
dnssec-policy "ksk-doubleksk";
};
zone "step2.ksk-doubleksk.autosign" {
type primary;
file "step2.ksk-doubleksk.autosign.db";
inline-signing yes;
dnssec-policy "ksk-doubleksk";
};
zone "step3.ksk-doubleksk.autosign" {
type primary;
file "step3.ksk-doubleksk.autosign.db";
inline-signing yes;
dnssec-policy "ksk-doubleksk";
};
zone "step4.ksk-doubleksk.autosign" {
type primary;
file "step4.ksk-doubleksk.autosign.db";
inline-signing yes;
dnssec-policy "ksk-doubleksk";
};
zone "step5.ksk-doubleksk.autosign" {
type primary;
file "step5.ksk-doubleksk.autosign.db";
inline-signing yes;
dnssec-policy "ksk-doubleksk";
};
zone "step6.ksk-doubleksk.autosign" {
type primary;
file "step6.ksk-doubleksk.autosign.db";
inline-signing yes;
dnssec-policy "ksk-doubleksk";
};
/*
* Zones for testing CSK rollover steps.
*/
zone "step1.csk-roll.autosign" {
type primary;
file "step1.csk-roll.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll";
};
zone "step2.csk-roll.autosign" {
type primary;
file "step2.csk-roll.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll";
};
zone "step3.csk-roll.autosign" {
type primary;
file "step3.csk-roll.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll";
};
zone "step4.csk-roll.autosign" {
type primary;
file "step4.csk-roll.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll";
};
zone "step5.csk-roll.autosign" {
type primary;
file "step5.csk-roll.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll";
};
zone "step6.csk-roll.autosign" {
type primary;
file "step6.csk-roll.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll";
};
zone "step7.csk-roll.autosign" {
type primary;
file "step7.csk-roll.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll";
};
zone "step8.csk-roll.autosign" {
type primary;
file "step8.csk-roll.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll";
};
zone "step1.csk-roll2.autosign" {
type primary;
file "step1.csk-roll2.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll2";
};
zone "step2.csk-roll2.autosign" {
type primary;
file "step2.csk-roll2.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll2";
};
zone "step3.csk-roll2.autosign" {
type primary;
file "step3.csk-roll2.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll2";
};
zone "step4.csk-roll2.autosign" {
type primary;
file "step4.csk-roll2.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll2";
};
zone "step5.csk-roll2.autosign" {
type primary;
file "step5.csk-roll2.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll2";
};
zone "step6.csk-roll2.autosign" {
type primary;
file "step6.csk-roll2.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll2";
};
zone "step7.csk-roll2.autosign" {
type primary;
file "step7.csk-roll2.autosign.db";
inline-signing yes;
dnssec-policy "csk-roll2";
};
+2 -435
View File
@@ -13,451 +13,18 @@
// NS3
include "policies/kasp.conf";
include "policies/autosign.conf";
include "named-fips.conf";
options {
query-source address 10.53.0.3;
notify-source 10.53.0.3;
transfer-source 10.53.0.3;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.3; };
listen-on-v6 { none; };
allow-transfer { any; };
recursion no;
dnssec-policy "rsasha1";
};
key rndc_key {
secret "1234abcd8765";
algorithm @DEFAULT_HMAC@;
};
controls {
inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
/* Zones that are getting initially signed */
/* The default case: No keys created, using default policy. */
zone "default.kasp" {
type primary;
file "default.kasp.db";
dnssec-policy "default";
};
/* checkds: Zone with one KSK. */
zone "checkds-ksk.kasp" {
type primary;
file "checkds-ksk.kasp.db";
dnssec-policy "checkds-ksk";
};
/* checkds: Zone with two KSKs. */
zone "checkds-doubleksk.kasp" {
type primary;
file "checkds-doubleksk.kasp.db";
dnssec-policy "checkds-doubleksk";
};
/* checkds: Zone with one CSK. */
zone "checkds-csk.kasp" {
type primary;
file "checkds-csk.kasp.db";
dnssec-policy "checkds-csk";
};
/* Key lifetime unlimited. */
zone "unlimited.kasp" {
type primary;
file "unlimited.kasp.db";
dnssec-policy "unlimited";
};
/* Manual rollover. */
zone "manual-rollover.kasp" {
type primary;
file "manual-rollover.kasp.db";
dnssec-policy "manual-rollover";
};
/* A primary zone with dnssec-policy, no keys created. */
zone "rsasha1.kasp" {
type primary;
file "rsasha1.kasp.db";
dnssec-policy "rsasha1";
};
/* A zone that inherits dnssec-policy. */
zone "inherit.kasp" {
type primary;
file "inherit.kasp.db";
};
/* A zone that overrides dnssec-policy. */
zone "unsigned.kasp" {
type primary;
file "unsigned.kasp.db";
dnssec-policy "none";
};
/* A zone that is initially set to insecure. */
zone "insecure.kasp" {
type primary;
file "insecure.kasp.db";
dnssec-policy "insecure";
};
/* A primary zone with dnssec-policy but keys already created. */
zone "dnssec-keygen.kasp" {
type primary;
file "dnssec-keygen.kasp.db";
dnssec-policy "rsasha1";
};
/* A secondary zone with dnssec-policy. */
zone "secondary.kasp" {
type secondary;
primaries { 10.53.0.2; };
file "secondary.kasp.db";
dnssec-policy "rsasha1";
};
/* A dynamic zone with dnssec-policy. */
zone "dynamic.kasp" {
type primary;
file "dynamic.kasp.db";
dnssec-policy "default";
allow-update { any; };
};
/* A dynamic inline-signed zone with dnssec-policy. */
zone "dynamic-inline-signing.kasp" {
type primary;
file "dynamic-inline-signing.kasp.db";
dnssec-policy "default";
allow-update { any; };
inline-signing yes;
};
/* An inline-signed zone with dnssec-policy. */
zone "inline-signing.kasp" {
type primary;
file "inline-signing.kasp.db";
dnssec-policy "default";
inline-signing yes;
};
/*
* A configured dnssec-policy but some keys already created.
*/
zone "some-keys.kasp" {
type primary;
file "some-keys.kasp.db";
dnssec-policy "rsasha1";
};
/*
* A configured dnssec-policy but some keys already in use.
*/
zone "legacy-keys.kasp" {
type primary;
file "legacy-keys.kasp.db";
dnssec-policy "migrate-to-dnssec-policy";
};
/*
* A configured dnssec-policy with (too) many keys pregenerated.
*/
zone "pregenerated.kasp" {
type primary;
file "pregenerated.kasp.db";
dnssec-policy "rsasha1";
};
/*
* A configured dnssec-policy with one rumoured key.
* Bugfix case for GL #1593.
*/
zone "rumoured.kasp" {
type primary;
file "rumoured.kasp.db";
dnssec-policy "rsasha1";
};
/* RFC 8901 Multi-signer Model 2. */
zone "multisigner-model2.kasp" {
type primary;
file "multisigner-model2.kasp.db";
dnssec-policy "multisigner-model2";
allow-update { any; };
};
/*
* Different algorithms.
*/
zone "rsasha1-nsec3.kasp" {
type primary;
file "rsasha1-nsec3.kasp.db";
inline-signing yes;
dnssec-policy "rsasha1-nsec3";
};
zone "rsasha256.kasp" {
type primary;
file "rsasha256.kasp.db";
dnssec-policy "rsasha256";
};
zone "rsasha512.kasp" {
type primary;
file "rsasha512.kasp.db";
dnssec-policy "rsasha512";
};
zone "ecdsa256.kasp" {
type primary;
file "ecdsa256.kasp.db";
dnssec-policy "ecdsa256";
};
zone "ecdsa384.kasp" {
type primary;
file "ecdsa384.kasp.db";
dnssec-policy "ecdsa384";
};
/*
* Zone with too high TTL.
*/
zone "max-zone-ttl.kasp" {
type primary;
file "max-zone-ttl.kasp.db";
dnssec-policy "ttl";
};
/*
* Zones in different signing states.
*/
/*
* Zone that has expired signatures.
*/
zone "expired-sigs.autosign" {
type primary;
file "expired-sigs.autosign.db";
dnssec-policy "autosign";
};
/*
* Zone that has valid, fresh signatures.
*/
zone "fresh-sigs.autosign" {
type primary;
file "fresh-sigs.autosign.db";
dnssec-policy "autosign";
};
/*
* Zone that has unfresh signatures.
*/
zone "unfresh-sigs.autosign" {
type primary;
file "unfresh-sigs.autosign.db";
dnssec-policy "autosign";
};
/*
* Zone that has missing private KSK.
*/
zone "ksk-missing.autosign" {
type primary;
file "ksk-missing.autosign.db";
dnssec-policy "autosign";
};
/*
* Zone that has missing private ZSK.
*/
zone "zsk-missing.autosign" {
type primary;
file "zsk-missing.autosign.db";
dnssec-policy "autosign";
};
/*
* Zone that has inactive ZSK.
*/
zone "zsk-retired.autosign" {
type primary;
file "zsk-retired.autosign.db";
dnssec-policy "autosign";
};
/*
* Zones for testing enabling DNSSEC.
*/
zone "step1.enable-dnssec.autosign" {
type primary;
file "step1.enable-dnssec.autosign.db";
dnssec-policy "enable-dnssec";
};
zone "step2.enable-dnssec.autosign" {
type primary;
file "step2.enable-dnssec.autosign.db";
dnssec-policy "enable-dnssec";
};
zone "step3.enable-dnssec.autosign" {
type primary;
file "step3.enable-dnssec.autosign.db";
dnssec-policy "enable-dnssec";
};
zone "step4.enable-dnssec.autosign" {
type primary;
file "step4.enable-dnssec.autosign.db";
dnssec-policy "enable-dnssec";
};
/*
* Zones for testing ZSK Pre-Publication steps.
*/
zone "step1.zsk-prepub.autosign" {
type primary;
file "step1.zsk-prepub.autosign.db";
dnssec-policy "zsk-prepub";
};
zone "step2.zsk-prepub.autosign" {
type primary;
file "step2.zsk-prepub.autosign.db";
dnssec-policy "zsk-prepub";
};
zone "step3.zsk-prepub.autosign" {
type primary;
file "step3.zsk-prepub.autosign.db";
dnssec-policy "zsk-prepub";
};
zone "step4.zsk-prepub.autosign" {
type primary;
file "step4.zsk-prepub.autosign.db";
dnssec-policy "zsk-prepub";
};
zone "step5.zsk-prepub.autosign" {
type primary;
file "step5.zsk-prepub.autosign.db";
dnssec-policy "zsk-prepub";
};
zone "step6.zsk-prepub.autosign" {
type primary;
file "step6.zsk-prepub.autosign.db";
dnssec-policy "zsk-prepub";
};
/*
* Zones for testing KSK Double-KSK steps.
*/
zone "step1.ksk-doubleksk.autosign" {
type primary;
file "step1.ksk-doubleksk.autosign.db";
dnssec-policy "ksk-doubleksk";
};
zone "step2.ksk-doubleksk.autosign" {
type primary;
file "step2.ksk-doubleksk.autosign.db";
dnssec-policy "ksk-doubleksk";
};
zone "step3.ksk-doubleksk.autosign" {
type primary;
file "step3.ksk-doubleksk.autosign.db";
dnssec-policy "ksk-doubleksk";
};
zone "step4.ksk-doubleksk.autosign" {
type primary;
file "step4.ksk-doubleksk.autosign.db";
dnssec-policy "ksk-doubleksk";
};
zone "step5.ksk-doubleksk.autosign" {
type primary;
file "step5.ksk-doubleksk.autosign.db";
dnssec-policy "ksk-doubleksk";
};
zone "step6.ksk-doubleksk.autosign" {
type primary;
file "step6.ksk-doubleksk.autosign.db";
dnssec-policy "ksk-doubleksk";
};
/*
* Zones for testing CSK rollover steps.
*/
zone "step1.csk-roll.autosign" {
type primary;
file "step1.csk-roll.autosign.db";
dnssec-policy "csk-roll";
};
zone "step2.csk-roll.autosign" {
type primary;
file "step2.csk-roll.autosign.db";
dnssec-policy "csk-roll";
};
zone "step3.csk-roll.autosign" {
type primary;
file "step3.csk-roll.autosign.db";
dnssec-policy "csk-roll";
};
zone "step4.csk-roll.autosign" {
type primary;
file "step4.csk-roll.autosign.db";
dnssec-policy "csk-roll";
};
zone "step5.csk-roll.autosign" {
type primary;
file "step5.csk-roll.autosign.db";
dnssec-policy "csk-roll";
};
zone "step6.csk-roll.autosign" {
type primary;
file "step6.csk-roll.autosign.db";
dnssec-policy "csk-roll";
};
zone "step7.csk-roll.autosign" {
type primary;
file "step7.csk-roll.autosign.db";
dnssec-policy "csk-roll";
};
zone "step8.csk-roll.autosign" {
type primary;
file "step8.csk-roll.autosign.db";
dnssec-policy "csk-roll";
};
zone "step1.csk-roll2.autosign" {
type primary;
file "step1.csk-roll2.autosign.db";
dnssec-policy "csk-roll2";
};
zone "step2.csk-roll2.autosign" {
type primary;
file "step2.csk-roll2.autosign.db";
dnssec-policy "csk-roll2";
};
zone "step3.csk-roll2.autosign" {
type primary;
file "step3.csk-roll2.autosign.db";
dnssec-policy "csk-roll2";
};
zone "step4.csk-roll2.autosign" {
type primary;
file "step4.csk-roll2.autosign.db";
dnssec-policy "csk-roll2";
};
zone "step5.csk-roll2.autosign" {
type primary;
file "step5.csk-roll2.autosign.db";
dnssec-policy "csk-roll2";
};
zone "step6.csk-roll2.autosign" {
type primary;
file "step6.csk-roll2.autosign.db";
dnssec-policy "csk-roll2";
};
zone "step7.csk-roll2.autosign" {
type primary;
file "step7.csk-roll2.autosign.db";
dnssec-policy "csk-roll2";
};
@@ -0,0 +1,118 @@
/*
* 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 "unlimited" {
dnskey-ttl 1234;
keys {
csk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
};
};
dnssec-policy "manual-rollover" {
dnskey-ttl 3600;
keys {
ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
};
};
dnssec-policy "multisigner-model2" {
dnskey-ttl 3600;
keys {
ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
};
};
dnssec-policy "migrate-to-dnssec-policy" {
dnskey-ttl 1234;
keys {
ksk key-directory lifetime P6M algorithm 8;
zsk key-directory lifetime P6M algorithm 8;
};
};
dnssec-policy "rsasha256" {
dnskey-ttl 1234;
keys {
ksk key-directory lifetime P10Y algorithm 8;
zsk key-directory lifetime P5Y algorithm 8;
zsk key-directory lifetime P1Y algorithm 8 3072;
};
};
dnssec-policy "rsasha512" {
dnskey-ttl 1234;
keys {
ksk key-directory lifetime P10Y algorithm 10;
zsk key-directory lifetime P5Y algorithm 10;
zsk key-directory lifetime P1Y algorithm 10 3072;
};
};
dnssec-policy "ecdsa256" {
dnskey-ttl 1234;
keys {
ksk key-directory lifetime P10Y algorithm 13;
zsk key-directory lifetime P5Y algorithm 13;
zsk key-directory lifetime P1Y algorithm 13 256;
};
};
dnssec-policy "ecdsa384" {
dnskey-ttl 1234;
keys {
ksk key-directory lifetime P10Y algorithm 14;
zsk key-directory lifetime P5Y algorithm 14;
zsk key-directory lifetime P1Y algorithm 14 384;
};
};
dnssec-policy "checkds-ksk" {
dnskey-ttl 303;
keys {
ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
};
};
dnssec-policy "checkds-doubleksk" {
dnskey-ttl 303;
keys {
ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
};
};
dnssec-policy "checkds-csk" {
dnskey-ttl 303;
keys {
csk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
};
};
dnssec-policy "ttl" {
max-zone-ttl 299;
};
+1 -105
View File
@@ -11,31 +11,7 @@
* information regarding copyright ownership.
*/
dnssec-policy "unlimited" {
dnskey-ttl 1234;
keys {
csk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
};
};
dnssec-policy "manual-rollover" {
dnskey-ttl 3600;
keys {
ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
};
};
dnssec-policy "multisigner-model2" {
dnskey-ttl 3600;
keys {
ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
};
};
include "policies/kasp-fips.conf";
dnssec-policy "rsasha1" {
dnskey-ttl 1234;
@@ -47,15 +23,6 @@ dnssec-policy "rsasha1" {
};
};
dnssec-policy "migrate-to-dnssec-policy" {
dnskey-ttl 1234;
keys {
ksk key-directory lifetime P6M algorithm 5;
zsk key-directory lifetime P6M algorithm 5;
};
};
dnssec-policy "rsasha1-nsec3" {
dnskey-ttl 1234;
@@ -65,74 +32,3 @@ dnssec-policy "rsasha1-nsec3" {
zsk key-directory lifetime P1Y algorithm 7 2000;
};
};
dnssec-policy "rsasha256" {
dnskey-ttl 1234;
keys {
ksk key-directory lifetime P10Y algorithm 8;
zsk key-directory lifetime P5Y algorithm 8;
zsk key-directory lifetime P1Y algorithm 8 2000;
};
};
dnssec-policy "rsasha512" {
dnskey-ttl 1234;
keys {
ksk key-directory lifetime P10Y algorithm 10;
zsk key-directory lifetime P5Y algorithm 10;
zsk key-directory lifetime P1Y algorithm 10 2000;
};
};
dnssec-policy "ecdsa256" {
dnskey-ttl 1234;
keys {
ksk key-directory lifetime P10Y algorithm 13;
zsk key-directory lifetime P5Y algorithm 13;
zsk key-directory lifetime P1Y algorithm 13 256;
};
};
dnssec-policy "ecdsa384" {
dnskey-ttl 1234;
keys {
ksk key-directory lifetime P10Y algorithm 14;
zsk key-directory lifetime P5Y algorithm 14;
zsk key-directory lifetime P1Y algorithm 14 384;
};
};
dnssec-policy "checkds-ksk" {
dnskey-ttl 303;
keys {
ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
};
};
dnssec-policy "checkds-doubleksk" {
dnskey-ttl 303;
keys {
ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
};
};
dnssec-policy "checkds-csk" {
dnskey-ttl 303;
keys {
csk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
};
};
dnssec-policy "ttl" {
max-zone-ttl 299;
};
+30 -14
View File
@@ -42,8 +42,8 @@ U="UNRETENTIVE"
#
# Set up zones that will be initially signed.
#
for zn in default rsasha1 dnssec-keygen some-keys legacy-keys pregenerated \
rumoured rsasha1-nsec3 rsasha256 rsasha512 ecdsa256 ecdsa384 \
for zn in default dnssec-keygen some-keys legacy-keys pregenerated \
rumoured rsasha256 rsasha512 ecdsa256 ecdsa384 \
dynamic dynamic-inline-signing inline-signing \
checkds-ksk checkds-doubleksk checkds-csk inherit unlimited \
manual-rollover multisigner-model2
@@ -52,6 +52,22 @@ do
cp template.db.in "$zonefile"
done
#
# Set up RSASHA1 based zones
#
for zn in rsasha1 rsasha1-nsec3
do
if (cd ..; $SHELL ../testcrypto.sh -q RSASHA1)
then
setup "${zn}.kasp"
cp template.db.in "$zonefile"
else
# don't add to zones.
echo_i "setting up zone: ${zn}.kasp"
cp template.db.in "${zn}.kasp.db"
fi
done
if [ -f ../ed25519-supported.file ]; then
setup "ed25519.kasp"
cp template.db.in "$zonefile"
@@ -78,31 +94,31 @@ done
# Some of these zones already have keys.
zone="dnssec-keygen.kasp"
echo_i "setting up zone: $zone"
$KEYGEN -k rsasha1 -l policies/kasp.conf $zone > keygen.out.$zone.1 2>&1
$KEYGEN -k rsasha256 -l policies/kasp.conf $zone > keygen.out.$zone.1 2>&1
zone="some-keys.kasp"
echo_i "setting up zone: $zone"
$KEYGEN -G -a RSASHA1 -b 2000 -L 1234 $zone > keygen.out.$zone.1 2>&1
$KEYGEN -G -a RSASHA1 -f KSK -L 1234 $zone > keygen.out.$zone.2 2>&1
$KEYGEN -G -a RSASHA256 -b 2048 -L 1234 $zone > keygen.out.$zone.1 2>&1
$KEYGEN -G -a RSASHA256 -f KSK -L 1234 $zone > keygen.out.$zone.2 2>&1
zone="legacy-keys.kasp"
echo_i "setting up zone: $zone"
ZSK=$($KEYGEN -a RSASHA1 -b 2048 -L 1234 $zone 2> keygen.out.$zone.1)
KSK=$($KEYGEN -a RSASHA1 -f KSK -L 1234 $zone 2> keygen.out.$zone.2)
ZSK=$($KEYGEN -a RSASHA256 -b 2048 -L 1234 $zone 2> keygen.out.$zone.1)
KSK=$($KEYGEN -a RSASHA256 -f KSK -L 1234 $zone 2> keygen.out.$zone.2)
echo $ZSK > legacy-keys.kasp.zsk
echo $KSK > legacy-keys.kasp.ksk
# Predecessor keys:
Tact="now-9mo"
Tret="now-3mo"
ZSK=$($KEYGEN -a RSASHA1 -b 2048 -L 1234 $zone 2> keygen.out.$zone.3)
KSK=$($KEYGEN -a RSASHA1 -f KSK -L 1234 $zone 2> keygen.out.$zone.4)
ZSK=$($KEYGEN -a RSASHA256 -b 2048 -L 1234 $zone 2> keygen.out.$zone.3)
KSK=$($KEYGEN -a RSASHA256 -f KSK -L 1234 $zone 2> keygen.out.$zone.4)
$SETTIME -P $Tact -A $Tact -I $Tret -D $Tret "$ZSK" > settime.out.$zone.1 2>&1
$SETTIME -P $Tact -A $Tact -I $Tret -D $Tret "$KSK" > settime.out.$zone.2 2>&1
zone="pregenerated.kasp"
echo_i "setting up zone: $zone"
$KEYGEN -G -k rsasha1 -l policies/kasp.conf $zone > keygen.out.$zone.1 2>&1
$KEYGEN -G -k rsasha1 -l policies/kasp.conf $zone > keygen.out.$zone.2 2>&1
$KEYGEN -G -k rsasha256 -l policies/kasp.conf $zone > keygen.out.$zone.1 2>&1
$KEYGEN -G -k rsasha256 -l policies/kasp.conf $zone > keygen.out.$zone.2 2>&1
zone="multisigner-model2.kasp"
echo_i "setting up zone: $zone"
@@ -122,9 +138,9 @@ echo_i "setting up zone: $zone"
Tpub="now"
Tact="now+1d"
keytimes="-P ${Tpub} -A ${Tact}"
KSK=$($KEYGEN -a RSASHA1 -f KSK -L 1234 $keytimes $zone 2> keygen.out.$zone.1)
ZSK1=$($KEYGEN -a RSASHA1 -b 2000 -L 1234 $keytimes $zone 2> keygen.out.$zone.2)
ZSK2=$($KEYGEN -a RSASHA1 -L 1234 $keytimes $zone 2> keygen.out.$zone.3)
KSK=$($KEYGEN -a RSASHA256 -f KSK -L 1234 $keytimes $zone 2> keygen.out.$zone.1)
ZSK1=$($KEYGEN -a RSASHA256 -b 3072 -L 1234 $keytimes $zone 2> keygen.out.$zone.2)
ZSK2=$($KEYGEN -a RSASHA256 -L 1234 $keytimes $zone 2> keygen.out.$zone.3)
$SETTIME -s -g $O -k $R $Tpub -r $R $Tpub -d $H $Tpub "$KSK" > settime.out.$zone.1 2>&1
$SETTIME -s -g $O -k $R $Tpub -z $R $Tpub "$ZSK1" > settime.out.$zone.2 2>&1
$SETTIME -s -g $O -k $R $Tpub -z $R $Tpub "$ZSK2" > settime.out.$zone.2 2>&1
+12 -8
View File
@@ -75,20 +75,22 @@ view "inherit" {
zone "inherit.inherit.signed" {
type primary;
file "inherit.inherit.signed.db";
inline-signing yes;
};
/* Override dnssec-policy */
zone "override.inherit.signed" {
type primary;
dnssec-policy "default";
file "override.inherit.signed.db";
inline-signing yes;
dnssec-policy "default";
};
/* Unset dnssec-policy */
zone "none.inherit.signed" {
type primary;
dnssec-policy "none";
file "none.inherit.signed.db";
dnssec-policy "none";
};
};
@@ -100,20 +102,22 @@ view "override" {
zone "inherit.override.signed" {
type primary;
file "inherit.override.signed.db";
inline-signing yes;
};
/* Override dnssec-policy */
zone "override.override.signed" {
type primary;
dnssec-policy "test";
file "override.override.signed.db";
inline-signing yes;
dnssec-policy "test";
};
/* Unset dnssec-policy */
zone "none.override.signed" {
type primary;
dnssec-policy "none";
file "none.override.signed.db";
dnssec-policy "none";
};
};
@@ -130,15 +134,16 @@ view "none" {
/* Override dnssec-policy */
zone "override.none.signed" {
type primary;
dnssec-policy "test";
file "override.none.signed.db";
inline-signing yes;
dnssec-policy "test";
};
/* Unset dnssec-policy */
zone "none.none.signed" {
type primary;
dnssec-policy "none";
file "none.none.signed.db";
dnssec-policy "none";
};
};
@@ -150,7 +155,6 @@ view "example1" {
zone "example.net" {
type primary;
file "example1.db";
// Dynamic zone, inline-signing disabled, policy inerhited.
};
};
@@ -160,7 +164,7 @@ view "example2" {
zone "example.net" {
type primary;
file "example2.db";
// Static zone, inline-signing, policy inherited.
inline-signing yes;
};
};
+10 -6
View File
@@ -65,15 +65,16 @@ view "inherit" {
/* Override dnssec-policy */
zone "override.inherit.unsigned" {
type primary;
dnssec-policy "default";
file "override.inherit.unsigned.db";
inline-signing yes;
dnssec-policy "default";
};
/* Unset dnssec-policy */
zone "none.inherit.unsigned" {
type primary;
dnssec-policy "none";
file "none.inherit.unsigned.db";
dnssec-policy "none";
};
};
@@ -85,20 +86,22 @@ view "override" {
zone "inherit.override.unsigned" {
type primary;
file "inherit.override.unsigned.db";
inline-signing yes;
};
/* Override dnssec-policy */
zone "override.override.unsigned" {
type primary;
dnssec-policy "test";
file "override.override.unsigned.db";
inline-signing yes;
dnssec-policy "test";
};
/* Unset dnssec-policy */
zone "none.override.unsigned" {
type primary;
dnssec-policy "none";
file "none.override.unsigned.db";
dnssec-policy "none";
};
};
@@ -115,14 +118,15 @@ view "none" {
/* Override dnssec-policy */
zone "override.none.unsigned" {
type primary;
dnssec-policy "test";
file "override.none.unsigned.db";
inline-signing yes;
dnssec-policy "test";
};
/* Unset dnssec-policy */
zone "none.none.unsigned" {
type primary;
dnssec-policy "none";
file "none.none.unsigned.db";
dnssec-policy "none";
};
};
+7 -2
View File
@@ -42,6 +42,7 @@ controls {
zone "step1.going-insecure.kasp" {
type primary;
file "step1.going-insecure.kasp.db";
inline-signing yes;
dnssec-policy "unsigning";
};
@@ -55,6 +56,7 @@ zone "step1.going-insecure-dynamic.kasp" {
zone "step1.going-straight-to-none.kasp" {
type primary;
file "step1.going-straight-to-none.kasp.db";
inline-signing yes;
dnssec-policy "default";
};
@@ -62,12 +64,14 @@ zone "step1.going-straight-to-none.kasp" {
zone "step1.algorithm-roll.kasp" {
type primary;
file "step1.algorithm-roll.kasp.db";
dnssec-policy "rsasha1";
inline-signing yes;
dnssec-policy "rsasha256";
};
zone "step1.csk-algorithm-roll.kasp" {
type primary;
file "step1.csk-algorithm-roll.kasp.db";
inline-signing yes;
dnssec-policy "csk-algoroll";
};
@@ -79,6 +83,7 @@ dnssec-policy "modified" {
zone example {
type primary;
dnssec-policy modified;
file "example.db";
inline-signing yes;
dnssec-policy modified;
};
+16 -1
View File
@@ -41,12 +41,14 @@ controls {
zone "step1.going-insecure.kasp" {
type primary;
file "step1.going-insecure.kasp.db";
inline-signing yes;
dnssec-policy "insecure";
};
zone "step2.going-insecure.kasp" {
type primary;
file "step2.going-insecure.kasp.db";
inline-signing yes;
dnssec-policy "insecure";
};
@@ -76,36 +78,42 @@ zone "step1.going-straight-to-none.kasp" {
zone "step1.algorithm-roll.kasp" {
type primary;
file "step1.algorithm-roll.kasp.db";
inline-signing yes;
dnssec-policy "ecdsa256";
};
zone "step2.algorithm-roll.kasp" {
type primary;
file "step2.algorithm-roll.kasp.db";
inline-signing yes;
dnssec-policy "ecdsa256";
};
zone "step3.algorithm-roll.kasp" {
type primary;
file "step3.algorithm-roll.kasp.db";
inline-signing yes;
dnssec-policy "ecdsa256";
};
zone "step4.algorithm-roll.kasp" {
type primary;
file "step4.algorithm-roll.kasp.db";
inline-signing yes;
dnssec-policy "ecdsa256";
};
zone "step5.algorithm-roll.kasp" {
type primary;
file "step5.algorithm-roll.kasp.db";
inline-signing yes;
dnssec-policy "ecdsa256";
};
zone "step6.algorithm-roll.kasp" {
type primary;
file "step6.algorithm-roll.kasp.db";
inline-signing yes;
dnssec-policy "ecdsa256";
};
@@ -115,36 +123,42 @@ zone "step6.algorithm-roll.kasp" {
zone "step1.csk-algorithm-roll.kasp" {
type primary;
file "step1.csk-algorithm-roll.kasp.db";
inline-signing yes;
dnssec-policy "csk-algoroll";
};
zone "step2.csk-algorithm-roll.kasp" {
type primary;
file "step2.csk-algorithm-roll.kasp.db";
inline-signing yes;
dnssec-policy "csk-algoroll";
};
zone "step3.csk-algorithm-roll.kasp" {
type primary;
file "step3.csk-algorithm-roll.kasp.db";
inline-signing yes;
dnssec-policy "csk-algoroll";
};
zone "step4.csk-algorithm-roll.kasp" {
type primary;
file "step4.csk-algorithm-roll.kasp.db";
inline-signing yes;
dnssec-policy "csk-algoroll";
};
zone "step5.csk-algorithm-roll.kasp" {
type primary;
file "step5.csk-algorithm-roll.kasp.db";
inline-signing yes;
dnssec-policy "csk-algoroll";
};
zone "step6.csk-algorithm-roll.kasp" {
type primary;
file "step6.csk-algorithm-roll.kasp.db";
inline-signing yes;
dnssec-policy "csk-algoroll";
};
@@ -156,6 +170,7 @@ dnssec-policy "modified" {
zone example {
type primary;
dnssec-policy modified;
file "example.db";
inline-signing yes;
dnssec-policy modified;
};
@@ -17,7 +17,7 @@ dnssec-policy "csk-algoroll" {
signatures-validity-dnskey 30d;
keys {
csk lifetime unlimited algorithm rsasha1;
csk lifetime unlimited algorithm rsasha256;
};
dnskey-ttl 1h;
@@ -0,0 +1,59 @@
/*
* 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 "unsigning" {
dnskey-ttl 7200;
keys {
ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
zsk key-directory lifetime P60D algorithm @DEFAULT_ALGORITHM@;
};
};
dnssec-policy "rsasha256" {
signatures-refresh P5D;
signatures-validity 30d;
signatures-validity-dnskey 30d;
keys {
ksk lifetime unlimited algorithm rsasha256;
zsk lifetime unlimited algorithm rsasha256;
};
dnskey-ttl 1h;
publish-safety PT1H;
retire-safety 2h;
zone-propagation-delay 3600;
max-zone-ttl 6h;
parent-propagation-delay pt1h;
parent-ds-ttl 7200;
};
dnssec-policy "ecdsa256" {
signatures-refresh P5D;
signatures-validity 30d;
signatures-validity-dnskey 30d;
keys {
ksk lifetime unlimited algorithm ecdsa256;
zsk lifetime unlimited algorithm ecdsa256;
};
dnskey-ttl 1h;
publish-safety PT1H;
retire-safety 2h;
zone-propagation-delay 3600;
max-zone-ttl 6h;
parent-propagation-delay pt1h;
parent-ds-ttl 7200;
};
@@ -11,14 +11,7 @@
* information regarding copyright ownership.
*/
dnssec-policy "unsigning" {
dnskey-ttl 7200;
keys {
ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
zsk key-directory lifetime P60D algorithm @DEFAULT_ALGORITHM@;
};
};
include "policies/kasp-fips.conf";
dnssec-policy "rsasha1" {
signatures-refresh P5D;
@@ -38,22 +31,3 @@ dnssec-policy "rsasha1" {
parent-propagation-delay pt1h;
parent-ds-ttl 7200;
};
dnssec-policy "ecdsa256" {
signatures-refresh P5D;
signatures-validity 30d;
signatures-validity-dnskey 30d;
keys {
ksk lifetime unlimited algorithm ecdsa256;
zsk lifetime unlimited algorithm ecdsa256;
};
dnskey-ttl 1h;
publish-safety PT1H;
retire-safety 2h;
zone-propagation-delay 3600;
max-zone-ttl 6h;
parent-propagation-delay pt1h;
parent-ds-ttl 7200;
};
+24 -24
View File
@@ -92,13 +92,13 @@ echo "$zone" >> zones
TactN="now"
ksktimes="-P ${TactN} -A ${TactN} -P sync ${TactN}"
zsktimes="-P ${TactN} -A ${TactN}"
KSK=$($KEYGEN -a RSASHA1 -L 3600 -f KSK $ksktimes $zone 2> keygen.out.$zone.1)
ZSK=$($KEYGEN -a RSASHA1 -L 3600 $zsktimes $zone 2> keygen.out.$zone.2)
KSK=$($KEYGEN -a RSASHA256 -L 3600 -f KSK $ksktimes $zone 2> keygen.out.$zone.1)
ZSK=$($KEYGEN -a RSASHA256 -L 3600 $zsktimes $zone 2> keygen.out.$zone.2)
$SETTIME -s -g $O -k $O $TactN -r $O $TactN -d $O $TactN "$KSK" > settime.out.$zone.1 2>&1
$SETTIME -s -g $O -k $O $TactN -z $O $TactN "$ZSK" > settime.out.$zone.2 2>&1
cat template.db.in "${KSK}.key" "${ZSK}.key" > "$infile"
private_type_record $zone 5 "$KSK" >> "$infile"
private_type_record $zone 5 "$ZSK" >> "$infile"
private_type_record $zone 8 "$KSK" >> "$infile"
private_type_record $zone 8 "$ZSK" >> "$infile"
$SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
# Step 2:
@@ -114,8 +114,8 @@ ksk1times="-P ${TactN} -A ${TactN} -P sync ${TactN} -I now"
zsk1times="-P ${TactN} -A ${TactN} -I now"
ksk2times="-P ${TpubN1} -A ${TpubN1} -P sync ${TsbmN1}"
zsk2times="-P ${TpubN1} -A ${TpubN1}"
KSK1=$($KEYGEN -a RSASHA1 -L 3600 -f KSK $ksk1times $zone 2> keygen.out.$zone.1)
ZSK1=$($KEYGEN -a RSASHA1 -L 3600 $zsk1times $zone 2> keygen.out.$zone.2)
KSK1=$($KEYGEN -a RSASHA256 -L 3600 -f KSK $ksk1times $zone 2> keygen.out.$zone.1)
ZSK1=$($KEYGEN -a RSASHA256 -L 3600 $zsk1times $zone 2> keygen.out.$zone.2)
KSK2=$($KEYGEN -a $DEFAULT_ALGORITHM -L 3600 -f KSK $ksk2times $zone 2> keygen.out.$zone.3)
ZSK2=$($KEYGEN -a $DEFAULT_ALGORITHM -L 3600 $zsk2times $zone 2> keygen.out.$zone.4)
$SETTIME -s -g $H -k $O $TactN -r $O $TactN -d $O $TactN "$KSK1" > settime.out.$zone.1 2>&1
@@ -126,8 +126,8 @@ $SETTIME -s -g $O -k $R $TpubN1 -z $R $TpubN1 "$ZSK2" > settime.ou
echo "Lifetime: 0" >> "${KSK1}.state"
echo "Lifetime: 0" >> "${ZSK1}.state"
cat template.db.in "${KSK1}.key" "${ZSK1}.key" "${KSK2}.key" "${ZSK2}.key" > "$infile"
private_type_record $zone 5 "$KSK1" >> "$infile"
private_type_record $zone 5 "$ZSK1" >> "$infile"
private_type_record $zone 8 "$KSK1" >> "$infile"
private_type_record $zone 8 "$ZSK1" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$KSK2" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$ZSK2" >> "$infile"
$SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
@@ -144,8 +144,8 @@ ksk1times="-P ${TactN} -A ${TactN} -P sync ${TactN} -I ${TretN}"
zsk1times="-P ${TactN} -A ${TactN} -I ${TretN}"
ksk2times="-P ${TpubN1} -A ${TpubN1} -P sync ${TsbmN1}"
zsk2times="-P ${TpubN1} -A ${TpubN1}"
KSK1=$($KEYGEN -a RSASHA1 -L 3600 -f KSK $ksk1times $zone 2> keygen.out.$zone.1)
ZSK1=$($KEYGEN -a RSASHA1 -L 3600 $zsk1times $zone 2> keygen.out.$zone.2)
KSK1=$($KEYGEN -a RSASHA256 -L 3600 -f KSK $ksk1times $zone 2> keygen.out.$zone.1)
ZSK1=$($KEYGEN -a RSASHA256 -L 3600 $zsk1times $zone 2> keygen.out.$zone.2)
KSK2=$($KEYGEN -a $DEFAULT_ALGORITHM -L 3600 -f KSK $ksk2times $zone 2> keygen.out.$zone.3)
ZSK2=$($KEYGEN -a $DEFAULT_ALGORITHM -L 3600 $zsk2times $zone 2> keygen.out.$zone.4)
$SETTIME -s -g $H -k $O $TactN -r $O $TactN -d $O $TactN "$KSK1" > settime.out.$zone.1 2>&1
@@ -156,8 +156,8 @@ $SETTIME -s -g $O -k $O $TpubN1 -z $R $TpubN1 "$ZSK2" > settime.ou
echo "Lifetime: 0" >> "${KSK1}.state"
echo "Lifetime: 0" >> "${ZSK1}.state"
cat template.db.in "${KSK1}.key" "${ZSK1}.key" "${KSK2}.key" "${ZSK2}.key" > "$infile"
private_type_record $zone 5 "$KSK1" >> "$infile"
private_type_record $zone 5 "$ZSK1" >> "$infile"
private_type_record $zone 8 "$KSK1" >> "$infile"
private_type_record $zone 8 "$ZSK1" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$KSK2" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$ZSK2" >> "$infile"
$SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
@@ -175,8 +175,8 @@ ksk1times="-P ${TactN} -A ${TactN} -P sync ${TactN} -I ${TretN}"
zsk1times="-P ${TactN} -A ${TactN} -I ${TretN}"
ksk2times="-P ${TpubN1} -A ${TpubN1} -P sync ${TsbmN1}"
zsk2times="-P ${TpubN1} -A ${TpubN1}"
KSK1=$($KEYGEN -a RSASHA1 -L 3600 -f KSK $ksk1times $zone 2> keygen.out.$zone.1)
ZSK1=$($KEYGEN -a RSASHA1 -L 3600 $zsk1times $zone 2> keygen.out.$zone.2)
KSK1=$($KEYGEN -a RSASHA256 -L 3600 -f KSK $ksk1times $zone 2> keygen.out.$zone.1)
ZSK1=$($KEYGEN -a RSASHA256 -L 3600 $zsk1times $zone 2> keygen.out.$zone.2)
KSK2=$($KEYGEN -a $DEFAULT_ALGORITHM -L 3600 -f KSK $ksk2times $zone 2> keygen.out.$zone.3)
ZSK2=$($KEYGEN -a $DEFAULT_ALGORITHM -L 3600 $zsk2times $zone 2> keygen.out.$zone.4)
$SETTIME -s -g $H -k $O $TactN -r $O $TactN -d $U $TactN1 -D ds $TactN1 "$KSK1" > settime.out.$zone.1 2>&1
@@ -187,8 +187,8 @@ $SETTIME -s -g $O -k $O $TpubN1 -z $R $TpubN1 "$ZSK2
echo "Lifetime: 0" >> "${KSK1}.state"
echo "Lifetime: 0" >> "${ZSK1}.state"
cat template.db.in "${KSK1}.key" "${ZSK1}.key" "${KSK2}.key" "${ZSK2}.key" > "$infile"
private_type_record $zone 5 "$KSK1" >> "$infile"
private_type_record $zone 5 "$ZSK1" >> "$infile"
private_type_record $zone 8 "$KSK1" >> "$infile"
private_type_record $zone 8 "$ZSK1" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$KSK2" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$ZSK2" >> "$infile"
$SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
@@ -207,8 +207,8 @@ ksk1times="-P ${TactN} -A ${TactN} -P sync ${TactN} -I ${TretN}"
zsk1times="-P ${TactN} -A ${TactN} -I ${TretN}"
ksk2times="-P ${TpubN1} -A ${TpubN1} -P sync ${TsbmN1}"
zsk2times="-P ${TpubN1} -A ${TpubN1}"
KSK1=$($KEYGEN -a RSASHA1 -L 3600 -f KSK $ksk1times $zone 2> keygen.out.$zone.1)
ZSK1=$($KEYGEN -a RSASHA1 -L 3600 $zsk1times $zone 2> keygen.out.$zone.2)
KSK1=$($KEYGEN -a RSASHA256 -L 3600 -f KSK $ksk1times $zone 2> keygen.out.$zone.1)
ZSK1=$($KEYGEN -a RSASHA256 -L 3600 $zsk1times $zone 2> keygen.out.$zone.2)
KSK2=$($KEYGEN -a $DEFAULT_ALGORITHM -L 3600 -f KSK $ksk2times $zone 2> keygen.out.$zone.3)
ZSK2=$($KEYGEN -a $DEFAULT_ALGORITHM -L 3600 $zsk2times $zone 2> keygen.out.$zone.4)
$SETTIME -s -g $H -k $U $TremN -r $U $TremN -d $H $TactN1 "$KSK1" > settime.out.$zone.1 2>&1
@@ -219,8 +219,8 @@ $SETTIME -s -g $O -k $O $TpubN1 -z $R $TpubN1 "$ZSK2" > settime.ou
echo "Lifetime: 0" >> "${KSK1}.state"
echo "Lifetime: 0" >> "${ZSK1}.state"
cat template.db.in "${KSK1}.key" "${ZSK1}.key" "${KSK2}.key" "${ZSK2}.key" > "$infile"
private_type_record $zone 5 "$KSK1" >> "$infile"
private_type_record $zone 5 "$ZSK1" >> "$infile"
private_type_record $zone 8 "$KSK1" >> "$infile"
private_type_record $zone 8 "$ZSK1" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$KSK2" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$ZSK2" >> "$infile"
$SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1
@@ -240,8 +240,8 @@ ksk1times="-P ${TactN} -A ${TactN} -P sync ${TactN} -I ${TretN}"
zsk1times="-P ${TactN} -A ${TactN} -I ${TretN}"
ksk2times="-P ${TpubN1} -A ${TpubN1} -P sync ${TsbmN1}"
zsk2times="-P ${TpubN1} -A ${TpubN1}"
KSK1=$($KEYGEN -a RSASHA1 -L 3600 -f KSK $ksk1times $zone 2> keygen.out.$zone.1)
ZSK1=$($KEYGEN -a RSASHA1 -L 3600 $zsk1times $zone 2> keygen.out.$zone.2)
KSK1=$($KEYGEN -a RSASHA256 -L 3600 -f KSK $ksk1times $zone 2> keygen.out.$zone.1)
ZSK1=$($KEYGEN -a RSASHA256 -L 3600 $zsk1times $zone 2> keygen.out.$zone.2)
KSK2=$($KEYGEN -a $DEFAULT_ALGORITHM -L 3600 -f KSK $ksk2times $zone 2> keygen.out.$zone.3)
ZSK2=$($KEYGEN -a $DEFAULT_ALGORITHM -L 3600 $zsk2times $zone 2> keygen.out.$zone.4)
$SETTIME -s -g $H -k $H $TremN -r $U $TdeaN -d $H $TactN1 "$KSK1" > settime.out.$zone.1 2>&1
@@ -252,8 +252,8 @@ $SETTIME -s -g $O -k $O $TpubN1 -z $R $TpubN1 "$ZSK2" > settime.ou
echo "Lifetime: 0" >> "${KSK1}.state"
echo "Lifetime: 0" >> "${ZSK1}.state"
cat template.db.in "${KSK1}.key" "${ZSK1}.key" "${KSK2}.key" "${ZSK2}.key" > "$infile"
private_type_record $zone 5 "$KSK1" >> "$infile"
private_type_record $zone 5 "$ZSK1" >> "$infile"
private_type_record $zone 8 "$KSK1" >> "$infile"
private_type_record $zone 8 "$ZSK1" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$KSK2" >> "$infile"
private_type_record $zone $DEFAULT_ALGORITHM_NUMBER "$ZSK2" >> "$infile"
$SIGNER -S -x -s now-1h -e now+2w -o $zone -O full -f $zonefile $infile > signer.out.$zone.1 2>&1

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