2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00
Commit Graph

7051 Commits

Author SHA1 Message Date
Michał Kępień
d7143986b1 Move find_zone_keys() to lib/dns/zone_p.h
Rename find_zone_keys() to dns__zone_findkeys() and move it to
lib/dns/zone_p.h, so that it can be used in unit tests.  Add a comment
describing the purpose of this function.
2018-05-09 13:21:02 +02:00
Michał Kępień
b1947cee82 Move update_sigs() to lib/dns/zone_p.h
Rename update_sigs() to dns__zone_updatesigs() and move it to
lib/dns/zone_p.h, so that it can be unit tested.  Add a comment
describing the purpose of this function.
2018-05-09 13:21:02 +02:00
Michał Kępień
ace465a9f9 Move zonediff_t to lib/dns/zone_p.h
Rename zonediff_t to dns__zonediff_t and move it to lib/dns/zone_p.h, so
that unit tests can be written for functions taking pointers to
structures of this type as arguments.
2018-05-09 13:21:02 +02:00
Michał Kępień
c1bc3be806 Add lib/dns/zone_p.h
Add a new private header file, lib/dns/zone_p.h, which will hold type
definitions and function prototypes not meant to be exported by libdns,
but required by zone-related unit tests.
2018-05-09 13:21:02 +02:00
Michał Kępień
3c22af0d35 Add a helper function to facilitate preparing dns_diff_t structures
Implement dns_test_difffromchanges(), a function which enables preparing
a dns_diff_t structure from a mostly-textual representation of zone
database changes to be applied.  This will improve readability of test
case definitions by allowing contents of a dns_diff_t structure, passed
e.g. to update_sigs(), to be represented in a human-friendly manner.
2018-05-09 13:21:01 +02:00
Michał Kępień
2980cbd55f Rename dns_test_rdata_fromstring() to dns_test_rdatafromstring()
Remove the underscore from "rdata_fromstring" so that all helper
functions for libdns tests use a common naming covention.
2018-05-09 13:14:24 +02:00
Michał Kępień
bfbeef3609 Rework dns_test_makezone()
The dns_test_makezone() helper function always assigns the created zone
to some view, which is not always necessary and complicates cleanup of
non-managed zones as they are required not to be assigned to any view.

Rework dns_test_makezone() in order to make it easier to use in unit
tests operating on non-managed zones.  Use dns_name_fromstring() instead
of dns_name_fromtext() to simplify code.  Do not use the CHECK() macro
and add comments to make code flow simpler to follow.  Use
dns_test_makeview() instead of dns_view_create().

Adjust existing unit tests using this function so that they still pass.
2018-05-08 12:26:53 +02:00
Mark Andrews
22fab3199f simplify mask construction 2018-05-03 10:56:32 -04:00
Ondřej Surý
61da2bf028 Remove support for OpenSSL < 1.0.0 2018-05-03 15:55:39 +02:00
Ondřej Surý
8d648e7a8a Use standard OPENSSL_NO_ENGINE instead of custom USE_ENGINE define 2018-05-03 15:32:43 +02:00
Ondřej Surý
8bf192b4d1 Use BN_hex2bn instead of custom BN_fromhex function 2018-05-03 15:22:15 +02:00
Evan Hunt
0795dceda7 remove dangling references to --enable-crypto-rand in doc and comments 2018-05-03 15:03:46 +02:00
Ondřej Surý
9a3a257374 Always use random data from the crypto provider 2018-05-03 15:03:46 +02:00
Ondřej Surý
6b9e3b7b06 Workaround LibreSSL 2.7.0-2.7.2 quirk in DH_set0_key 2018-05-03 14:13:32 +02:00
Ondřej Surý
29ff62a149 Add support for LibreSSL 2.7 2018-05-03 14:13:20 +02:00
Michał Kępień
6acf326969 Apply raw zone deltas to yet unsigned secure zones
When inline signing is enabled for a zone without creating signing keys
for it, changes subsequently applied to the raw zone will not be
reflected in the secure zone due to the dns_update_signaturesinc() call
inside receive_secure_serial() failing.  Given that an inline zone will
be served (without any signatures) even with no associated signing keys
being present, keep applying raw zone deltas to the secure zone until
keys become available in an attempt to follow the principle of least
astonishment.
2018-04-25 12:00:31 -07:00
Michał Kępień
cfbc8e264d Only log bumped signed serial after a successful secure zone update
If a raw zone is modified, but the dns_update_signaturesinc() call in
receive_secure_serial() fails, the corresponding secure zone's database
will not be modified, even though by that time a message containing the
bumped signed serial will already have been logged.  This creates
confusion, because a different secure zone version will be served than
the one announced in the logs.  Move the relevant dns_zone_log() call so
that it is only performed if the secure zone's database is modified.
2018-04-24 09:18:47 -07:00
Evan Hunt
8b1baa10ee remove unnecessary comparison 2018-04-20 19:51:00 -04:00
Evan Hunt
e00eb55cd2 silence warnings about unnecessary comparisons
- these are cases where result has been explicitly set, so
  if (result != ISC_R_SUCCESS) is unnecessary
