We were off by one when counting labels, so when an NTA was added for a
name where a TA was configured, we would still attempt validation.
Reported by @jpmens
DNSName lowestNTA;
for (auto const &negAnchor : negAnchors)
- if (zone.isPartOf(negAnchor.first) && lowestNTA.countLabels() < negAnchor.first.countLabels())
+ if (zone.isPartOf(negAnchor.first) && lowestNTA.countLabels() <= negAnchor.first.countLabels())
lowestNTA = negAnchor.first;
if(!lowestNTA.empty()) {
* attempt validation for. However, section 3 tells us this positive
* Trust Anchor MUST be *below* the name and not the name itself
*/
- if(lowestTA.countLabels() < lowestNTA.countLabels()) {
+ if(lowestTA.countLabels() <= lowestNTA.countLabels()) {
LOG("marking answer Insecure"<<endl);
return NTA; // Not Insecure, this way validateRecords() can shortcut
}