Commit 6a7aa9cb authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2762] Allow short names for HMAC-MD5

parent 9273dca3
......@@ -143,6 +143,10 @@ TEST_F(Rdata_TSIG_Test, fromText) {
// multi-line rdata
checkFromText_None("hmac-md5.sig-alg.reg.int. ( 1286779327 300 \n"
"0 16020 BADKEY 0 )");
// short-form HMAC-MD5 name
const any::TSIG tsig6("hmac-md5 1286779327 300 0 16020 BADKEY 0");
EXPECT_EQ(0, tsig1.compare(rdata_tsig));
};
TEST_F(Rdata_TSIG_Test, badText) {
......
......@@ -31,9 +31,16 @@ using namespace isc::cryptolink;
namespace isc {
namespace dns {
namespace {
bool
isHMACMD5(const isc::dns::Name& name) {
static const Name md5_short_name("hmac-md5");
return ((name == TSIGKey::HMACMD5_NAME()) ||
(name == md5_short_name));
}
HashAlgorithm
convertAlgorithmName(const isc::dns::Name& name) {
if (name == TSIGKey::HMACMD5_NAME()) {
if (isHMACMD5(name)) {
return (isc::cryptolink::MD5);
}
if (name == TSIGKey::HMACSHA1_NAME()) {
......
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