From: bert hubert Date: Thu, 5 Nov 2015 08:21:11 +0000 (+0100) Subject: was using DNSName() to get DNSName(".") - we should make some faster way of getting... X-Git-Tag: dnsdist-1.0.0-alpha1~187^2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=822a0b4e4e7fa634a9f681a300bce61f610beab8;p=pdns was using DNSName() to get DNSName(".") - we should make some faster way of getting a root DNSName! --- diff --git a/pdns/dnssecinfra.cc b/pdns/dnssecinfra.cc index 3224648b7..4b9e0dc33 100644 --- a/pdns/dnssecinfra.cc +++ b/pdns/dnssecinfra.cc @@ -298,7 +298,7 @@ DNSCryptoKeyEngine* DNSCryptoKeyEngine::makeFromPEMString(DNSKEYRecordContent& d bool sharedDNSSECCompare(const shared_ptr& a, const shared_ptr& b) { - return a->serialize(DNSName(), true, true) < b->serialize(DNSName(), true, true); + return a->serialize(DNSName("."), true, true) < b->serialize(DNSName("."), true, true); } string getMessageForRRSET(const DNSName& qname, const RRSIGRecordContent& rrc, vector >& signRecords) @@ -306,18 +306,18 @@ string getMessageForRRSET(const DNSName& qname, const RRSIGRecordContent& rrc, v sort(signRecords.begin(), signRecords.end(), sharedDNSSECCompare); string toHash; - toHash.append(const_cast(rrc).serialize(DNSName(), true, true)); + toHash.append(const_cast(rrc).serialize(DNSName("."), true, true)); toHash.resize(toHash.size() - rrc.d_signature.length()); // chop off the end, don't sign the signature! BOOST_FOREACH(shared_ptr& add, signRecords) { - toHash.append(qname.toDNSString()); // FIXME400 tolower? + toHash.append(qname.toDNSString()); // FIXME400 tolower? uint16_t tmp=htons(rrc.d_type); toHash.append((char*)&tmp, 2); tmp=htons(1); // class toHash.append((char*)&tmp, 2); uint32_t ttl=htonl(rrc.d_originalttl); toHash.append((char*)&ttl, 4); - string rdata=add->serialize(DNSName(), true, true); + string rdata=add->serialize(DNSName("."), true, true); tmp=htons(rdata.length()); toHash.append((char*)&tmp, 2); toHash.append(rdata);