Skip to content

Commit

Permalink
Merge branch 'nsec3optout' of github.com:mind04/pdns into mind04-nsec…
Browse files Browse the repository at this point in the history
…3optout
  • Loading branch information
Peter van Dijk committed May 9, 2013
2 parents fc7d9db + b8adb30 commit 04b4bf6
Show file tree
Hide file tree
Showing 91 changed files with 474 additions and 269 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Expand Up @@ -19,12 +19,16 @@ script:
- ./start-test-stop 5300 bind-dnssec-presigned - ./start-test-stop 5300 bind-dnssec-presigned
- ./start-test-stop 5300 bind-dnssec-nsec3 - ./start-test-stop 5300 bind-dnssec-nsec3
- ./start-test-stop 5300 bind-dnssec-nsec3-presigned - ./start-test-stop 5300 bind-dnssec-nsec3-presigned
- ./start-test-stop 5300 bind-dnssec-nsec3-optout
- ./start-test-stop 5300 bind-dnssec-nsec3-optout-presigned
- ./start-test-stop 5300 gmysql-nodnssec - ./start-test-stop 5300 gmysql-nodnssec
- ./start-test-stop 5300 gmysql-nodnssec-presigned - ./start-test-stop 5300 gmysql-nodnssec-presigned
- ./start-test-stop 5300 gmysql - ./start-test-stop 5300 gmysql
- ./start-test-stop 5300 gmysql-presigned - ./start-test-stop 5300 gmysql-presigned
- ./start-test-stop 5300 gmysql-nsec3 - ./start-test-stop 5300 gmysql-nsec3
- ./start-test-stop 5300 gmysql-nsec3-presigned - ./start-test-stop 5300 gmysql-nsec3-presigned
- ./start-test-stop 5300 gmysql-nsec3-optout
- ./start-test-stop 5300 gmysql-nsec3-optout-presigned
- ./start-test-stop 5300 gmysql-nsec3-narrow - ./start-test-stop 5300 gmysql-nsec3-narrow
notifications: notifications:
irc: irc:
Expand Down
6 changes: 3 additions & 3 deletions pdns/backends/bind/bindbackend2.cc
Expand Up @@ -969,7 +969,7 @@ bool Bind2Backend::getBeforeAndAfterNamesAbsolute(uint32_t id, const std::string
// cerr<<"Hash: "<<bdr.nsec3hash<<"\t"<< (lqname < bdr.nsec3hash) <<endl; // cerr<<"Hash: "<<bdr.nsec3hash<<"\t"<< (lqname < bdr.nsec3hash) <<endl;
// } // }


records_by_hashindex_t::const_iterator iter = hashindex.lower_bound(lqname); records_by_hashindex_t::const_iterator iter = hashindex.upper_bound(lqname);


if(iter != hashindex.begin() && (iter == hashindex.end() || iter->nsec3hash > lqname)) if(iter != hashindex.begin() && (iter == hashindex.end() || iter->nsec3hash > lqname))
{ {
Expand All @@ -982,7 +982,7 @@ bool Bind2Backend::getBeforeAndAfterNamesAbsolute(uint32_t id, const std::string
} }


bool wraponce = false; bool wraponce = false;
while(iter == hashindex.end() || !(iter->auth) || iter->nsec3hash.empty()) while(iter == hashindex.end() || (!iter->auth && !(iter->qtype == QType::NS && !pdns_iequals(iter->qname, auth) && !ns3pr.d_flags)) || iter->nsec3hash.empty())
{ {
iter--; iter--;
if(iter == hashindex.begin()) { if(iter == hashindex.begin()) {
Expand All @@ -1009,7 +1009,7 @@ bool Bind2Backend::getBeforeAndAfterNamesAbsolute(uint32_t id, const std::string
iter = hashindex.begin(); iter = hashindex.begin();
} }


while(!(iter->auth) || iter->nsec3hash.empty()) while((!iter->auth && !(iter->qtype == QType::NS && !pdns_iequals(iter->qname, auth) && !ns3pr.d_flags)) || iter->nsec3hash.empty())
{ {
iter++; iter++;
if(iter == hashindex.end()) if(iter == hashindex.end())
Expand Down
17 changes: 7 additions & 10 deletions pdns/packethandler.cc
Expand Up @@ -459,9 +459,9 @@ void emitNSEC3(DNSBackend& B, const NSEC3PARAMRecordContent& ns3prc, const SOADa


DNSResourceRecord rr; DNSResourceRecord rr;
if(!unhashed.empty()) { if(!unhashed.empty()) {
B.lookup(QType(QType::ANY), unhashed); B.lookup(QType(QType::ANY), unhashed, NULL, sd.domain_id);
while(B.get(rr)) { while(B.get(rr)) {
if(rr.domain_id == sd.domain_id && rr.qtype.getCode()) // skip out of zone data and empty non-terminals if(rr.qtype.getCode() && (rr.qtype.getCode() == QType::NS || rr.auth)) // skip empty non-terminals
n3rc.d_set.insert(rr.qtype.getCode()); n3rc.d_set.insert(rr.qtype.getCode());
} }


Expand All @@ -471,7 +471,7 @@ void emitNSEC3(DNSBackend& B, const NSEC3PARAMRecordContent& ns3prc, const SOADa
} }
} }


if (n3rc.d_set.size()) if (n3rc.d_set.size() && !(n3rc.d_set.size() == 1 && n3rc.d_set.count(QType::NS)))
n3rc.d_set.insert(QType::RRSIG); n3rc.d_set.insert(QType::RRSIG);


n3rc.d_nexthash=end; n3rc.d_nexthash=end;
Expand Down Expand Up @@ -571,7 +571,7 @@ bool getNSEC3Hashes(bool narrow, DNSBackend* db, int id, const std::string& hash


void PacketHandler::addNSEC3(DNSPacket *p, DNSPacket *r, const string& target, const string& wildcard, const string& auth, const NSEC3PARAMRecordContent& ns3rc, bool narrow, int mode) void PacketHandler::addNSEC3(DNSPacket *p, DNSPacket *r, const string& target, const string& wildcard, const string& auth, const NSEC3PARAMRecordContent& ns3rc, bool narrow, int mode)
{ {
// L<<"mode="<<mode<<" target="<<target<<" wildcard="<<wildcard<<" auth="<<auth<<endl; DLOG(L<<"mode="<<mode<<" target="<<target<<" wildcard="<<wildcard<<" auth="<<auth<<endl);


SOAData sd; SOAData sd;
sd.db = (DNSBackend*)-1; sd.db = (DNSBackend*)-1;
Expand Down Expand Up @@ -604,7 +604,7 @@ void PacketHandler::addNSEC3(DNSPacket *p, DNSPacket *r, const string& target, c
unhashed=(mode == 0 || mode == 5) ? target : closest; unhashed=(mode == 0 || mode == 5) ? target : closest;


hashed=hashQNameWithSalt(ns3rc.d_iterations, ns3rc.d_salt, unhashed); hashed=hashQNameWithSalt(ns3rc.d_iterations, ns3rc.d_salt, unhashed);
// L<<"1 hash: "<<toBase32Hex(hashed)<<" "<<unhashed<<endl; DLOG(L<<"1 hash: "<<toBase32Hex(hashed)<<" "<<unhashed<<endl);


getNSEC3Hashes(narrow, sd.db, sd.domain_id, hashed, false, unhashed, before, after); getNSEC3Hashes(narrow, sd.db, sd.domain_id, hashed, false, unhashed, before, after);
DLOG(L<<"Done calling for matching, hashed: '"<<toBase32Hex(hashed)<<"' before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"'"<<endl); DLOG(L<<"Done calling for matching, hashed: '"<<toBase32Hex(hashed)<<"' before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"'"<<endl);
Expand All @@ -620,7 +620,7 @@ void PacketHandler::addNSEC3(DNSPacket *p, DNSPacket *r, const string& target, c
while( chopOff( next ) && !pdns_iequals(next, closest)); while( chopOff( next ) && !pdns_iequals(next, closest));


hashed=hashQNameWithSalt(ns3rc.d_iterations, ns3rc.d_salt, unhashed); hashed=hashQNameWithSalt(ns3rc.d_iterations, ns3rc.d_salt, unhashed);
// L<<"2 hash: "<<toBase32Hex(hashed)<<" "<<unhashed<<endl; DLOG(L<<"2 hash: "<<toBase32Hex(hashed)<<" "<<unhashed<<endl);


getNSEC3Hashes(narrow, sd.db,sd.domain_id, hashed, true, unhashed, before, after); getNSEC3Hashes(narrow, sd.db,sd.domain_id, hashed, true, unhashed, before, after);
DLOG(L<<"Done calling for covering, hashed: '"<<toBase32Hex(hashed)<<"' before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"'"<<endl); DLOG(L<<"Done calling for covering, hashed: '"<<toBase32Hex(hashed)<<"' before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"'"<<endl);
Expand All @@ -632,7 +632,7 @@ void PacketHandler::addNSEC3(DNSPacket *p, DNSPacket *r, const string& target, c
unhashed=dotConcat("*", closest); unhashed=dotConcat("*", closest);


hashed=hashQNameWithSalt(ns3rc.d_iterations, ns3rc.d_salt, unhashed); hashed=hashQNameWithSalt(ns3rc.d_iterations, ns3rc.d_salt, unhashed);
// L<<"3 hash: "<<toBase32Hex(hashed)<<" "<<unhashed<<endl; DLOG(L<<"3 hash: "<<toBase32Hex(hashed)<<" "<<unhashed<<endl);


getNSEC3Hashes(narrow, sd.db, sd.domain_id, hashed, (mode != 2), unhashed, before, after); getNSEC3Hashes(narrow, sd.db, sd.domain_id, hashed, (mode != 2), unhashed, before, after);
DLOG(L<<"Done calling for '*', hashed: '"<<toBase32Hex(hashed)<<"' before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"'"<<endl); DLOG(L<<"Done calling for '*', hashed: '"<<toBase32Hex(hashed)<<"' before='"<<toBase32Hex(before)<<"', after='"<<toBase32Hex(after)<<"'"<<endl);
Expand Down Expand Up @@ -1010,7 +1010,6 @@ bool PacketHandler::addDSforNS(DNSPacket* p, DNSPacket* r, SOAData& sd, const st
while(B.get(rr)) { while(B.get(rr)) {
gotOne=true; gotOne=true;
rr.d_place = DNSResourceRecord::AUTHORITY; rr.d_place = DNSResourceRecord::AUTHORITY;
rr.auth=true; // please sign it!
r->addRecord(rr); r->addRecord(rr);
} }
return gotOne; return gotOne;
Expand Down Expand Up @@ -1269,8 +1268,6 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse)
if (p->qtype.getCode() == QType::ANY && rr.qtype.getCode() == QType::RRSIG) // RRSIGS are added later any way. if (p->qtype.getCode() == QType::ANY && rr.qtype.getCode() == QType::RRSIG) // RRSIGS are added later any way.
continue; //TODO: this actually means addRRSig should check if the RRSig is already there. continue; //TODO: this actually means addRRSig should check if the RRSig is already there.


if(rr.qtype.getCode() == QType::DS)
rr.auth = 1;
// cerr<<"Auth: "<<rr.auth<<", "<<(rr.qtype == p->qtype)<<", "<<rr.qtype.getName()<<endl; // cerr<<"Auth: "<<rr.auth<<", "<<(rr.qtype == p->qtype)<<", "<<rr.qtype.getName()<<endl;
if((p->qtype.getCode() == QType::ANY || rr.qtype == p->qtype) && rr.auth) if((p->qtype.getCode() == QType::ANY || rr.qtype == p->qtype) && rr.auth)
weDone=1; weDone=1;
Expand Down
81 changes: 35 additions & 46 deletions pdns/pdnssec.cc
Expand Up @@ -199,56 +199,47 @@ void rectifyZone(DNSSECKeeper& dk, const std::string& zone)
} }
else else
sd.db->nullifyDNSSECOrderNameAndUpdateAuth(sd.domain_id, qname, auth); sd.db->nullifyDNSSECOrderNameAndUpdateAuth(sd.domain_id, qname, auth);
if(realrr)
{
if (dsnames.count(qname))
sd.db->setDNSSECAuthOnDsRecord(sd.domain_id, qname);
if (!auth || nsset.count(qname)) {
sd.db->nullifyDNSSECOrderNameAndAuth(sd.domain_id, qname, "NS");
sd.db->nullifyDNSSECOrderNameAndAuth(sd.domain_id, qname, "A");
sd.db->nullifyDNSSECOrderNameAndAuth(sd.domain_id, qname, "AAAA");
}
}
} }
else // NSEC else // NSEC
{ {
if(realrr) sd.db->updateDNSSECOrderAndAuth(sd.domain_id, zone, qname, auth);
{ if (!realrr)
sd.db->updateDNSSECOrderAndAuth(sd.domain_id, zone, qname, auth);
if (dsnames.count(qname))
sd.db->setDNSSECAuthOnDsRecord(sd.domain_id, qname);
if (!auth || nsset.count(qname)) {
sd.db->nullifyDNSSECOrderNameAndAuth(sd.domain_id, qname, "A");
sd.db->nullifyDNSSECOrderNameAndAuth(sd.domain_id, qname, "AAAA");
}
}
else
{
sd.db->nullifyDNSSECOrderNameAndUpdateAuth(sd.domain_id, qname, auth); sd.db->nullifyDNSSECOrderNameAndUpdateAuth(sd.domain_id, qname, auth);
}
} }


if(auth && realrr && doent) if(realrr)
{ {
shorter=qname; if (dsnames.count(qname))
while(!pdns_iequals(shorter, zone) && chopOff(shorter)) sd.db->setDNSSECAuthOnDsRecord(sd.domain_id, qname);
if (!auth || nsset.count(qname)) {
if(haveNSEC3 && ns3pr.d_flags)
sd.db->nullifyDNSSECOrderNameAndAuth(sd.domain_id, qname, "NS");
sd.db->nullifyDNSSECOrderNameAndAuth(sd.domain_id, qname, "A");
sd.db->nullifyDNSSECOrderNameAndAuth(sd.domain_id, qname, "AAAA");
}

if(auth && doent)
{ {
if(!qnames.count(shorter) && !nonterm.count(shorter)) shorter=qname;
while(!pdns_iequals(shorter, zone) && chopOff(shorter))
{ {
if(!(maxent)) if(!qnames.count(shorter) && !nonterm.count(shorter))
{ {
cerr<<"Zone '"<<zone<<"' has too many empty non terminals."<<endl; if(!(maxent))
insnonterm.clear(); {
delnonterm.clear(); cerr<<"Zone '"<<zone<<"' has too many empty non terminals."<<endl;
doent=false; insnonterm.clear();
break; delnonterm.clear();
doent=false;
break;
}
nonterm.insert(shorter);
if (!delnonterm.count(shorter))
insnonterm.insert(shorter);
else
delnonterm.erase(shorter);
--maxent;
} }
nonterm.insert(shorter);
if (!delnonterm.count(shorter))
insnonterm.insert(shorter);
else
delnonterm.erase(shorter);
--maxent;
} }
} }
} }
Expand Down Expand Up @@ -1061,16 +1052,14 @@ try
cerr<<"Syntax: pdnssec set-nsec3 ZONE 'params' [narrow]"<<endl; cerr<<"Syntax: pdnssec set-nsec3 ZONE 'params' [narrow]"<<endl;
return 0; return 0;
} }
string nsec3params = cmds.size() > 2 ? cmds[2] : "1 1 1 ab"; string nsec3params = cmds.size() > 2 ? cmds[2] : "1 0 1 ab";
bool narrow = cmds.size() > 3 && cmds[3]=="narrow"; bool narrow = cmds.size() > 3 && cmds[3]=="narrow";
NSEC3PARAMRecordContent ns3pr(nsec3params); NSEC3PARAMRecordContent ns3pr(nsec3params);
if(!ns3pr.d_flags) {
cerr<<"PowerDNS only implements opt-out zones, please set the second parameter to '1' (example, '1 1 1 ab')"<<endl;
return 0;
}

dk.setNSEC3PARAM(cmds[1], ns3pr, narrow); dk.setNSEC3PARAM(cmds[1], ns3pr, narrow);
cerr<<"NSEC3 set, please rectify-zone if your backend needs it"<<endl; if (!ns3pr.d_flags)
cerr<<"NSEC3 set, please rectify-zone if your backend needs it"<<endl;
else
cerr<<"NSEC3 (opt-out) set, please rectify-zone if your backend needs it"<<endl;
} }
else if(cmds[0]=="set-presigned") { else if(cmds[0]=="set-presigned") {
if(cmds.size() < 2) { if(cmds.size() < 2) {
Expand Down
18 changes: 17 additions & 1 deletion pdns/sdig.cc
Expand Up @@ -13,11 +13,12 @@ try
bool dnssec=false; bool dnssec=false;
bool recurse=false; bool recurse=false;
bool tcp=false; bool tcp=false;
bool showflags=false;


reportAllTypes(); reportAllTypes();


if(argc < 5) { if(argc < 5) {
cerr<<"Syntax: sdig IP-address port question question-type [dnssec|recurse]\n"; cerr<<"Syntax: sdig IP-address port question question-type [dnssec|dnssec-tcp|recurse] [showflags]\n";
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }


Expand All @@ -38,6 +39,11 @@ try
recurse=true; recurse=true;
} }


if((argc > 5 && strcmp(argv[5], "showflags")==0) || (argc > 6 && strcmp(argv[6], "showflags")==0))
{
showflags=true;
}

vector<uint8_t> packet; vector<uint8_t> packet;


DNSPacketWriter pw(packet, argv[3], DNSRecordContent::TypeToNumber(argv[4])); DNSPacketWriter pw(packet, argv[3], DNSRecordContent::TypeToNumber(argv[4]));
Expand Down Expand Up @@ -132,6 +138,16 @@ try
stringtok(parts, zoneRep); stringtok(parts, zoneRep);
cout<<"\t"<<i->first.d_ttl<<"\t"<< parts[0]<<" "<<parts[1]<<" "<<parts[2]<<" "<<parts[3]<<" [expiry] [inception] [keytag] "<<parts[7]<<" ...\n"; cout<<"\t"<<i->first.d_ttl<<"\t"<< parts[0]<<" "<<parts[1]<<" "<<parts[2]<<" "<<parts[3]<<" [expiry] [inception] [keytag] "<<parts[7]<<" ...\n";
} }
else if(!showflags && i->first.d_type == QType::NSEC3)
{
string zoneRep = i->first.d_content->getZoneRepresentation();
vector<string> parts;
stringtok(parts, zoneRep);
cout<<"\t"<<i->first.d_ttl<<"\t"<< parts[0]<<" [flags] "<<parts[2]<<" "<<parts[3]<<" "<<parts[4];
for(vector<string>::iterator iter = parts.begin()+5; iter != parts.end(); ++iter)
cout<<" "<<*iter;
cout<<"\n";
}
else if(i->first.d_type == QType::DNSKEY) else if(i->first.d_type == QType::DNSKEY)
{ {
string zoneRep = i->first.d_content->getZoneRepresentation(); string zoneRep = i->first.d_content->getZoneRepresentation();
Expand Down
59 changes: 27 additions & 32 deletions pdns/slavecommunicator.cc
Expand Up @@ -260,55 +260,50 @@ void CommunicatorClass::suck(const string &domain,const string &remote)
}while(chopOff(shorter)); }while(chopOff(shorter));
} }


if(dnssecZone && haveNSEC3) if(haveNSEC3)
{ {
if(!narrow) { if(!narrow) {
hashed=toLower(toBase32Hex(hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, qname))); hashed=toLower(toBase32Hex(hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, qname)));
di.backend->updateDNSSECOrderAndAuthAbsolute(domain_id, qname, hashed, auth); di.backend->updateDNSSECOrderAndAuthAbsolute(domain_id, qname, hashed, auth);
} }
else else
di.backend->nullifyDNSSECOrderNameAndUpdateAuth(domain_id, qname, auth); di.backend->nullifyDNSSECOrderNameAndUpdateAuth(domain_id, qname, auth);
if(realrr)
{
if (dsnames.count(qname))
di.backend->setDNSSECAuthOnDsRecord(domain_id, qname);
if (!auth || nsset.count(qname)) {
di.backend->nullifyDNSSECOrderNameAndAuth(domain_id, qname, "NS");
di.backend->nullifyDNSSECOrderNameAndAuth(domain_id, qname, "A");
di.backend->nullifyDNSSECOrderNameAndAuth(domain_id, qname, "AAAA");
}
}
} }
else // NSEC else // NSEC
{ {
if(realrr) di.backend->updateDNSSECOrderAndAuth(domain_id, domain, qname, auth);
{ if (!realrr)
di.backend->updateDNSSECOrderAndAuth(domain_id, domain, qname, auth); di.backend->nullifyDNSSECOrderNameAndUpdateAuth(domain_id, qname, auth);
if (dsnames.count(qname))
di.backend->setDNSSECAuthOnDsRecord(domain_id, qname);
if (!auth || nsset.count(qname)) {
di.backend->nullifyDNSSECOrderNameAndAuth(domain_id, qname, "A");
di.backend->nullifyDNSSECOrderNameAndAuth(domain_id, qname, "AAAA");
}
}
} }


if(auth && realrr && doent) if(realrr)
{ {
shorter=qname; if (dsnames.count(qname))
while(!pdns_iequals(shorter, domain) && chopOff(shorter)) di.backend->setDNSSECAuthOnDsRecord(domain_id, qname);
if (!auth || nsset.count(qname)) {
if(haveNSEC3 && gotOptOutFlag)
di.backend->nullifyDNSSECOrderNameAndAuth(domain_id, qname, "NS");
di.backend->nullifyDNSSECOrderNameAndAuth(domain_id, qname, "A");
di.backend->nullifyDNSSECOrderNameAndAuth(domain_id, qname, "AAAA");
}

if(auth && doent)
{ {
if(!qnames.count(shorter) && !nonterm.count(shorter)) shorter=qname;
while(!pdns_iequals(shorter, domain) && chopOff(shorter))
{ {
if(!(maxent)) if(!qnames.count(shorter) && !nonterm.count(shorter))
{ {
L<<Logger::Error<<"AXFR zone "<<domain<<" has too many empty non terminals."<<endl; if(!(maxent))
nonterm.empty(); {
doent=false; L<<Logger::Error<<"AXFR zone "<<domain<<" has too many empty non terminals."<<endl;
break; nonterm.empty();
doent=false;
break;
}
nonterm.insert(shorter);
--maxent;
} }
nonterm.insert(shorter);
--maxent;
} }
} }
} }
Expand Down
7 changes: 5 additions & 2 deletions pdns/tcpreceiver.cc
Expand Up @@ -616,11 +616,14 @@ int TCPNameserver::doAXFR(const string &target, shared_ptr<DNSPacket> q, int out
} }
} }


uint8_t flags;

if(NSEC3Zone) { // now stuff in the NSEC3PARAM if(NSEC3Zone) { // now stuff in the NSEC3PARAM
flags = ns3pr.d_flags;
rr.qtype = QType(QType::NSEC3PARAM); rr.qtype = QType(QType::NSEC3PARAM);
ns3pr.d_flags = 0; ns3pr.d_flags = 0;
rr.content = ns3pr.getZoneRepresentation(); rr.content = ns3pr.getZoneRepresentation();
ns3pr.d_flags = 1; ns3pr.d_flags = flags;
string keyname = hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, rr.qname); string keyname = hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, rr.qname);
NSECXEntry& ne = nsecxrepo[keyname]; NSECXEntry& ne = nsecxrepo[keyname];


Expand Down Expand Up @@ -657,7 +660,7 @@ int TCPNameserver::doAXFR(const string &target, shared_ptr<DNSPacket> q, int out
keyname = NSEC3Zone ? hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, rr.qname) : labelReverse(rr.qname); keyname = NSEC3Zone ? hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, rr.qname) : labelReverse(rr.qname);
NSECXEntry& ne = nsecxrepo[keyname]; NSECXEntry& ne = nsecxrepo[keyname];
ne.d_ttl = sd.default_ttl; ne.d_ttl = sd.default_ttl;
ne.d_auth = (ne.d_auth || rr.auth); ne.d_auth = (ne.d_auth || rr.auth || (NSEC3Zone && !ns3pr.d_flags));
if (rr.qtype.getCode()) { if (rr.qtype.getCode()) {
ne.d_set.insert(rr.qtype.getCode()); ne.d_set.insert(rr.qtype.getCode());
} }
Expand Down
3 changes: 3 additions & 0 deletions regression-tests/00dnssec-grabkeys/command
Expand Up @@ -4,7 +4,10 @@ rm -f trustedkeys
rm -f unbound-host.conf rm -f unbound-host.conf
for zone in $(grep zone named.conf | cut -f2 -d\") for zone in $(grep zone named.conf | cut -f2 -d\")
do do
if [ "${zone: 0:16}" != "secure-delegated" ]
then
drill -p $port -o rd -D dnskey $zone @$nameserver | grep -v '^;' | grep -v AwEAAarTiHhPgvD28WCN8UBXcEcf8f >> trustedkeys drill -p $port -o rd -D dnskey $zone @$nameserver | grep -v '^;' | grep -v AwEAAarTiHhPgvD28WCN8UBXcEcf8f >> trustedkeys
fi
echo "stub-zone:" >> unbound-host.conf echo "stub-zone:" >> unbound-host.conf
echo " name: $zone" >> unbound-host.conf echo " name: $zone" >> unbound-host.conf
echo " stub-addr: $nameserver@$port" >> unbound-host.conf echo " stub-addr: $nameserver@$port" >> unbound-host.conf
Expand Down

0 comments on commit 04b4bf6

Please sign in to comment.