2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 05:27:55 +00:00

[1535] use OutOfZone instead of InvalidParameter in findNSEC3()

This commit is contained in:
Jelte Jansen 2012-04-02 11:44:42 +02:00
parent 65b293e599
commit 952cb2ceeb
3 changed files with 4 additions and 6 deletions

View File

@ -1350,7 +1350,7 @@ InMemoryZoneFinder::findNSEC3(const Name& name, bool recursive) {
const NameComparisonResult cmp_result = name.compare(impl_->origin_); const NameComparisonResult cmp_result = name.compare(impl_->origin_);
if (cmp_result.getRelation() != NameComparisonResult::EQUAL && if (cmp_result.getRelation() != NameComparisonResult::EQUAL &&
cmp_result.getRelation() != NameComparisonResult::SUBDOMAIN) { 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_ << "/" << name << ", zone: " << impl_->origin_ << "/"
<< impl_->zone_class_); << impl_->zone_class_);
} }

View File

@ -1969,10 +1969,8 @@ TEST_F(InMemoryZoneFinderTest, findNSEC3) {
EXPECT_EQ(result::SUCCESS, zone_finder_.add(textToRRset(zzz_nsec3_text))); EXPECT_EQ(result::SUCCESS, zone_finder_.add(textToRRset(zzz_nsec3_text)));
// Parameter validation: the query name must be in or below the zone // Parameter validation: the query name must be in or below the zone
EXPECT_THROW(zone_finder_.findNSEC3(Name("example.com"), false), EXPECT_THROW(zone_finder_.findNSEC3(Name("example.com"), false), OutOfZone);
isc::InvalidParameter); EXPECT_THROW(zone_finder_.findNSEC3(Name("org"), true), OutOfZone);
EXPECT_THROW(zone_finder_.findNSEC3(Name("org"), true),
isc::InvalidParameter);
// Apex name. It should have a matching NSEC3. // Apex name. It should have a matching NSEC3.
{ {

View File

@ -601,7 +601,7 @@ public:
/// algorithm, and salt) from the zone as noted above. If these /// algorithm, and salt) from the zone as noted above. If these
/// assumptions aren't met, \c DataSourceError exception will be thrown. /// 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 /// \exception DataSourceError Low-level or internal datasource errors
/// happened, or the zone isn't properly signed with NSEC3 /// happened, or the zone isn't properly signed with NSEC3
/// (NSEC3 parameters cannot be found, no NSEC3s are available, etc). /// (NSEC3 parameters cannot be found, no NSEC3s are available, etc).