Commit a5fec871 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[1638] corrected toText() output of NSEC3PARAM with empty salt

parent 95b8b13f
......@@ -145,9 +145,9 @@ string
NSEC3PARAM::toText() const {
using namespace boost;
return (lexical_cast<string>(static_cast<int>(impl_->hashalg_)) +
" " + lexical_cast<string>(static_cast<int>(impl_->flags_)) +
" " + lexical_cast<string>(static_cast<int>(impl_->iterations_)) +
" " + encodeHex(impl_->salt_));
" " + lexical_cast<string>(static_cast<int>(impl_->flags_)) +
" " + lexical_cast<string>(static_cast<int>(impl_->iterations_)) +
" " + (impl_->salt_.empty() ? "-" : encodeHex(impl_->salt_)));
}
void
......
......@@ -135,14 +135,6 @@ TYPED_TEST(NSEC3PARAMLikeTest, fromText) {
this->getCommonText()).getSalt().size());
}
TYPED_TEST(NSEC3PARAMLikeTest, DISABLED_toText) {
// normal case
EXPECT_EQ(this->salt_txt, this->fromText(this->salt_txt).toText());
// empty salt case
EXPECT_EQ(this->nosalt_txt, this->fromText(this->nosalt_txt).toText());
}
TYPED_TEST(NSEC3PARAMLikeTest, badText) {
// Bad salt hex
EXPECT_THROW(this->fromText("1 1 1 SPORK0" + this->getCommonText()),
......@@ -181,6 +173,14 @@ TYPED_TEST(NSEC3PARAMLikeTest, badText) {
InvalidRdataText);
}
TYPED_TEST(NSEC3PARAMLikeTest, toText) {
// normal case
EXPECT_EQ(this->salt_txt, this->fromText(this->salt_txt).toText());
// empty salt case
EXPECT_EQ(this->nosalt_txt, this->fromText(this->nosalt_txt).toText());
}
TYPED_TEST(NSEC3PARAMLikeTest, DISABLED_createFromWire) {
// Normal case
EXPECT_EQ(0, this->fromText(this->salt_txt).compare(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment