Created
April 26, 2013 11:42
-
-
Save Habbie/5466742 to your computer and use it in GitHub Desktop.
Patch as submitted to pdns-dev
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: pdns/dbdnsseckeeper.cc | |
=================================================================== | |
--- pdns/dbdnsseckeeper.cc (revision 2607) | |
+++ pdns/dbdnsseckeeper.cc (working copy) | |
@@ -342,16 +342,19 @@ | |
return addKey(name, true, algorithm); | |
} | |
-bool DNSSECKeeper::getPreRRSIGs(DNSBackend& db, const std::string& signer, const std::string& qname, const QType& qtype, | |
+bool DNSSECKeeper::getPreRRSIGs(DNSBackend& db, const std::string& signer, const std::string& qname, | |
+ const std::string& wildcardname, const QType& qtype, | |
DNSPacketWriter::Place signPlace, vector<DNSResourceRecord>& rrsigs) | |
{ | |
- // cerr<<"Doing DB lookup for precomputed RRSIGs for '"<<qname<<"'"<<endl; | |
- db.lookup(QType(QType::RRSIG), qname); | |
+ // cerr<<"Doing DB lookup for precomputed RRSIGs for '"<<(wildcardname.empty() ? qname : wildcardname)<<"'"<<endl; | |
+ db.lookup(QType(QType::RRSIG), wildcardname.empty() ? qname : wildcardname); | |
DNSResourceRecord rr; | |
while(db.get(rr)) { | |
// cerr<<"Considering for '"<<qtype.getName()<<"' RRSIG '"<<rr.content<<"'\n"; | |
if(boost::starts_with(rr.content, qtype.getName()+" ")) { | |
// cerr<<"Got it"<<endl; | |
+ if (wildcardname.length()) | |
+ rr.qname = qname; | |
rr.d_place = (DNSResourceRecord::Place)signPlace; | |
rrsigs.push_back(rr); | |
} | |
Index: pdns/dnsseckeeper.hh | |
=================================================================== | |
--- pdns/dnsseckeeper.hh (revision 2607) | |
+++ pdns/dnsseckeeper.hh (working copy) | |
@@ -81,7 +81,7 @@ | |
void setNSEC3PARAM(const std::string& zname, const NSEC3PARAMRecordContent& n3p, const bool& narrow=false); | |
void unsetNSEC3PARAM(const std::string& zname); | |
void clearCaches(const std::string& name); | |
- bool getPreRRSIGs(DNSBackend& db, const std::string& signer, const std::string& qname, const QType& qtype, DNSPacketWriter::Place, vector<DNSResourceRecord>& rrsigs); | |
+ bool getPreRRSIGs(DNSBackend& db, const std::string& signer, const std::string& qname, const std::string& wildcardname, const QType& qtype, DNSPacketWriter::Place, vector<DNSResourceRecord>& rrsigs); | |
bool isPresigned(const std::string& zname); | |
void setPresigned(const std::string& zname); | |
void unsetPresigned(const std::string& zname); | |
Index: pdns/dnssecsigner.cc | |
=================================================================== | |
--- pdns/dnssecsigner.cc (revision 2607) | |
+++ pdns/dnssecsigner.cc (working copy) | |
@@ -84,7 +84,7 @@ | |
vector<RRSIGRecordContent> rrcs; | |
if(dk.isPresigned(signer)) { | |
//cerr<<"Doing presignatures"<<endl; | |
- dk.getPreRRSIGs(db, signer, signQName, QType(signQType), signPlace, outsigned); // does it all | |
+ dk.getPreRRSIGs(db, signer, signQName, wildcardname, QType(signQType), signPlace, outsigned); // does it all | |
} | |
else { | |
if(getRRSIGsForRRSET(dk, signer, wildcardname.empty() ? signQName : wildcardname, signQType, signTTL, toSign, rrcs, signQType == QType::DNSKEY) < 0) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment