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
Sebastian Schrader
Kea
Commits
870cc9bc
Commit
870cc9bc
authored
Apr 09, 2013
by
Paul Selkirk
Browse files
[2521] enabled previously disabled rrsig test
also changed createFromLexer from static function to private method
parent
fdb992f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/lib/dns/rdata/generic/rrsig_46.cc
View file @
870cc9bc
...
...
@@ -74,9 +74,8 @@ struct RRSIGImpl {
const
vector
<
uint8_t
>
signature_
;
};
namespace
{
// helper function for string and lexer constructors
RRSIGImpl
*
createFromLexer
(
MasterLexer
&
lexer
,
const
Name
*
origin
)
void
RRSIG
::
createFromLexer
(
MasterLexer
&
lexer
,
const
Name
*
origin
)
{
string
covered_txt
,
expire_txt
,
inception_txt
,
signature_txt
;
unsigned
int
algorithm
,
labels
,
tag
;
...
...
@@ -108,10 +107,9 @@ RRSIGImpl* createFromLexer(MasterLexer& lexer, const Name* origin)
vector
<
uint8_t
>
signature
;
decodeBase64
(
signature_txt
,
signature
);
return
new
RRSIGImpl
(
RRType
(
covered_txt
),
algorithm
,
labels
,
originalttl
,
timeexpire
,
timeinception
,
static_cast
<
uint16_t
>
(
tag
),
signer
,
signature
);
}
impl_
=
new
RRSIGImpl
(
RRType
(
covered_txt
),
algorithm
,
labels
,
originalttl
,
timeexpire
,
timeinception
,
static_cast
<
uint16_t
>
(
tag
),
signer
,
signature
);
}
/// \brief Constructor from string.
...
...
@@ -138,7 +136,7 @@ RRSIG::RRSIG(const std::string& rrsig_str) :
MasterLexer
lexer
;
lexer
.
pushSource
(
iss
);
impl_
=
createFromLexer
(
lexer
,
NULL
);
createFromLexer
(
lexer
,
NULL
);
if
(
lexer
.
getNextToken
().
getType
()
!=
MasterToken
::
END_OF_FILE
)
{
isc_throw
(
InvalidRdataText
,
"extra input text for RRSIG: "
...
...
@@ -173,7 +171,7 @@ RRSIG::RRSIG(MasterLexer& lexer, const Name* origin,
MasterLoader
::
Options
,
MasterLoaderCallbacks
&
)
:
impl_
(
NULL
)
{
impl_
=
createFromLexer
(
lexer
,
origin
);
createFromLexer
(
lexer
,
origin
);
}
RRSIG
::
RRSIG
(
InputBuffer
&
buffer
,
size_t
rdata_len
)
{
...
...
src/lib/dns/rdata/generic/rrsig_46.h
View file @
870cc9bc
// Copyright (C) 2010 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010
-2013
Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
...
...
@@ -42,6 +42,9 @@ public:
// specialized methods
const
RRType
&
typeCovered
()
const
;
private:
// helper function for string and lexer constructors
void
createFromLexer
(
MasterLexer
&
lexer
,
const
Name
*
origin
);
RRSIGImpl
*
impl_
;
};
...
...
src/lib/dns/tests/rdata_rrsig_unittest.cc
View file @
870cc9bc
...
...
@@ -99,13 +99,10 @@ TEST_F(Rdata_RRSIG_Test, badText) {
"20100223214617 20100222214617 8496 isc.org. "
"EEeeeeeeEEEeeeeeeGaaahAAAAAAAAHHHHHHHHHHH!="
),
BadValue
);
}
TEST_F
(
Rdata_RRSIG_Test
,
DISABLED_badText
)
{
// this currently fails
// no space between the tag and signer
EXPECT_THROW
(
generic
::
RRSIG
(
"A 5 4 43200 20100223214617 20100222214617 "
"8496isc.org. ofc="
),
InvalidRdataText
);
EXPECT_THROW
(
const
generic
::
RRSIG
sig
(
"A 5 4 43200 20100223214617 20100222214617 "
"8496isc.org. ofc="
),
InvalidRdataText
);
}
TEST_F
(
Rdata_RRSIG_Test
,
createFromLexer
)
{
...
...
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