From: Remi Gacogne Date: Tue, 23 Feb 2021 17:27:02 +0000 (+0100) Subject: rec: Fix the generation of positive answer from a NSEC+wildcard X-Git-Tag: dnsdist-1.6.0-alpha2~12^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=505e343f0915ebeaa078b2441401f9f959e78dd2;p=thirdparty%2Fpdns.git rec: Fix the generation of positive answer from a NSEC+wildcard --- diff --git a/pdns/recursordist/aggressive_nsec.cc b/pdns/recursordist/aggressive_nsec.cc index cb08064339..b1b2215ccf 100644 --- a/pdns/recursordist/aggressive_nsec.cc +++ b/pdns/recursordist/aggressive_nsec.cc @@ -496,7 +496,7 @@ bool AggressiveNSECCache::synthesizeFromNSECWildcard(time_t now, const DNSName& } addToRRSet(now, wcSet, wcSignatures, name, doDNSSEC, ret, DNSResourceRecord::ANSWER); - addRecordToRRSet(now, nsec.d_owner, QType::NSEC3, nsec.d_ttd - now, nsec.d_record, nsec.d_signatures, doDNSSEC, ret); + addRecordToRRSet(now, nsec.d_owner, QType::NSEC, nsec.d_ttd - now, nsec.d_record, nsec.d_signatures, doDNSSEC, ret); LOG("Synthesized valid answer from NSECs and wildcard!"< commonLabelsCount) { - if (!wc.chopOff()) { - break; - } - --labelsCount; - } - wc = g_wildcarddnsname + wc; + DNSName closestEncloser = getClosestEncloserFromNSEC(name, entry.d_owner, entry.d_next); + DNSName wc = g_wildcarddnsname + closestEncloser; LOG("Now looking for a NSEC before the wildcard "<(wcEntry.d_record); denial = matchesNSEC(wc, type.getCode(), wcEntry.d_owner, nsecContent, wcEntry.d_signatures); if (denial == dState::NODENIAL || denial == dState::INCONCLUSIVE) { - LOG(" but it does no cover us"<