This part of code still deserves better review.
It's a bit surprising that our current tests didn't discover it.
We incorrectly answered with AD in some cases, e.g. ntp.pool.org AAAA.
ret = edns_put(answer);
}
+ /* AD: negative answers need more handling. */
+ if (kr_response_classify(answer) != PKT_NOERROR && last) {
+ const bool OK = (last->flags & QUERY_DNSSEC_WANT)
+ && !(last->flags & (QUERY_DNSSEC_BOGUS | QUERY_DNSSEC_INSECURE));
+ if (!OK) {
+ secure = false;
+ }
+ }
/* Clear AD if not secure. ATM answer has AD=1 if requested secured answer. */
if (!secure || state != KR_STATE_DONE
|| knot_pkt_qtype(answer) == KNOT_RRTYPE_RRSIG) {
-Subproject commit b985a91d0e5f2f30d430d3fb4823f20f78661c70
+Subproject commit 743603e0ccd40fa1d0a97dfbc1e9ae963dda89f6