From: Remi Gacogne Date: Fri, 29 Sep 2017 10:26:05 +0000 (+0200) Subject: rec: Check that the owner name is part of the signer in getDenial X-Git-Tag: rec-4.1.0-rc1~11^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F5752%2Fhead;p=thirdparty%2Fpdns.git rec: Check that the owner name is part of the signer in getDenial --- diff --git a/pdns/validate.cc b/pdns/validate.cc index 7b159e367b..46a148dded 100644 --- a/pdns/validate.cc +++ b/pdns/validate.cc @@ -110,6 +110,10 @@ dState getDenial(const cspmap_t &validrrsets, const DNSName& qname, const uint16 if(!nsec) continue; + const DNSName signer = getSigner(v.second.signatures); + if (!v.first.first.isPartOf(signer)) + continue; + /* RFC 6840 section 4.1 "Clarifications on Nonexistence Proofs": Ancestor delegation NSEC or NSEC3 RRs MUST NOT be used to assume nonexistence of any RRs below that zone cut, which include all RRs at @@ -117,8 +121,8 @@ dState getDenial(const cspmap_t &validrrsets, const DNSName& qname, const uint16 owner name regardless of type. */ if (nsec->d_set.count(QType::NS) && !nsec->d_set.count(QType::SOA) && - getSigner(v.second.signatures).countLabels() < v.first.first.countLabels()) { - LOG("type is "<d_set.count(QType::NS))<<", SOA is "<d_set.count(QType::SOA))<<", signer is "<d_set.count(QType::NS))<<", SOA is "<d_set.count(QType::SOA))<<", signer is "<d_set.count(QType::NS) && !nsec3->d_set.count(QType::SOA) && - getSigner(v.second.signatures).countLabels() < v.first.first.countLabels()) { - LOG("type is "<d_set.count(QType::NS))<<", SOA is "<d_set.count(QType::SOA))<<", signer is "<d_set.count(QType::NS))<<", SOA is "<d_set.count(QType::SOA))<<", signer is "<