DomainNotificationInfo dni;
dni.di=di;
- dni.dnssecOk = dk.isPresigned(di.zone);
+ dni.dnssecOk = dk.doesDNSSEC();
if(dk.getTSIGForAccess(di.zone, sr.master, &dni.tsigkeyname)) {
string secret64;
L<<Logger::Warning<<"Received serial number updates for "<<ssr.d_freshness.size()<<" zone"<<addS(ssr.d_freshness.size())<<", had "<<ifl.getTimeouts()<<" timeout"<<addS(ifl.getTimeouts())<<endl;
typedef DomainNotificationInfo val_t;
+ unsigned int now = time(0);
for(val_t& val : sdomains) {
DomainInfo& di(val.di);
// might've come from the packethandler
di.backend->setFresh(di.id);
}
else if(theirserial == ourserial) {
- if(!dk.isPresigned(di.zone)) {
- L<<Logger::Info<<"Domain '"<< di.zone<<"' is fresh (not presigned, no RRSIG check)"<<endl;
- di.backend->setFresh(di.id);
- }
- else {
+ uint32_t maxExpire=0, maxInception=0;
+ if(dk.isPresigned(di.zone)) {
B->lookup(QType(QType::RRSIG), di.zone); // can't use DK before we are done with this lookup!
DNSResourceRecord rr;
- uint32_t maxExpire=0, maxInception=0;
while(B->get(rr)) {
RRSIGRecordContent rrc(rr.content);
if(rrc.d_type == QType::SOA) {
maxExpire = std::max(maxExpire, rrc.d_sigexpire);
}
}
- if(maxInception == ssr.d_freshness[di.id].theirInception && maxExpire == ssr.d_freshness[di.id].theirExpire) {
- L<<Logger::Info<<"Domain '"<< di.zone<<"' is fresh and apex RRSIGs match"<<endl;
- di.backend->setFresh(di.id);
- }
- else {
- L<<Logger::Warning<<"Domain '"<< di.zone<<"' is fresh, but RRSIGS differ, so DNSSEC stale"<<endl;
- addSuckRequest(di.zone, *di.masters.begin());
- }
+ }
+ if(! maxInception && ! ssr.d_freshness[di.id].theirInception) {
+ L<<Logger::Info<<"Domain '"<< di.zone<<"' is fresh (no DNSSEC)"<<endl;
+ di.backend->setFresh(di.id);
+ }
+ else if(maxInception == ssr.d_freshness[di.id].theirInception && maxExpire == ssr.d_freshness[di.id].theirExpire) {
+ L<<Logger::Info<<"Domain '"<< di.zone<<"' is fresh and SOA RRSIGs match"<<endl;
+ di.backend->setFresh(di.id);
+ }
+ else if(maxExpire >= now && ! ssr.d_freshness[di.id].theirInception ) {
+ L<<Logger::Info<<"Domain '"<< di.zone<<"' is fresh, master is no longer signed but (some) signatures are still vallid"<<endl;
+ di.backend->setFresh(di.id);
+ }
+ else if(maxInception && ! ssr.d_freshness[di.id].theirInception ) {
+ L<<Logger::Warning<<"Domain '"<< di.zone<<"' is stale, master is no longer signed and all signatures have expired"<<endl;
+ addSuckRequest(di.zone, *di.masters.begin());
+ }
+ else if(dk.doesDNSSEC() && ! maxInception && ssr.d_freshness[di.id].theirInception) {
+ L<<Logger::Warning<<"Domain '"<< di.zone<<"' is stale, master has signed"<<endl;
+ addSuckRequest(di.zone, *di.masters.begin());
+ }
+ else {
+ L<<Logger::Warning<<"Domain '"<< di.zone<<"' is fresh, but RRSIGs differ, so DNSSEC is stale"<<endl;
+ addSuckRequest(di.zone, *di.masters.begin());
}
}
else {