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

290 Commits

Author SHA1 Message Date
Evan Hunt
6799a222d1 keep the keynode attached as long as dsset is in use
when using the trust anchor dsset as val->dsset, keep a reference
to the keynode so dsset can't be freed.
2020-01-14 09:26:19 -08:00
Evan Hunt
7fdf40770f remove all code that uses non-DS trust anchors
as initial-key and static-key trust anchors will now be stored as a
DS rrset, code referencing keynodes storing DNSKEY trust anchors will
no longer be reached.
2020-01-14 09:24:13 -08:00
Evan Hunt
21d3f66f1c rename dns_keytable_deletekeynode to dns_keytable_deletekey
this function is used by dns_view_untrust() to handle revoked keys, so
it will still be needed after the keytable/validator refactoring is
complete, even though the keytable will be storing DS trust anchors
instead of keys. to simplify the way it's called, it now takes a DNSKEY
rdata struct instead of a DST key.
2020-01-14 09:23:21 -08:00
Evan Hunt
8aaee26548 add validator support for static DS-style trust anchors 2019-11-15 15:47:56 -08:00
Evan Hunt
ac0d3c21c6 add a global function to match a DS rdata to a DNSKEY 2019-11-15 15:47:17 -08:00
Evan Hunt
692c879e3c remove unneeded members from dns_validator
- val->keynode and val->seensig were set but never used.
- val->nearest, val->soaset, val->soaname, val->nsecset and val->nsec3set
  were never used at all.
2019-11-15 14:26:08 -08:00
Evan Hunt
3a4334636b simplify validate_dnskey and seek_ds
- pull out the code that checks whether a key was signed by a trust
  anchor into a separate function, anchor_signed().
- pull out the code that looks up a DS while validating a zone key
  into a separate function, get_dsset().
- check in create_validator() whether the sigrdataset is bound, so that
  we can always pass in &val->fsigrdataset during an insecurity proof;
  this will allow a reduction of code duplication.
2019-11-15 14:26:08 -08:00
Evan Hunt
9119dc25fe continue renaming functions for clarity
- also simplified some calls: don't pass siginfo where val->siginfo
  is sufficient, don't INSIST where returning false is sufficient.
- also added header comments to several local functions.
2019-11-15 14:26:07 -08:00
Evan Hunt
22aa668b7d convert if to switch in get_key 2019-11-15 14:26:07 -08:00
Evan Hunt
9150688efd rename fetch/validator callback functions for consistency and clarity 2019-11-15 14:26:07 -08:00
Evan Hunt
edc9c79c9c reorder switch in validatezonekey to similar order as seek_ds 2019-11-15 14:26:07 -08:00
Evan Hunt
d0f8c50618 convert if statement to switch 2019-11-15 14:26:07 -08:00
Evan Hunt
ea1d4d11fc refactor dsfetched/dsfetched2 into a common function 2019-11-15 14:26:06 -08:00
Evan Hunt
3659cca624 rename some functions for better clarity 2019-11-15 14:26:06 -08:00
Evan Hunt
54710873a7 move some duplicate code into validate_neg_rrset() 2019-11-15 14:26:06 -08:00
Evan Hunt
6dc5343d6d move the 'mustbesecure' checks into markanswer() 2019-11-15 14:26:06 -08:00
Evan Hunt
61456d886e split proveunsecure() 2019-11-15 14:26:06 -08:00
Evan Hunt
34d7776f14 reduce redundant code 2019-11-15 14:10:56 -08:00
Evan Hunt
32d1cc1562 style, braces, whitespace 2019-11-15 14:10:56 -08:00
Ondřej Surý
c2dad0dcb2 Replace RUNTIME_CHECK(dns_name_copy(..., NULL)) with dns_name_copynf()
Use the semantic patch from the previous commit to replace all the calls to
dns_name_copy() with NULL as third argument with dns_name_copynf().
2019-10-01 10:43:26 +10:00
Ondřej Surý
35bd7e4da0 Add RUNTIME_CHECK() around plain dns_name_copy(..., NULL) calls using spatch
This commit add RUNTIME_CHECK() around all simple dns_name_copy() calls where
the third argument is NULL using the semantic patch from the previous commit.
2019-10-01 10:43:26 +10:00
Mark Andrews
06d9e93a57 address DNS_R_MUSTBESECURE failures 2019-09-04 21:28:34 +10:00
Ondřej Surý
50e109d659 isc_event_allocate() cannot fail, remove the fail handling blocks
isc_event_allocate() calls isc_mem_get() to allocate the event structure.  As
isc_mem_get() cannot fail softly (e.g. it never returns NULL), the
isc_event_allocate() cannot return NULL, hence we remove the (ret == NULL)
handling blocks using the semantic patch from the previous commit.
2019-08-30 08:55:34 +02:00
Evan Hunt
6a51b66197 remove DLV from validator 2019-08-08 08:46:13 -07:00
Ondřej Surý
ae83801e2b Remove blocks checking whether isc_mem_get() failed using the coccinelle 2019-07-23 15:32:35 -04:00
Ondřej Surý
78d0cb0a7d Use coccinelle to remove explicit '#include <config.h>' from the source files 2019-03-08 15:15:05 +01:00
Tony Finch
0f219714e1 cleanup: use dns_secalg_t and dns_dsdigest_t where appropriate
Use them in structs for various rdata types where they are missing.
This doesn't change the structs since we are replacing explicit
uint8_t field types with aliases for uint8_t.

