]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1836] throw exception from addDS only when the find result != NXRRSET.
authorJINMEI Tatuya <jinmei@isc.org>
Mon, 26 Mar 2012 17:12:41 +0000 (10:12 -0700)
committerJINMEI Tatuya <jinmei@isc.org>
Mon, 26 Mar 2012 17:12:41 +0000 (10:12 -0700)
Otherwise, queries with DO bit can incorrectly trigger an exception if
the zone is unsigned and queyr result is delegation.

src/bin/auth/query.cc

index 793a64f11052868febfe0074fcfffe80557386c6..f215c04ef86f9972f357a9305f60f796a86c4bd9 100644 (file)
@@ -278,8 +278,10 @@ Query::addDS(ZoneFinder& finder, const Name& dname) {
                ds_context->isNSEC3Signed()) {
         // Add no DS proof with NSEC3 as specified in RFC 5155 Section 7.2.7.
         addClosestEncloserProof(finder, dname, true);
-    } else {
-        // Any other case should be an error
+    } else if (ds_context->code != ZoneFinder::NXRRSET) {
+        // We know this domain should exist, so the result must be NXRRSET.
+        // If not, the zone is broken, so we'll return SERVFAIL by triggering
+        // an exception.
         isc_throw(BadDS, "Unexpected result for DS lookup for delegation");
     }
 }