Browse Source

[1138] {encode,decode}Hex() was erroneously used instead of
{encode,decode}Base64()

Dima Volodin 13 years ago
parent
commit
ff32908279
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/lib/dns/rdata/in_1/dhcid_49.cc

+ 3 - 3
src/lib/dns/rdata/in_1/dhcid_49.cc

@@ -20,7 +20,7 @@
 #include <exceptions/exceptions.h>
 
 #include <util/buffer.h>
-#include <util/encode/hex.h>
+#include <util/encode/base64.h>
 #include <dns/exceptions.h>
 #include <dns/messagerenderer.h>
 #include <dns/rdata.h>
@@ -52,7 +52,7 @@ DHCID::DHCID(const string& dhcid_str) {
     stringbuf digestbuf;
 
     iss >> &digestbuf;
-    isc::util::encode::decodeHex(digestbuf.str(), digest_);
+    isc::util::encode::decodeBase64(digestbuf.str(), digest_);
 
     // RFC4701 states DNS software should consider the RDATA section to
     // be opaque, but there must be at least three bytes in the data:
@@ -112,7 +112,7 @@ DHCID::toWire(AbstractMessageRenderer& renderer) const {
 /// \return A string representation of \c DHCID.
 string
 DHCID::toText() const {
-    return (isc::util::encode::encodeHex(digest_));
+    return (isc::util::encode::encodeBase64(digest_));
 }
 
 /// \brief Compare two instances of \c DHCID RDATA.