diff --git a/pdns/backends/gsql/gsqlbackend.cc b/pdns/backends/gsql/gsqlbackend.cc index b1fea82d11acc..f330f0a51234b 100644 --- a/pdns/backends/gsql/gsqlbackend.cc +++ b/pdns/backends/gsql/gsqlbackend.cc @@ -702,7 +702,7 @@ bool GSQLBackend::getTSIGKey(const DNSName& name, DNSName* algorithm, string* co content->clear(); while(d_getTSIGKeyQuery_stmt->hasNextRow()) { d_getTSIGKeyQuery_stmt->nextRow(row); - if(row.size() >= 2 && (!algorithm->countLabels() || *algorithm==row[0])) { + if(row.size() >= 2 && (algorithm->empty() || *algorithm==row[0])) { *algorithm = row[0]; *content = row[1]; } diff --git a/pdns/dnspacket.cc b/pdns/dnspacket.cc index 15719e67b9d71..f26007e3f795a 100644 --- a/pdns/dnspacket.cc +++ b/pdns/dnspacket.cc @@ -633,16 +633,16 @@ bool checkForCorrectTSIG(const DNSPacket* q, UeberBackend* B, DNSName* keyname, } DNSName algoName = trc->d_algoName; // FIXME - if (algoName == DNSName("hmac-md5.sig-alg.reg.int")) - algoName = DNSName("hmac-md5"); + if (algoName == "hmac-md5.sig-alg.reg.int") + algoName = "hmac-md5"; string secret64; if(!B->getTSIGKey(*keyname, &algoName, &secret64)) { L<qdomain.toString()<<"' denied: can't find TSIG key with name '"<toString()<<"' and algorithm '"<d_algoName == DNSName("hmac-md5")) - trc->d_algoName += DNSName("sig-alg.reg.int."); + if (trc->d_algoName == "hmac-md5") + trc->d_algoName += "sig-alg.reg.int"; TSIGHashEnum algo; if(!getTSIGHashEnum(trc->d_algoName, algo)) { diff --git a/pdns/dnssecinfra.cc b/pdns/dnssecinfra.cc index cb7c6be0adccf..33045fef3b944 100644 --- a/pdns/dnssecinfra.cc +++ b/pdns/dnssecinfra.cc @@ -584,19 +584,17 @@ string makeTSIGMessageFromTSIGPacket(const string& opacket, unsigned int tsigOff bool getTSIGHashEnum(const DNSName &algoName, TSIGHashEnum& algoEnum) { - string normalizedName = algoName.toString(); // FIXME: check - - if (normalizedName == "hmac-md5.sig-alg.reg.int") + if (algoName == "hmac-md5.sig-alg.reg.int") algoEnum = TSIG_MD5; - else if (normalizedName == "hmac-sha1") + else if (algoName == "hmac-sha1") algoEnum = TSIG_SHA1; - else if (normalizedName == "hmac-sha224") + else if (algoName == "hmac-sha224") algoEnum = TSIG_SHA224; - else if (normalizedName == "hmac-sha256") + else if (algoName == "hmac-sha256") algoEnum = TSIG_SHA256; - else if (normalizedName == "hmac-sha384") + else if (algoName == "hmac-sha384") algoEnum = TSIG_SHA384; - else if (normalizedName == "hmac-sha512") + else if (algoName == "hmac-sha512") algoEnum = TSIG_SHA512; else { return false; diff --git a/pdns/resolver.cc b/pdns/resolver.cc index ee09d01a8a716..35e9098388498 100644 --- a/pdns/resolver.cc +++ b/pdns/resolver.cc @@ -130,7 +130,7 @@ uint16_t Resolver::sendResolve(const ComboAddress& remote, const ComboAddress& l // cerr<<"Adding TSIG to notification, key name: '"<id);