2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

37617 Commits

Author SHA1 Message Date
Tony Finch
c1305baece Merge branch 'fanf-deduplicate-time-units' into 'main'
Deduplicate time unit conversion factors

See merge request isc-projects/bind9!7033
2022-11-25 13:47:15 +00:00
Tony Finch
00307fe318 Deduplicate time unit conversion factors
The various factors like NS_PER_MS are now defined in a single place
and the names are no longer inconsistent. I chose the _PER_SEC names
rather than _PER_S because it is slightly more clear in isolation;
but the smaller units are always NS, US, and MS.
2022-11-25 13:23:36 +00:00
Tom Krizek
fdb285d95b Merge branch 'tkrizek/system-tests-start-stop-helpers' into 'main'
Simplify start/stop helper func in system tests

See merge request isc-projects/bind9!7123
2022-11-25 11:55:55 +00:00
Tom Krizek
c100308b7d
Simplify start/stop helper func in system tests
The system test should never attempt to start or stop any other server
than those that belong to that system test. Therefore, it is not
necessary to specify the system test name in function calls.

Additionally, this makes it possible to run the test inside a
differently named directory, as its name is automatically detected with
the $SYSTESTDIR variable. This enables running the system tests inside a
temporary directory.

Direct use of stop.pl was replaced with a more systematic approach to
use stop_servers helper function.
2022-11-25 09:27:33 +01:00
Mark Andrews
6678f672ab Merge branch '3638-tls-settings-for-primaries-not-saved-for-catalog-zone-entries' into 'main'
Resolve "TLS settings for primaries not saved for catalog zone entries."

Closes #3638

See merge request isc-projects/bind9!7010
2022-11-24 22:52:53 +00:00
Mark Andrews
7e223f5e55 Add release note for [GL #3638] 2022-11-25 08:51:09 +11:00
Mark Andrews
de3bd0d3d6 Add CHANGES note for [GL #3638] 2022-11-25 08:51:07 +11:00
Mark Andrews
bb66ef2a47 Add catalog zone that requires TLS for all transfers
Both the catalog zone (catalog-tls.example) the zone managed using
the catalog zone (tls1.example) require TLS and a TSIG for zone
transfers.
2022-11-25 08:50:36 +11:00
Mark Andrews
b95d089751 Fix log messages incorrectly logged at error
The log message "got TLS configuration for zone transfer" is not
an error, setting to info.
2022-11-25 08:50:36 +11:00
Mark Andrews
65f2512315 TLS setting of primaries with catalog zones where being ignored
Extract the tlss values if present from the ipkeylist entry and add
the resulting tls setting to the constructed configuration for the
primary.

When comparing catalog zone entries for reuse also check the
masters.tlss values for equality.
2022-11-25 08:50:36 +11:00
Evan Hunt
e2bbf38cdb Merge branch '3680-remove-nupdates' into 'main'
remove unused 'nupdates' field from client

Closes #3680

See merge request isc-projects/bind9!7098
2022-11-24 00:01:56 +00:00
Evan Hunt
18606f5276 remove unused 'nupdates' field from client
the 'nupdates' field was originally used to track whether a client
was ready to shut down, along with other similar counters nreads,
nrecvs, naccepts and nsends. this is now tracked differently, but
nupdates was overlooked when the other counters were removed.
2022-11-23 23:44:10 +00:00
Michal Nowak
55491d6b0a Merge branch '3310-build-contrib-in-ci' into 'main'
Build contrib in CI & associated fixes

Closes #3310

See merge request isc-projects/bind9!6363
2022-11-23 17:14:00 +00:00
Michal Nowak
445a90fb78
Help gcovr find contrib files 2022-11-23 17:18:46 +01:00
Michal Nowak
35e44978b5
Add install target for Perl DLZ module
Perl DLZ module Makefile lacked "install" target, add it as we want to
test DLZ module installation in the CI.
2022-11-23 17:17:15 +01:00
Michal Nowak
69b7e4362d
Disable compound-token-split-by-macro warning with Clang
Perl DLZ module compilation with Clang produces the following warning:

    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:150:5: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
        ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                         ^~~~~~~~~~
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/perl.h:666:29: note: expanded from macro 'STMT_START'
    #   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                                  ^
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:150:5: note: '{' token is here
        ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                                    ^
2022-11-23 17:17:15 +01:00
Michal Nowak
4a4a91b012
Build contrib dlz modules in the CI 2022-11-23 17:17:15 +01:00
Michal Nowak
4affc436d3
Leverage CFLAGS from environment in contrib Makefiles 2022-11-23 17:17:15 +01:00
Michal Nowak
99912ed2f7
Fix statement may fall through warnings in dlz_ldap_dynamic.c
dlz_ldap_dynamic.c: In function ‘dlz_create’:
    dlz_ldap_dynamic.c:971:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
      971 |                 if (result != ISC_R_SUCCESS) {
          |                    ^
    dlz_ldap_dynamic.c:974:9: note: here
      974 |         case 11:
          |         ^~~~
    dlz_ldap_dynamic.c:976:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
      976 |                 if (result != ISC_R_SUCCESS) {
          |                    ^
    dlz_ldap_dynamic.c:979:9: note: here
      979 |         case 10:
          |         ^~~~
    dlz_ldap_dynamic.c:980:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
      980 |                 if (strlen(argv[9]) > 0) {
          |                    ^
    dlz_ldap_dynamic.c:987:9: note: here
      987 |         case 9:
          |         ^~~~
2022-11-23 17:17:15 +01:00
Michal Nowak
76c8c58d54
Fix compilation warnings in dlz_wildcard_dynamic.c
dlz_wildcard_dynamic.c: In function ‘dlz_lookup’:
    dlz_wildcard_dynamic.c:227:14: warning: variable ‘origin’ set but not used [-Wunused-but-set-variable]
      227 |         bool origin = true;
          |              ^~~~~~
    dlz_wildcard_dynamic.c: In function ‘dlz_lookup’:
    dlz_wildcard_dynamic.c:252:28: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
      252 |                 cd->record = "@";
          |                            ^
    dlz_wildcard_dynamic.c: In function ‘dlz_authority’:
    dlz_wildcard_dynamic.c:328:22: warning: unused variable ‘origin’ [-Wunused-variable]
      328 |                 bool origin;
          |                      ^~~~~~
    dlz_wildcard_dynamic.c:312:25: warning: unused variable ‘name’ [-Wunused-variable]
      312 |         const char *p, *name = "@";
          |                         ^~~~
    dlz_wildcard_dynamic.c: In function ‘dlz_create’:
    dlz_wildcard_dynamic.c:441:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
      441 |         for (i = 4; i < argc; i += 4) {
          |                       ^
2022-11-23 17:17:15 +01:00
Michal Nowak
60f68dc0d6
Fix compilation warnings in dlz_sqlite3_dynamic.c
dlz_sqlite3_dynamic.c: In function ‘dlz_sqlite3_fetch_row’:
    dlz_sqlite3_dynamic.c:447:31: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
      447 |                 if (rs->pnRow > 0U && rs->curRow < rs->pnRow) {
          |                               ^
    dlz_sqlite3_dynamic.c:447:50: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
      447 |                 if (rs->pnRow > 0U && rs->curRow < rs->pnRow) {
          |                                                  ^
2022-11-23 17:17:15 +01:00
Michal Nowak
587ea10567
Fix warnings in dlz_mysqldyn_mod.c
dlz_mysqldyn_mod.c: In function ‘dlz_findzonedb’:
    dlz_mysqldyn_mod.c:1079:73: warning: unused parameter ‘methods’ [-Wunused-parameter]
     1079 | dlz_findzonedb(void *dbdata, const char *name, dns_clientinfomethods_t *methods,
          |                                                ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
    dlz_mysqldyn_mod.c:1080:34: warning: unused parameter ‘clientinfo’ [-Wunused-parameter]
     1080 |                dns_clientinfo_t *clientinfo) {
          |                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~
    dlz_mysqldyn_mod.c: In function ‘dlz_lookup’:
    dlz_mysqldyn_mod.c:1111:63: warning: unused parameter ‘methods’ [-Wunused-parameter]
     1111 |            dns_sdlzlookup_t *lookup, dns_clientinfomethods_t *methods,
          |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
    dlz_mysqldyn_mod.c: In function ‘build_query’:
    dlz_mysqldyn_mod.c:465:19: warning: pointer ‘item’ used after ‘free’ [-Wuse-after-free]
      465 |              item = DLZ_LIST_NEXT(item, link))
    dlz_mysqldyn_mod.c:470:17: note: call to ‘free’ here
      470 |                 free(item);
          |                 ^~~~~~~~~~
2022-11-23 17:17:15 +01:00
Michal Nowak
be928dbba2
Fix compilation warnings in dlz_perl_driver.c
dlz_perl_driver.c: In function ‘dlz_version’:
    dlz_perl_driver.c:116:27: warning: unused parameter ‘flags’ [-Wunused-parameter]
      116 | dlz_version(unsigned int *flags) {
          |             ~~~~~~~~~~~~~~^~~~~
    In file included from /usr/lib64/perl5/CORE/perl.h:5685,
                     from dlz_perl_driver.c:33:
    dlz_perl_driver.c: In function ‘dlz_allnodes’:
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:151:17: note: in expansion of macro ‘POPs’
      151 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c: In function ‘dlz_allowzonexfr’:
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:251:17: note: in expansion of macro ‘POPs’
      251 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c: In function ‘dlz_findzonedb’:
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:328:17: note: in expansion of macro ‘POPs’
      328 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c: In function ‘dlz_lookup’:
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:407:17: note: in expansion of macro ‘POPs’
      407 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c:472:1: error: no previous prototype for ‘missing_perl_method’ [-Werror=missing-prototypes]
      472 | missing_perl_method(const char *perl_class_name, PerlInterpreter *my_perl)
          | ^~~~~~~~~~~~~~~~~~~
    dlz_perl_driver.c: In function ‘missing_perl_method’:
    dlz_perl_driver.c:485:9: error: ISO C90 forbids array ‘full_name’ whose size cannot be evaluated [-Werror=vla]
      485 |         char full_name[BUF_LEN];
          |         ^~~~
    dlz_perl_driver.c: In function ‘dlz_create’:
    dlz_perl_driver.c:613:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
      613 |         if (missing_method_name = missing_perl_method(perl_class_name, my_perl))
          |             ^~~~~~~~~~~~~~~~~~~
    /usr/lib64/perl5/CORE/pp.h:162:26: warning: value computed is not used [-Wunused-value]
      162 | #define POPs            (*sp--)
          |                         ~^~~~~~
    dlz_perl_driver.c:657:17: note: in expansion of macro ‘POPs’
      657 |                 POPs;
          |                 ^~~~
    dlz_perl_driver.c:502:15: warning: unused variable ‘init_args’ [-Wunused-variable]
      502 |         char *init_args[] = { NULL, NULL };
          |               ^~~~~~~~~
2022-11-23 17:17:14 +01:00
Michal Nowak
1517e4c114 Merge branch 'mnowak/gcovr-cleanup' into 'main'
Various gcovr clean-ups

See merge request isc-projects/bind9!7104
2022-11-23 14:03:27 +00:00
Michal Nowak
fdad6ff7c7
Restructure inline-function helpers for code coverage 2022-11-23 14:54:54 +01:00
Michal Nowak
6b1dd7d6b1
Drop redundant code coverage helper
The "hash.h" file does not need to be copied to "lib/dns/" for the gcovr
tool to generate the code coverage report, as it has been copied
already.
2022-11-23 14:54:54 +01:00
Michal Nowak
8b9c04342d
Drop buffer.h helper for fuzz directory
The "fuzz" directory is no longer included in the code coverage report
and the associated buffer.h helper is no longer needed.
2022-11-23 14:54:54 +01:00
Michal Nowak
3b5e9666c6
Exclude fuzz directory from code coverage report
gcovr fails to process fuzz/old.gcda and fuzz/old.gcno files after !7045
MR with:

    (WARNING) GCOV produced the following errors processing /builds/isc-projects/bind9/fuzz/old.gcda:
    	Cannot open source file ../../fuzz/old.c
    Cannot open source file ../../lib/dns/include/dns/compress.h
    Cannot open source file ../../lib/isc/include/isc/buffer.h
    ...
    (gcovr could not infer a working directory that resolved it.)

Given that code coverage inspection is meant only for BIND 9 code and
not its tests and auxiliary tools, the "fuzz" directory should be
excluded from being included in the code coverage report.
2022-11-23 14:54:54 +01:00
Matthijs Mekking
f9018a63cf Merge branch '3667-deprecate-auto-dnssec' into 'main'
Deprecate auto-dnssec

Closes #3667

See merge request isc-projects/bind9!7075
2022-11-23 10:00:33 +00:00
Matthijs Mekking
fde1d89d03 Add CHANGES and release note for GL #3667
Announce deprecation of 'auto-dnssec'.
2022-11-23 09:46:16 +01:00
Matthijs Mekking
f9845dd128 Deprecate auto-dnssec
Deprecate auto-dnssec, add specific log warning to migrate to
dnssec-policy.
2022-11-23 09:46:16 +01:00
Michal Nowak
9128e540f0 Merge branch 'mnowak/fedora-37' into 'main'
Add Fedora 37

See merge request isc-projects/bind9!7062
2022-11-21 12:46:52 +00:00
Michal Nowak
b293b2c638
Add Fedora 37 2022-11-21 12:48:40 +01:00
Matthijs Mekking
70bc6cc554 Merge branch 'matthijs-remove-key-operations-after-update' into 'main'
Remove dynamic update DNSSEC management

Closes #3686

See merge request isc-projects/bind9!7043
2022-11-18 10:24:35 +00:00
Matthijs Mekking
c7cae33cc3 Add CHANGES and release note for removed feature
Also mention that 'dnssec-secure-to-insecure' is obsoleted.
2022-11-18 11:05:11 +01:00
Matthijs Mekking
f71a6692db Obsolete dnssec-secure-to-insecure option
Now that the key management operations using dynamic updates feature
has been removed, the 'dnssec-secure-to-insecure' option has become
obsoleted.
2022-11-18 11:04:17 +01:00
Matthijs Mekking
93441714ad Remove dynamic update key management documentation
Remove the text from the ARM and DNSSEC guide that describes how to do
key and denial of existence operations using dynamic update. Add a new
section about DNSSEC multi-signer models, but no longer suggest using
dynamic update and auto-dnssec allow.
2022-11-18 11:04:17 +01:00
Matthijs Mekking
b6c2776df5 Remove dynamic update key management code
Remove code that triggers key and denial of existence management
operations. Dynamic update should no longer be used to do DNSSEC
maintenance (other than that of course signatures need to be
created for the new zone contents).
2022-11-18 11:04:17 +01:00
Matthijs Mekking
cd2f619842 Remove dynamic update key management tests
Remove test cases that rely upon key and denial of existence
management operations triggered by dynamic updates.

The autosign system test needed a bit more care than just removing
because the test cases are dependent on each other, so there are some
additional tweaks such as setting the NSEC3PARAM via rndc signing,
and renaming zone input files. In the process, some additional
debug output files have been added, and a 'ret' fail case overwrite
was fixed.
2022-11-18 11:04:17 +01:00
Tony Finch
8272cc23a3 Merge branch '3655-decompress-faster' into 'main'
Simplify and speed up DNS name decompression

Closes #3655

See merge request isc-projects/bind9!7045
2022-11-17 09:06:12 +00:00
Tony Finch
04f3000dfc Fuzzing and benchmarking for dns_name_fromwire()
Since this is very sensitive code which has often had security
problems in many DNS implementations, it needs a decent amount of
validation. This fuzzer ensures that the new code has the same output
as the old code, and that it doesn't take longer than a second.

The benchmark uses the fuzzer's copy of the old dns_name_fromwire()
code to compare a number of scenarios: many compression pointers, many
labels, long labels, random data, with/without downcasing.
2022-11-17 08:45:17 +00:00
Tony Finch
1c0f607811 Simplify and speed up DNS name decompression
The aim is to do less work per byte:

  * Check the bounds for each label, instead of checking the
    bounds for each character.

  * Instead of copying one character at a time from the wire to
    the name, copy entire runs of sequential labels using memmove()
    to make the most of its fast loop.

  * To remember where the name ends, we only need to set the end
    marker when we see a compression pointer or when we reach the
    root label. There is no need to check if we jumped back and
    conditionally update the counter for every character.

  * To parse a compression pointer, we no longer take a diversion
    around the outer loop in between reading the upper byte of the
    pointer and the lower byte.

  * The parser state machine is now implicit in the instruction
    pointer, instead of being an explicit variable. Similarly,
    when we reach the root label we break directly out of the loop
    instead of setting a second state machine variable.

  * DNS_NAME_DOWNCASE is never used with dns_name_fromwire() so
    that option is no longer supported.

I have removed this comment which dated from January 1999 when
dns_name_fromwire() was first introduced:

   /*
    * Note:  The following code is not optimized for speed, but
    * rather for correctness.  Speed will be addressed in the future.
    */

No functional change, apart from removing support for the unused
DNS_NAME_DOWNCASE option. The new code is about 2x faster than the
old code: best case 11x faster, worst case 1.4x faster.
2022-11-17 08:45:15 +00:00
Tony Finch
e0c9692341 Clean up remnants of label types
There were a few comments referring obliquely to different kinds of
labels, which became obsolete a long time ago.
2022-11-17 08:44:27 +00:00
Tony Finch
2bb6208c57 Avoid unspecified behaviour in name_test
C does not make any guarantees about the value of padding in a
structure, so bytewise comparison of two semantically equal structures
with padding can be spuriously non-equal due to non-equal padding
bytes.

Compare each member of name.attributes individually to avoid this
problem.
2022-11-17 08:44:27 +00:00
Mark Andrews
2001a0cdeb Merge branch '3607-apex-in-name_external-may-be-invalid-when-using-dual-stack-servers' into 'main'
Resolve "apex in name_external may be invalid when using dual stack servers"

Closes #3607

See merge request isc-projects/bind9!6924
2022-11-17 01:50:10 +00:00
Mark Andrews
8a2149f502 Add CHANGES note for [GL #3607] 2022-11-17 12:23:45 +11:00
Mark Andrews
f946133ec9 Add system test for dual-stack-servers with possible DNAME response
Create a zone that triggers DNAME owner name checks in a zone that
is only reachable using a dual stack server.  The answer contains
a name that is higher in the tree than the query name.

e.g.
	foo.v4only.net.	CNAME	v4only.net.
	v4only.net.	A	10.0.0.1

ns4 is serving the test zone (ipv4-only)
ns6 is the root server for this test (dual stacked)
ns7 is acting as the dual stack server (dual stacked)
ns9 is the server under test (ipv6-only)
2022-11-17 12:23:45 +11:00
Mark Andrews
a35c34e10f Support starting and stopping IPv6 only servers
Look for $testdir/$server/named.ipv6-only and use
fd92:7065:b8e:ffff::$n instead of 10.53.0.$n to
communicate with the server.
2022-11-17 12:23:45 +11:00
Mark Andrews
dfbffd77f9 Select the appropriate namespace when using a dual stack server
When using dual-stack-servers the covering namespace to check whether
answers are in scope or not should be fctx->domain.  To do this we need
to be able to distingish forwarding due to forwarders clauses and
dual-stack-servers.  A new flag FCTX_ADDRINFO_DUALSTACK has been added
to signal this.
2022-11-17 12:23:45 +11:00
Mark Andrews
3921181e0d Merge branch '1905-check-wildcard-in-checkconf-z' into 'main'
Fix 'named-checkconf -z' was ignoring check-wildcard settings in named.conf

See merge request isc-projects/bind9!7063
2022-11-16 22:55:00 +00:00