]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1614] don't use masterLoad() for bad RRSIG data with mixed cover types;
authorJINMEI Tatuya <jinmei@isc.org>
Wed, 25 Jan 2012 22:52:22 +0000 (14:52 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Wed, 25 Jan 2012 22:52:22 +0000 (14:52 -0800)
the change introduced in this branch breaks the assumption of the
callback function used in the test code.

src/lib/datasrc/tests/memory_datasrc_unittest.cc

index 00587a816d89cead5974e06666f57f6089977861..6c1f8376dc06caadeb8650d375ed36d000161f34 100644 (file)
@@ -1269,9 +1269,14 @@ TEST_F(InMemoryZoneFinderTest, addbadRRsig) {
 
     // RRSIG with mixed covered types
     zone_finder_.add(rr_a_);    // make sure the covered name exists
-    EXPECT_THROW(zone_finder_.add(textToRRset(string(rrsig_a_txt) +
-                                              string(rrsig_ns_txt))),
-                 InMemoryZoneFinder::AddError);
+    // textToRRset() doesn't work as intended for this pathological case,
+    // so we need to construct the RRset by hand.
+    RRsetPtr rrset(new RRset(origin_, class_, RRType::RRSIG(), RRTTL(300)));
+    rrset->addRdata(generic::RRSIG("A 5 3 3600 20000101000000 20000201000000 "
+                                   "12345 example.org. FAKEFAKEFAKE"));
+    rrset->addRdata(generic::RRSIG("NS 5 3 3600 20000101000000 20000201000000 "
+                                   "54321 example.org. FAKEFAKEFAKEFAKE"));
+    EXPECT_THROW(zone_finder_.add(rrset), InMemoryZoneFinder::AddError);
 
     // An attempt of overriding an existing RRSIG.  The current implementation
     // prohibits that.