]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check RRset trust in validate_neg_rrset()
authorMatthijs Mekking <matthijs@isc.org>
Tue, 3 Mar 2026 10:43:23 +0000 (11:43 +0100)
committerMichał Kępień <michal@isc.org>
Fri, 13 Mar 2026 12:06:38 +0000 (13:06 +0100)
In many places we only create a validator if the RRset has too low
trust (the RRset is pending validation, or could not be validated
before). This check was missing prior to validating negative response
data.

(cherry picked from commit 6ca67f65cd685cf8699540a852c1e3775bd48d64)

lib/dns/validator.c

index 61e77a8995cf1bb2b2f02da50f934825e81d2416..81fb39ebd126fb091ca7907eeab2f84bd15d7384 100644 (file)
@@ -2804,7 +2804,19 @@ validate_neg_rrset(dns_validator_t *val, dns_name_t *name,
                }
        }
 
+       if (rdataset->type != dns_rdatatype_nsec &&
+           DNS_TRUST_SECURE(rdataset->trust))
+       {
+               /*
+                * The negative response data is already verified.
+                * We skip NSEC records, because they require special
+                * processing in validator_callback_nsec().
+                */
+               return DNS_R_CONTINUE;
+       }
+
        val->nxset = rdataset;
+
        result = create_validator(val, name, rdataset->type, rdataset,
                                  sigrdataset, validator_callback_nsec,
                                  "validate_neg_rrset");
@@ -2914,11 +2926,9 @@ validate_ncache(dns_validator_t *val, bool resume) {
                }
 
                result = validate_neg_rrset(val, name, rdataset, sigrdataset);
-               if (result == DNS_R_CONTINUE) {
-                       continue;
+               if (result != DNS_R_CONTINUE) {
+                       return result;
                }
-
-               return result;
        }
        if (result == ISC_R_NOMORE) {
                result = ISC_R_SUCCESS;