]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1535] use OutOfZone instead of InvalidParameter in findNSEC3()
authorJelte Jansen <jelte@isc.org>
Mon, 2 Apr 2012 09:44:42 +0000 (11:44 +0200)
committerJelte Jansen <jelte@isc.org>
Mon, 2 Apr 2012 09:44:42 +0000 (11:44 +0200)
src/lib/datasrc/memory_datasrc.cc
src/lib/datasrc/tests/memory_datasrc_unittest.cc
src/lib/datasrc/zone.h

index 09d694de91f20f95c17419b00f63b30354917d9b..4cfadfc7414e9474bb1c6d6d9c62fc39131be4fb 100644 (file)
@@ -1350,7 +1350,7 @@ InMemoryZoneFinder::findNSEC3(const Name& name, bool recursive) {
     const NameComparisonResult cmp_result = name.compare(impl_->origin_);
     if (cmp_result.getRelation() != NameComparisonResult::EQUAL &&
         cmp_result.getRelation() != NameComparisonResult::SUBDOMAIN) {
-        isc_throw(InvalidParameter, "findNSEC3 attempt for out-of-zone name: "
+        isc_throw(OutOfZone, "findNSEC3 attempt for out-of-zone name: "
                   << name << ", zone: " << impl_->origin_ << "/"
                   << impl_->zone_class_);
     }
index 925f01fedc4e05628cb28d3382bb091d77f7f321..a19808f93cf01d7dc072bc0505d49fc2a789d034 100644 (file)
@@ -1969,10 +1969,8 @@ TEST_F(InMemoryZoneFinderTest, findNSEC3) {
     EXPECT_EQ(result::SUCCESS, zone_finder_.add(textToRRset(zzz_nsec3_text)));
 
     // Parameter validation: the query name must be in or below the zone
-    EXPECT_THROW(zone_finder_.findNSEC3(Name("example.com"), false),
-                 isc::InvalidParameter);
-    EXPECT_THROW(zone_finder_.findNSEC3(Name("org"), true),
-                 isc::InvalidParameter);
+    EXPECT_THROW(zone_finder_.findNSEC3(Name("example.com"), false), OutOfZone);
+    EXPECT_THROW(zone_finder_.findNSEC3(Name("org"), true), OutOfZone);
 
     // Apex name.  It should have a matching NSEC3.
     {
index 2b8a2a0519eb91bc6fd1bf954fb2ce0a58afb3aa..c68a01c9d17f869918c063271a5eb706c3413bd5 100644 (file)
@@ -601,7 +601,7 @@ public:
     /// algorithm, and salt) from the zone as noted above.  If these
     /// assumptions aren't met, \c DataSourceError exception will be thrown.
     ///
-    /// \exception InvalidParameter name is not a subdomain of the zone origin
+    /// \exception OutOfZone name is not a subdomain of the zone origin
     /// \exception DataSourceError Low-level or internal datasource errors
     /// happened, or the zone isn't properly signed with NSEC3
     /// (NSEC3 parameters cannot be found, no NSEC3s are available, etc).