]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1582] comments and dox
authorJelte Jansen <jelte@isc.org>
Tue, 14 Feb 2012 09:47:26 +0000 (10:47 +0100)
committerJelte Jansen <jelte@isc.org>
Tue, 14 Feb 2012 09:47:26 +0000 (10:47 +0100)
src/bin/auth/query.cc
src/bin/auth/query.h
src/bin/auth/tests/query_unittest.cc

index 43e730edd7e079b1d270bd206463b679c9fce9ee..ac2858983cf87388c03de2df028e4f78f0ac1221 100644 (file)
@@ -248,7 +248,8 @@ Query::addNXRRsetProof(ZoneFinder& finder,
                                boost::const_pointer_cast<AbstractRRset>(
                                    result.closest_proof), dnssec_);
             // For qtype == DS, next_proof could be set
-            // (Do we want to double-check for opt-out here?)
+            // (We could check for opt-out here, but that's really the
+            // responsibility of the datasource)
             if (qtype_ds && result.next_proof != ConstRRsetPtr()) {
                 response_.addRRset(Message::SECTION_AUTHORITY,
                                    boost::const_pointer_cast<AbstractRRset>(
index 14f80b818bf0bfcf7d1577cf480b7caf02952ccd..5a78914ef7f688d99b0b09fe6ab6a5f21b4132d6 100644 (file)
@@ -88,8 +88,9 @@ private:
 
     /// \brief Adds NSEC denial proof for the given NXRRset result
     ///
-    /// NSEC records, if available (signaled by isNSECSigned(), are added
-    /// to the authority section.
+    /// If available, NSEC or NSEC3 records are added to the authority
+    /// section (depending on whether isNSECSigned() or isNSEC3Signed()
+    /// returns true.
     ///
     /// \param finder The ZoneFinder that was used to search for the missing
     ///               data
index d91bc8359fcf3593b1039ee8c382cebc1783d8ed..951fa1977e12621a4e9586391f461ed2f672217d 100644 (file)
@@ -1699,26 +1699,32 @@ TEST_F(QueryTest, nxrrsetMissingNSEC3) {
                        response, true).process(), Query::BadNSEC3);
 }
 
-// Check the exact matching NSEC3 is returned for NXRRSET and qtype DS
 TEST_F(QueryTest, nxrrsetWithNSEC3_ds_exact) {
     mock_finder->setNSEC3Flag(true);
 
+    // This delegation has no DS, but does have a matching NSEC3 record
+    // (See RFC5155 section 7.2.4)
     Query(memory_client, Name("unsigned-delegation.example.com."),
           RRType::DS(), response, true).process();
     responseCheck(response, Rcode::NOERROR(), AA_FLAG, 0, 4, 0, NULL,
                   (string(soa_txt) + string("example.com. 3600 IN RRSIG ") +
                    getCommonRRSIGText("SOA") + "\n" +
                    string(unsigned_delegation_nsec3_txt) + "\n" +
-                   mock_finder->hash_map_[Name("unsigned-delegation.example.com.")] +
+                   mock_finder->
+                        hash_map_[Name("unsigned-delegation.example.com.")] +
                    ".example.com. 3600 IN RRSIG " +
                    getCommonRRSIGText("NSEC3") + "\n").c_str(),
                   NULL, mock_finder->getOrigin());
 }
 
-// Check the signature is present when an NXRRSET is returned and qtype is DS
 TEST_F(QueryTest, nxrrsetWithNSEC3_ds_no_exact) {
     mock_finder->setNSEC3Flag(true);
 
+    // This delegation has no DS, and no directly matching NSEC3 record
+    // So the response should contain closest encloser proof (and the
+    // 'next closer' should have opt-out set, though that is not
+    // actually checked)
+    // (See RFC5155 section 7.2.4)
     Query(memory_client, Name("unsigned-delegation-optout.example.com."),
           RRType::DS(), response, true).process();
     responseCheck(response, Rcode::NOERROR(), AA_FLAG, 0, 6, 0, NULL,
@@ -1729,13 +1735,13 @@ TEST_F(QueryTest, nxrrsetWithNSEC3_ds_no_exact) {
                    ".example.com. 3600 IN RRSIG " +
                    getCommonRRSIGText("NSEC3") + "\n" +
                    string(unsigned_delegation_nsec3_txt) + "\n" +
-                   mock_finder->hash_map_[Name("unsigned-delegation.example.com.")] +
+                   mock_finder->
+                        hash_map_[Name("unsigned-delegation.example.com.")] +
                    ".example.com. 3600 IN RRSIG " +
                    getCommonRRSIGText("NSEC3") + "\n").c_str(),
                   NULL, mock_finder->getOrigin());
 }
 
-
 // The following are tentative tests until we really add tests for the
 // query logic for these cases.  At that point it's probably better to
 // clean them up.