BIND 10 trac2521, updated. 885821d16691e4179678e4d7f61d550774c1a7a6 [2521] better way of handling empty DHCID RDATA
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon May 6 18:50:43 UTC 2013
The branch, trac2521 has been updated
via 885821d16691e4179678e4d7f61d550774c1a7a6 (commit)
from 225a1e04ba13d2a48bbf3e1f958ce4e3f86aed49 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 885821d16691e4179678e4d7f61d550774c1a7a6
Author: Paul Selkirk <pselkirk at isc.org>
Date: Mon May 6 14:50:35 2013 -0400
[2521] better way of handling empty DHCID RDATA
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/rdata/in_1/dhcid_49.cc | 12 ++++--------
src/lib/dns/tests/rdata_dhcid_unittest.cc | 2 +-
2 files changed, 5 insertions(+), 9 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/rdata/in_1/dhcid_49.cc b/src/lib/dns/rdata/in_1/dhcid_49.cc
index b6b0bf5..2cfa522 100644
--- a/src/lib/dns/rdata/in_1/dhcid_49.cc
+++ b/src/lib/dns/rdata/in_1/dhcid_49.cc
@@ -33,9 +33,10 @@ using namespace isc::util::encode;
void
DHCID::constructFromLexer(MasterLexer& lexer) {
- string digest_txt;
- string digest_part;
+ string digest_txt = lexer.getNextToken(MasterToken::STRING).getString();
+
// Whitespace is allowed within base64 text, so read to the end of input.
+ string digest_part;
while (true) {
const MasterToken& token =
lexer.getNextToken(MasterToken::STRING, true);
@@ -48,10 +49,6 @@ DHCID::constructFromLexer(MasterLexer& lexer) {
}
lexer.ungetToken();
- if (digest_txt.size() == 0) {
- isc_throw(InvalidRdataText, "Missing DHCID RDATA");
- }
-
decodeBase64(digest_txt, digest_);
}
@@ -90,9 +87,8 @@ DHCID::DHCID(const std::string& dhcid_str) {
/// The \c lexer should point to the beginning of valid textual representation
/// of a DHCID RDATA.
///
-/// \throw InvalidRdataText on empty string.
/// \throw BadValue if the text is not valid base-64.
-/// \throw MasterLexer::LexerError General parsing error.
+/// \throw MasterLexer::LexerError General parsing error such as missing field.
///
/// \param lexer A \c MasterLexer object parsing a master file for the
/// RDATA to be created
diff --git a/src/lib/dns/tests/rdata_dhcid_unittest.cc b/src/lib/dns/tests/rdata_dhcid_unittest.cc
index e837056..abcd675 100644
--- a/src/lib/dns/tests/rdata_dhcid_unittest.cc
+++ b/src/lib/dns/tests/rdata_dhcid_unittest.cc
@@ -93,7 +93,7 @@ TEST_F(Rdata_DHCID_Test, fromText) {
TEST_F(Rdata_DHCID_Test, badText) {
// missing digest data
- checkFromText_InvalidText("");
+ checkFromText_LexerError("");
// invalid base64
checkFromText_BadValue("EEeeeeeeEEEeeeeeeGaaahAAAAAAAAHHHHHHHHHHH!=");
More information about the bind10-changes
mailing list