2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

27094 Commits

Author SHA1 Message Date
Michał Kępień
04038baf1a Do not call exit() upon check_no_nsec() errors
Replace the fatal() call inside check_no_nsec() with a
zoneverify_log_error() call.  Enable check_no_nsec() to signal errors to
the caller using its return value.

Modify all call sites of check_no_nsec() so that its errors are properly
handled.
2018-06-15 10:35:45 +02:00
Michał Kępień
4354f44d9c Do not call exit() upon verify_nodes() errors
Replace all fatal(), check_result(), and check_dns_dbiterator_current()
calls inside verify_nodes() with zoneverify_log_error() calls and error
handling code.  Enable verify_nodes() to signal errors to the caller
using its return value.

Modify the call site of verify_nodes() so that its errors are properly
handled.

Free all heap elements upon verification context cleanup as a
verification error may prevent them from being freed elsewhere.

Remove the check_dns_dbiterator_current() macro as it is no longer used
anywhere in lib/dns/zoneverify.c.
2018-06-15 10:35:40 +02:00
Michał Kępień
00ecbad2d0 Do not call exit() upon check_bad_algorithms() errors
Replace all fatal() and fprintf() calls inside check_bad_algorithms()
with zoneverify_print() calls and error handling code.  Enable
check_bad_algorithms() to signal errors to the caller using its return
value.

Modify the call site of check_bad_algorithms() so that its errors are
properly handled.
2018-06-15 10:35:25 +02:00
Michał Kępień
7c3f653112 Do not call exit() upon check_dnskey() errors
Replace all fatal() and check_result() calls inside check_dnskey() with
zoneverify_log_error() calls and error handling code.  Enable
check_dnskey() to signal errors to the caller using its return value.

Modify the call site of check_dnskey() so that its errors are properly
handled.
2018-06-15 10:35:10 +02:00
Michał Kępień
1a6525ffa2 Do not call exit() upon check_apex_rrsets() errors
Replace all fatal() calls inside check_apex_rrsets() with
zoneverify_log_error() calls and error handling code.  Enable
check_apex_rrsets() to signal errors to the caller using its return
value.

Modify the call site of check_apex_rrsets() so that its errors are
properly handled.
2018-06-15 10:34:38 +02:00
Michał Kępień
ee06182057 Use RUNTIME_CHECK instead of check_result() where it is safe to do so
Replace calls to check_result() with RUNTIME_CHECK assertions for all
dns_rdata_tostruct() calls in lib/dns/zoneverify.c as this function
cannot fail when the "mctx" argument is NULL (and that is the case for
all call sites of this function throughout lib/dns/zoneverify.c).
2018-06-15 10:16:41 +02:00
Michał Kępień
fc6b5ad585 Extract print_summary() from dns_zoneverify_dnssec()
Extract the part of dns_zoneverify_dnssec() responsible for printing a
summary for a fully signed zone to a separate function.
2018-06-15 10:10:24 +02:00
Michał Kępień
b3d2ab442c Extract check_bad_algorithms() from dns_zoneverify_dnssec()
Extract the part of dns_zoneverify_dnssec() responsible for checking
whether the zone is fully signed using all active algorithms to a
separate function.
2018-06-15 10:10:24 +02:00
Michał Kępień
eb17957c3d Extract verify_nodes() from dns_zoneverify_dnssec()
Extract the part of dns_zoneverify_dnssec() responsible for verifying
DNSSEC signatures against the DNSKEY RRset at zone apex and checking
consistency of NSEC/NSEC3 chains to a separate function.
2018-06-15 10:10:24 +02:00
Michał Kępień
dc81d8cb67 Extract determine_active_algorithms() from dns_zoneverify_dnssec()
Extract the part of dns_zoneverify_dnssec() responsible for determining
and printing a list of DNSSEC algorithms active in the verified zone to
a separate function.
2018-06-15 10:10:24 +02:00
Michał Kępień
f06a755dd2 Extract check_dnskey_sigs() from check_dnskey()
Extract the part of check_dnskey() responsible for determining active
algorithms in the verified zone based on the signatures at zone apex to
a separate function.
2018-06-15 10:10:24 +02:00
Michał Kępień
d4f3b14c78 Extract check_dnskey() from dns_zoneverify_dnssec()
Extract the part of dns_zoneverify_dnssec() responsible for checking the
DNSKEY RRset at zone apex to a separate function.
2018-06-15 10:10:24 +02:00
Michał Kępień
097b57744a Extract check_apex_rrsets() from dns_zoneverify_dnssec()
Extract the part of dns_zoneverify_dnssec() responsible for fetching and
preliminarily checking DNSKEY, SOA, NSEC, and NSEC3PARAM RRsets from
zone apex to a separate function.
2018-06-15 10:10:24 +02:00
Michał Kępień
d949a5d83c Implement zoneverify_log_error() and zoneverify_print()
These functions will be used in the process of replacing fatal(),
check_result(), and fprintf() calls throughout lib/dns/zoneverify.c with
code that does not call exit().  They are intended for:

  - zoneverify_log_error(): logging problems encountered while
    performing zone verification,

  - zoneverify_print(): printing status messages and reports which are
    only useful in standalone tools.

To make using dns_zone_logv() possible, add a new "zone" argument to
dns_zoneverify_dnssec() that standalone tools are expected to set to
NULL.
2018-06-15 10:10:24 +02:00
Michał Kępień
730cc3e3c5 Move algorithm tables to the verification context structure
Tables representing algorithm use in the verified zone are commonly
accessed throughout dns_zoneverify_dnssec().  Move them into the
structure representing a verification context.  While this does not
really simplify currently existing code, it will facilitate passing data
around between smaller functions that dns_zoneverify_dnssec() is about
to get split into.
2018-06-15 10:10:24 +02:00
Michał Kępień
5d666f533b Move commonly used dns_rdataset_t structures to the verification context structure
Eight structures representing four RRsets and their signatures are
commonly accessed throughout dns_zoneverify_dnssec().  Move them into
the structure representing a verification context.  While this does not
really simplify currently existing code, it will facilitate passing data
around between smaller functions that dns_zoneverify_dnssec() is about
to get split into.
2018-06-15 10:10:24 +02:00
Michał Kępień
43d0fb84e7 Move commonly used variables to the verification context structure
Move variables commonly used throughout dns_zoneverify_dnssec() and its
helper functions to the structure representing a verification context in
order to reduce the number of arguments passed between functions.
2018-06-15 10:10:24 +02:00
Michał Kępień
ffc7997723 Do not use static variables in lib/dns/zoneverify.c
Make dns_zoneverify_dnssec() eligible for multithreaded use by replacing
the static variables it accesses with a stack-allocated structure
containing these variables.  Implement setup and cleanup routines for
that structure, ensuring no error in these routines causes exit() to be
called any more.  Pass a pointer to that structure to functions
requiring access to variables which were previously static.
2018-06-15 10:10:24 +02:00
Michał Kępień
7554e8d2ca Rename verifyzone() to dns_zoneverify_dnssec()
This makes the function's name match the naming convention used for
libdns functions.
2018-06-15 10:07:22 +02:00
Michał Kępień
3a14450d39 Move verifyzone() and its dependencies into lib/dns/zoneverify.c
This commit only moves code around, with the following exceptions:

  - the check_dns_dbiterator_current() macro and functions
    is_delegation() and has_dname() were removed from
    bin/dnssec/dnssectool.{c,h} and duplicated in two locations:
    bin/dnssec/dnssec-signzone.c and lib/dns/zoneverify.c; these
    functions are used both by the code in bin/dnssec/dnssec-signzone.c
    and verifyzone(), but are not a good fit for being exported by a
    code module responsible for zone verification,

  - fatal() and check_result() were duplicated in lib/dns/zoneverify.c
    as static functions which do not use the "program" variable any more
    (as it is only set by the tools in bin/dnssec/); this is a temporary
    step which only aims to prevent compilation from breaking - these
    duplicate functions will be removed once lib/dns/zoneverify.c is
    refactored not to use them,

  - the list of header files included by lib/dns/zoneverify.c was
    expanded to encompass all header files that are actually used by the
    code in that file,

  - a description of the purpose of the commented out "fields" inside
    struct nsec3_chain_fixed was added.
2018-06-15 10:07:22 +02:00
Michał Kępień
ffe8ddd95f Replace type_format() and TYPE_FORMATSIZE with their libdns counterparts
Rather than use custom functions and macros local to bin/dnssec/, use
their counterparts provided by libdns.
2018-06-15 09:59:20 +02:00
Michał Kępień
c37537cfe7 Merge branch '341-constify-dns_rdata_tostruct' into 'master'
Resolve "constify dns_rdata_tostruct"

Closes #341

See merge request isc-projects/bind9!378
2018-06-15 02:57:54 -04:00
Mark Andrews
abb2fd1027 Declare the 'rdata' argument for dns_rdata_tostruct() to be const 2018-06-15 08:48:49 +02:00
Ondřej Surý
3668e152bb Merge branch 'fix-pkcs11-build' into 'master'
Fix pkcs11 build

See merge request isc-projects/bind9!377
2018-06-14 18:06:22 -04:00
Ondřej Surý
8ee23a47e8 Add better EMPTY_TRANSLATION_UNIT to isc/util.h 2018-06-14 17:58:03 -04:00
Ondřej Surý
38060959c7 Put proper guards in openssl_shim.{c,h} when compiling with PKCS#11 2018-06-14 17:58:03 -04:00
Ondřej Surý
0b559ccb33 Merge branch 'tests-server-stale-prereq' into 'master'
Fix serve-stale requirement, skip without Time::HiRes

See merge request isc-projects/bind9!356
2018-06-14 10:36:14 -04:00
Petr Menšík
7a0c7bf9c8 Fix server-stale requirement, skip without Time::HiRes 2018-06-14 10:26:54 -04:00
Ondřej Surý
85da0086a8 Merge branch '309-fix-default-recursion' into 'master'
Resolve "Recursion improperly allowed by default"

Closes #309

See merge request isc-projects/bind9!372
2018-06-14 08:51:55 -04:00
Evan Hunt
05f25f8970 add a regression test for default allow-recursion settings 2018-06-14 14:42:50 +02:00
Evan Hunt
03ecba2cdc allow-recursion could incorrectly inherit from the default allow-query 2018-06-14 14:42:50 +02:00
Ondřej Surý
92b4e70d35 Merge branch '337-remove-copyright-information-from-generated-configure-file' into 'master'
Resolve "Remove copyright information from generated configure file"

Closes #337

See merge request isc-projects/bind9!370
2018-06-14 03:56:00 -04:00
Ondřej Surý
369d8cd432 Remove copyright information from the generated configure file 2018-06-14 09:46:33 +02:00
Ondřej Surý
e4295bb46c Merge branch '328-add-openssl-shim' into 'master'
Add thin openssl shim for OpenSSL 1.1.x and LibreSSL compatibility functions

See merge request isc-projects/bind9!367
2018-06-13 08:27:21 -04:00
Ondřej Surý
de23b20ccf Update copyrights and whitespace 2018-06-13 14:19:07 +02:00
Ondřej Surý
302c6cbe7f Add thin openssl shim for OpenSSL 1.1.x and LibreSSL compatibility functions 2018-06-13 14:19:07 +02:00
Witold Krecicki
be8a607341 Merge branch 'fix-qmin-test-addr-order' into 'master'
Fix qname minimization test failures with A/AAAA ordering

See merge request isc-projects/bind9!368
2018-06-13 07:58:34 -04:00
Witold Kręcicki
524233a9d0 Fix qname minimization test failures with A/AAAA ordering 2018-06-13 13:47:26 +02:00
Michał Kępień
9b58500c6a Merge branch '298-fix-dname-handling-in-dnssec-tools' into 'master'
Fix DNAME handling in DNSSEC tools

Closes #298

See merge request isc-projects/bind9!345
2018-06-13 07:29:20 -04:00
Michał Kępień
f467ba8e1f Add CHANGES entry
4971.	[bug]		dnssec-signzone and dnssec-verify did not treat records
			below a DNAME as out-of-zone data. [GL #298]
2018-06-13 12:55:34 +02:00
Mark Andrews
7be900a98f Pull out the saving of the zone cut into a separate function 2018-06-13 12:55:32 +02:00
Michał Kępień
75c0d85fc4 Treat records below a DNAME as out-of-zone data
DNAME records indicate bottom of zone and thus no records below a DNAME
should be DNSSEC-signed or included in NSEC(3) chains.  Add a helper
function, has_dname(), for detecting DNAME records at a given node.
Prevent signing DNAME-obscured records.  Check that DNAME-obscured
records are not signed.
2018-06-13 12:19:54 +02:00
Ondřej Surý
cf9fd889a6 Merge branch '328-remove-openssl-patch' into 'master'
Remove the OpenSSL PKCS#11 patches

See merge request isc-projects/bind9!362
2018-06-13 05:01:49 -04:00
Ondřej Surý
c92d09320b Remove the OpenSSL PKCS#11 patches - not really needed now 2018-06-13 10:53:21 +02:00
Michał Kępień
337e37a6cf Merge branch '284-unify-keyfile-to-configuration-conversions-in-system-tests' into 'master'
Unify keyfile-to-configuration conversions in system tests

Closes #284

See merge request isc-projects/bind9!312
2018-06-13 02:06:15 -04:00
Michał Kępień
68f056b2a0 Add helper variables in mkeys system test
The keyfile and key ID for the original managed key do not change
throughout the mkeys system test.  Keep them in helper variables to
prevent calling "cat" multiple times and improve code readability.
2018-06-13 07:57:40 +02:00
Michał Kępień
120af964ce Replace duplicated code snippet with calls to helper functions
Reduce code duplication by replacing a code snippet repeated throughout
system tests using "trusted-keys" and/or "managed-keys" configuration
sections with calls to keyfile_to_{managed,trusted}_keys() helper
functions.
2018-06-13 07:57:40 +02:00
Michał Kępień
2392b8bc7d Add helper functions for converting keyfile data into configuration sections
Add a set of helper functions for system test scripts which enable
converting key data from a set of keyfiles to either a "trusted-keys"
section or a "managed-keys" section suitable for including in a
resolver's configuration file.
2018-06-13 07:57:40 +02:00
Witold Krecicki
7dc84eaa8e Merge branch '16-qname-minimization' into 'master'
QNAME Minimization

See merge request isc-projects/bind9!253
2018-06-12 07:44:36 -04:00
Witold Kręcicki
7ec88b384d Add qname-minimization off as an option; test fixes 2018-06-12 10:24:05 +02:00