|
@@ -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
|