Browse Source

[1177] Don't throw on missing NSEC

Because it can't be distinguished from unsigned zone for now. Should be
temporary solution for now.
Michal 'vorner' Vaner 13 years ago
parent
commit
5cf1b7ab58
2 changed files with 17 additions and 0 deletions
  1. 7 0
      src/lib/datasrc/database.cc
  2. 10 0
      src/lib/datasrc/tests/database_unittest.cc

+ 7 - 0
src/lib/datasrc/database.cc

@@ -366,10 +366,17 @@ DatabaseClient::Finder::findNSECCover(const Name& name) {
         } else {
             // The previous doesn't contain NSEC.
             // Badly signed zone or a bug?
+
+            // FIXME: Currently, if the zone is not signed, we could get
+            // here. In that case we can't really throw, but for now, we can't
+            // recognize it. So we don't throw at all, enable it once
+            // we have a is_signed flag or something.
+#if 0
             isc_throw(DataSourceError, "No NSEC in " +
                       coverName.toText() + ", but it was "
                       "returned as previous - "
                       "accessor error? Badly signed zone?");
+#endif
         }
     }
     catch (const isc::NotImplemented&) {

+ 10 - 0
src/lib/datasrc/tests/database_unittest.cc

@@ -2368,9 +2368,19 @@ TYPED_TEST(DatabaseClientTest, invalidRdata) {
 TEST_F(MockDatabaseClientTest, missingNSEC) {
     shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
 
+    /*
+     * FIXME: For now, we can't really distinguish this bogus input
+     * from not-signed zone so we can't throw. But once we can,
+     * enable the original test.
+     */
+#if 0
     EXPECT_THROW(finder->find(Name("badnsec2.example.org."), RRType::A(), NULL,
                               ZoneFinder::FIND_DNSSEC),
                  DataSourceError);
+#endif
+    doFindTest(*finder, Name("badnsec2.example.org."), RRType::A(),
+               RRType::A(), this->rrttl_, ZoneFinder::NXDOMAIN,
+               this->expected_rdatas_, this->expected_sig_rdatas_);
 }
 
 TEST_F(MockDatabaseClientTest, badName) {