2018-04-20 19:51:00 -04:00
Evan Hunt
4247477b61 add header guards in files that were missing them 2018-04-20 19:51:00 -04:00
Evan Hunt
9ca3ab1168 fix shadowed global variables 2018-04-20 19:51:00 -04:00
Evan Hunt
4bef0cfcfd add missing symbols 2018-04-20 16:40:17 -07:00
Evan Hunt
784087390a remove the rbtdb64 database implementation 2018-04-20 16:14:51 -07:00
Mark Andrews
49f8e9571c use %u instead of %d for unsigned int arguments 2018-04-20 14:50:35 -07:00
Evan Hunt
c592655c0f new option "dnskey-sig-validity"
- overrides "sig-validity-interval" for DNSKEY, CDNSKEY and CDS RRSIGs
2018-04-20 12:12:08 -07:00
Mark Andrews
68e9315c7d add named.conf option root-key-sentinel 2018-04-18 08:49:55 -07:00
Tony Finch
286a7b6b9a Allow TTL values when configuring TTLs and time intervals.
Options updated to use ttlvals: max-cache-ttl, max-ncache-ttl,
max-policy-ttl, fstrm-set-reopen-interval, interface-interval, and
min-update-interval.
2018-04-13 11:46:06 -07:00
Evan Hunt
7fe67ae949 add missing include 2018-04-12 09:20:09 -07:00
Ondřej Surý
9fda5253fd Remove isc_string_printf and isc_string_printf_truncate.
Replace with simple snprintf() as appropriate.
2018-04-12 10:37:33 +02:00
Ondřej Surý
20d145efef Replace isc_string_touint64 with strtoull (C99) 2018-04-12 10:37:33 +02:00
Ondřej Surý
8bdc23add2 Change ISC_SOCKEVENTATTR_* defines into isc_sockeventattr_t enum 2018-04-12 09:54:24 +02:00
Ondřej Surý
c2f42583c0 Refactor ISC_SOCKET_* defines into an isc_socket_options_t enum 2018-04-12 09:54:21 +02:00
Mukund Sivaraman
44b84cb5a6 Fix TSIG dump keyfile name buffer size issues 2018-04-11 12:04:39 +02:00
Ondřej Surý
7467735258 Define PATH_MAX on Windows as _MAX_PATH, so we can use it everywhere 2018-04-11 12:04:39 +02:00
Michał Kępień
4df4a8e731 Use dns_fixedname_initname() where possible
Replace dns_fixedname_init() calls followed by dns_fixedname_name()
calls with calls to dns_fixedname_initname() where it is possible
without affecting current behavior and/or performance.

This patch was mostly prepared using Coccinelle and the following
semantic patch:

    @@
    expression fixedname, name;
    @@
    -	dns_fixedname_init(&fixedname);
    	...
    -	name = dns_fixedname_name(&fixedname);
    +	name = dns_fixedname_initname(&fixedname);

The resulting set of changes was then manually reviewed to exclude false
positives and apply minor tweaks.

It is likely that more occurrences of this pattern can be refactored in
an identical way.  This commit only takes care of the low-hanging fruit.
2018-04-09 12:14:16 +02:00
Mukund Sivaraman
0d2a03c290 Add a dns_fixedname_initname() helper function
This also turns the dns_fixedname macros into functions.
2018-04-09 12:14:16 +02:00
Witold Kręcicki
102a397e39 libdns refactoring: get rid of multiple versions of dns_keytable_add, dns_iptable_addprefix and dns_iptable_addprefix 2018-04-06 08:04:41 +02:00
Witold Kręcicki
c8aa1ee9e6 libdns refactoring: get rid of multiple versions of dns_dt_create, dns_view_setcache, dns_zt_apply, dns_message_logfmtpacket, dns_message_logpacket, dns_ssutable_checkrules and dns_ttl_totext 2018-04-06 08:04:41 +02:00
Witold Kręcicki
d54d482af0 libdns refactoring: get rid of multiple versions of dns_view_find, dns_view_findzonecut and dns_view_flushcache 2018-04-06 08:04:41 +02:00
Witold Kręcicki
702c022016 libdns refactoring: get rid of multiple versions of dns_xfrin_create, dst_key_generate, dst_lib_init and dst_context_create 2018-04-06 08:04:41 +02:00
Witold Kręcicki
ef0e68bfc3 libdns refactoring: integrate zone->options and zone->options2 into one enum, removing unnecessary flags. 2018-04-06 08:04:41 +02:00
Witold Kręcicki
7dbc6768d6 libdns refactoring: get rid of multiple versions of dns_zone_setfile, dns_zone_notifyreceive, dns_zone_dumptostream, dns_zone_getserial 2018-04-06 08:04:41 +02:00
Witold Kręcicki
42ee8c853a libdns refactoring: get rid of 3 versions of dns_resolver_createfetch 2018-04-06 08:04:41 +02:00
Witold Kręcicki
25cd3168a7 libdns refactoring: get rid of multiple versions of dns_dnssec_findmatchingkeys and dns_dnssec_findzonekeys 2018-04-06 08:04:41 +02:00
Witold Kręcicki
8c12e488f7 libdns refactoring: get rid of multiple versions of dns_request_createraw and dns_request_createvia 2018-04-06 08:04:41 +02:00
Witold Kręcicki
e2a06db7f3 libdns refactoring: get rid of multiple versions of dns_master_loadfile, dns_master_loadfileinc, dns_master_dump, dns_master_dumpinc, dns_master_dumptostream, dns_master_stylecreate 2018-04-06 08:04:41 +02:00
Witold Kręcicki
e20b702418 libdns refactoring: get rid of multiple versions of dns_dispatch_createtcp and dns_dispatch_addresponse, unify dns_dispatch_gettcp and dns_dispatch_gettcp2 2018-04-06 08:04:41 +02:00
Witold Kręcicki
275a6a3bec libdns refactoring: get rid of unnecessary dns_db_dump2 and 3 versions of dns_db_load 2018-04-06 08:04:41 +02:00
Witold Kręcicki
76e17b54ea libdns refactoring: get rid of two versions of dns_client_createx 2018-04-06 08:04:41 +02:00
Witold Kręcicki
d39b3209fb libdns refactoring: get rid of 3 versions of dns_cache_create 2018-04-06 08:04:41 +02:00