Use dns_dsdigest_t in library function arguments.

Improve dnssec-cds with these more specific types.
2019-03-08 18:37:50 +11:00
Ondřej Surý
e69dc0dbc7 Remove RSAMD5 support 2018-12-11 11:32:24 +01:00
Witold Kręcicki
929ea7c2c4 - Make isc_mutex_destroy return void
- Make isc_mutexblock_init/destroy return void
- Minor cleanups
2018-11-22 11:52:08 +00:00
Ondřej Surý
2f3eee5a4f isc_mutex_init returns 'void' 2018-11-22 11:51:49 +00:00
Mark Andrews
333f718dd3 don't use 'typename' as it is reserved in C++ 2018-11-14 13:45:20 -05:00
Ondřej Surý
23fff6c569 Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached 2018-11-08 12:22:17 +07:00
Ondřej Surý
7fd3dc63de Add generic message digest API (isc_md) to replace specific MD functions md5/sha1/sha256 2018-10-25 08:15:42 +02:00
Witold Kręcicki
70a1ba20ec QNAME miminimization should create a separate fetch context for each fetch -
this makes the cache more efficient and eliminates duplicates queries.
2018-10-23 12:15:04 +00:00
Ondřej Surý
994e656977 Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
Ondřej Surý
cb6a185c69 Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +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
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
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
Evan Hunt
b291b45312 temporarily revert change #4859 2018-03-02 11:30:02 -08:00
Ondřej Surý
843d389661 Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
Tinderbox User
10e49fc83b update copyright notice / whitespace 2018-01-04 23:45:32 +00:00
Evan Hunt
053b51c4db [master] block validator deadlock and prevent use-after-free
4859.	[bug]		A loop was possible when attempting to validate
			unsigned CNAME responses from secure zones;
			this caused a delay in returning SERVFAIL and
			also increased the chances of encountering
			CVE-2017-3145. [RT #46839]

4858.	[security]	Addresses could be referenced after being freed
			in resolver.c, causing an assertion failure.
			(CVE-2017-3145) [RT #46839]
2018-01-03 19:11:18 -08:00
Evan Hunt
3abcd7cd8a [master] Revert "[master] tag initializing keys so they can't be used for normal validation"
This reverts commit 560d8b833edceb4b715fe46b45f2009dc09fdb5d.

This change created a potential race between key refresh queries and
root zone priming queries which could leave the root name servers in
the bad-server cache.
2017-10-12 10:53:35 -07:00
Evan Hunt
560d8b833e [master] tag initializing keys so they can't be used for normal validation
4773.	[bug]		Keys specified in "managed-keys" statements
			can now only be used when validating key refresh
			queries during initialization of RFC 5011 key
			maintenance. If initialization fails, DNSSEC
			validation of normal queries will also fail.
			Previously, validation of normal queries could
			succeed using the initializing key, potentially
			masking problems with managed-keys. [RT #46077]
2017-10-11 21:01:13 -07:00
Mark Andrews
52fd57c989 4681. [bug] Log messages from the validator now include the
associated view unless the view is "_default/IN"
                        or "_dnsclient/IN". [RT #45770]
2017-08-16 09:29:20 +10:00
Evan Hunt
6ce8a05f6c [master] update copyrights that had been missed recently 2017-04-23 17:06:00 -07:00
Mukund Sivaraman
5d01eab088 Ignore SHA-1 DS digest type when SHA-384 DS digest type is present (#45017) 2017-04-21 16:19:38 +05:30
Mark Andrews
52e2aab392 4546. [func] Extend the use of const declarations. [RT #43379] 2016-12-30 15:45:08 +11:00