]> git.ipfire.org Git - thirdparty/bind9.git/commit
Prepend qpkey with denial byte
authorMatthijs Mekking <matthijs@isc.org>
Fri, 25 Apr 2025 15:21:16 +0000 (17:21 +0200)
committerMatthijs Mekking <matthijs@isc.org>
Thu, 10 Jul 2025 13:52:59 +0000 (13:52 +0000)
commit16a1c5a623d4d93c671da391ab7aca1aefff91e7
tree7984db63d7d577f8a9cd14ea702a1279c140e01b
parent658698896a6955efd4f7b3647c5ef8aa916325f9
Prepend qpkey with denial byte

In preparation to merge the three qp tries (tree, nsec, nsec3) into
one, add the piece of information into the qpkey. This is the most
significant bit of information, so prepend the denial type to the qpkey.

This means we need to pass on the denial type when constructing the
qpkey from a name, or doing a lookup.

Reuse the the DNS_DB_NSEC_* values. Most qp tries in the code we just
pass on 0 (nta, rpz, zt, etc.), because there is no need for denial of
existence, but for qpzone and qpcache we must pass the right value.

Change the code, so that node->nsec no longer can have the value
DNS_DB_NSEC_HAS_NSEC, instead track this in a new attribute 'havensec'.

Since we use node->nsec to convert names to keys, the value MUST be set
before inserting the node into the qp-trie.

Update the fuzzing and unit tests accordingly. This only adds a few
extra test cases, more are needed.

In the qp_test.c we can remove test code for empty keys as this is
no longer possible.
19 files changed:
fuzz/dns_qp.c
fuzz/dns_qpkey_name.c
lib/dns/forward.c
lib/dns/include/dns/db.h
lib/dns/include/dns/qp.h
lib/dns/keytable.c
lib/dns/nametree.c
lib/dns/nta.c
lib/dns/qp.c
lib/dns/qpcache.c
lib/dns/qpzone.c
lib/dns/rpz.c
lib/dns/zt.c
tests/bench/load-names.c
tests/bench/qp-dump.c
tests/bench/qplookups.c
tests/bench/qpmulti.c
tests/dns/qp_test.c
tests/libtest/qp.c