Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
d17500bf
Commit
d17500bf
authored
Jan 30, 2012
by
JINMEI Tatuya
Browse files
[1574b] added check for # of NSEC3 RDATA (only 1 is supported)
parent
74fc8c25
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/datasrc/memory_datasrc.cc
View file @
d17500bf
...
...
@@ -237,11 +237,12 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
isc_throw
(
AddError
,
"multiple RRs of singleton type for "
<<
rrset
->
getName
());
}
// NSEC3PARAM is not a "singleton" per protocol, but this
//
NSEC3/
NSEC3PARAM is not a "singleton" per protocol, but this
// implementation doesn't request it be so at the moment.
if
(
rrset
->
getType
()
==
RRType
::
NSEC3PARAM
()
&&
if
((
rrset
->
getType
()
==
RRType
::
NSEC3
()
||
rrset
->
getType
()
==
RRType
::
NSEC3PARAM
())
&&
rrset
->
getRdataCount
()
>
1
)
{
isc_throw
(
AddError
,
"Multiple NSEC3PARAM RDATA is given for "
isc_throw
(
AddError
,
"Multiple
NSEC3/
NSEC3PARAM RDATA is given for "
<<
rrset
->
getName
()
<<
" which isn't supported"
);
}
...
...
@@ -289,7 +290,7 @@ struct InMemoryZoneFinder::InMemoryZoneFinderImpl {
origin_
.
getLabelCount
()
+
1
))
{
LOG_ERROR
(
logger
,
DATASRC_BAD_NSEC3_NAME
).
arg
(
rrset
->
getName
());
isc_throw
(
AddError
,
"Invalid NSEC3 owner name
(wildcard)
: "
<<
isc_throw
(
AddError
,
"Invalid NSEC3 owner name: "
<<
rrset
->
getName
());
}
}
...
...
src/lib/datasrc/tests/memory_datasrc_unittest.cc
View file @
d17500bf
...
...
@@ -1432,6 +1432,17 @@ TEST_F(InMemoryZoneFinderTest, badNSEC3Name) {
InMemoryZoneFinder
::
AddError
);
}
TEST_F
(
InMemoryZoneFinderTest
,
addMultiNSEC3
)
{
// In this current implementation multiple NSEC3 RDATA isn't supported.
RRsetPtr
nsec3
(
new
RRset
(
Name
(
string
(
apex_hash
)
+
".example.org"
),
RRClass
::
IN
(),
RRType
::
NSEC3
(),
RRTTL
(
300
)));
nsec3
->
addRdata
(
generic
::
NSEC3
(
"1 0 12 aabbccdd 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A"
));
nsec3
->
addRdata
(
generic
::
NSEC3
(
"1 1 1 ddccbbaa 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A"
));
EXPECT_THROW
(
zone_finder_
.
add
(
nsec3
),
InMemoryZoneFinder
::
AddError
);
}
TEST_F
(
InMemoryZoneFinderTest
,
addNSEC3WithRRSIG
)
{
// Adding NSEC3 and its RRSIG
const
string
nsec3_text
=
string
(
apex_hash
)
+
".example.org."
+
...
...
@@ -1521,7 +1532,6 @@ TEST_F(InMemoryZoneFinderTest, multiNSEC3PARAM) {
}
// TODO
// - multiple NSEC3 RDATA
// - existence of NSEC3PARAM
// - add NSEC3PARAM at non origin (should be ignored)
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment