bind9/lib/ns
Michał Kępień f88c90f47f Fix "no DS" proofs for wildcard+CNAME delegations
When answering a query requires wildcard expansion, the AUTHORITY
section of the response needs to include NSEC(3) record(s) proving that
the QNAME does not exist.

When a response to a query is an insecure delegation, the AUTHORITY
section needs to include an NSEC(3) proof that no DS record exists at
the parent side of the zone cut.

These two conditions combined trip up the NSEC part of the logic
contained in query_addds(), which expects the NS RRset to be owned by
the first name found in the AUTHORITY section of a delegation response.
This may not always be true, for example if wildcard expansion causes an
NSEC record proving QNAME nonexistence to be added to the AUTHORITY
section before the delegation is added to the response.  In such a case,
named incorrectly omits the NSEC record proving nonexistence of QNAME
from the AUTHORITY section.

The same block of code is affected by another flaw: if the same NSEC
record proves nonexistence of both the QNAME and the DS record at the
parent side of the zone cut, this NSEC record will be added to the
AUTHORITY section twice.

Fix by looking for the NS RRset in the entire AUTHORITY section and
adding the NSEC record to the delegation using query_addrrset() (which
handles duplicate RRset detection).

(cherry picked from commit 7a87bf468b)
2021-06-10 10:26:51 +02:00
..
include clean up query correctly if already answered by serve-stale 2021-05-27 12:09:43 -07:00
tests backport of netmgr/taskmgr to 9.16 2021-05-14 12:52:48 +02:00
win32 Use -release instead of -version-info for internal library SONAMEs 2021-01-25 15:28:09 +01:00
client.c Add missing initialisations 2021-05-26 17:19:06 +02:00
hooks.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
interfacemgr.c Refactor the interface handling in the netmgr 2021-05-26 10:09:47 +02:00
Kyuafile regen master 2017-12-29 01:44:18 +00:00
lib.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
listenlist.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
log.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
Makefile.in Remove custom ISC SPNEGO implementation 2021-04-01 10:42:32 +02:00
notify.c change from isc_nmhandle_ref/unref to isc_nmhandle attach/detach 2020-10-01 18:09:35 +02:00
query.c Fix "no DS" proofs for wildcard+CNAME delegations 2021-06-10 10:26:51 +02:00
server.c Change the default ENDS buffer size to 1232 for DNS Flag Day 2020 2020-10-06 09:35:20 +02:00
sortlist.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
stats.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
update.c Reduce nsec3 max iterations to 150 2021-04-29 17:44:46 +10:00
version.c Use -release instead of -version-info for internal library SONAMEs 2021-01-25 15:28:09 +01:00
xfrout.c use a fixedname buffer in dns_message_gettempname() 2021-05-22 07:13:57 +02:00