]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
non opt-out nsec3
authorbert hubert <bert.hubert@netherlabs.nl>
Wed, 27 Apr 2016 17:20:30 +0000 (19:20 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Wed, 27 Apr 2016 17:20:30 +0000 (19:20 +0200)
pdns/validate.cc

index 1d6de7d0337aa8732eea2abaa07fa97210055165..a682f94c45c37dfb1616b5058bb993433e964abf 100644 (file)
@@ -354,10 +354,15 @@ vState getKeysFor(DNSRecordOracle& dro, const DNSName& zone, keyset_t &keyset)
               auto nsec3 = std::dynamic_pointer_cast<NSEC3RecordContent>(r);
               string h = hashQNameWithSalt(nsec3->d_salt, nsec3->d_iterations, qname);
               LOG("\tquery hash: "<<toBase32Hex(h)<<endl);
-              if(fromBase32Hex(v.first.first.getRawLabels()[0]) < h && h < nsec3->d_nexthash) {
+              string beginHash=fromBase32Hex(v.first.first.getRawLabels()[0]);
+              if(beginHash < h && h < nsec3->d_nexthash) {
                 LOG("Denies existence of DS!"<<endl);
                 return Insecure;
               }
+              else if(beginHash == h && !nsec3->d_set.count(QType::DS)) {
+                LOG("Denies existence of DS (not opt-out)"<<endl);
+                return Insecure;
+              }
               else {
                 LOG("Did not cover us, start="<<v.first.first<<", us="<<toBase32Hex(h)<<", end="<<toBase32Hex(nsec3->d_nexthash)<<endl);
               }