filter_init(&flt, list, num, qinfo); /* init RR iterator */
if(!flt.zone)
return sec_status_bogus; /* no RRs */
+ if(query_dname_compare(flt.zone, kkey->name) != 0) {
+ verbose(VERB_ALGO, "NSEC3 name is not b32.signer name");
+ return sec_status_bogus;
+ }
if(!param_set_same(&flt, NULL))
return sec_status_bogus; /* nsec3 params from distinct chains*/
if(nsec3_iteration_count_high(ve, &flt, kkey))
filter_init(&flt, list, num, qinfo); /* init RR iterator */
if(!flt.zone)
return sec_status_bogus; /* no RRs */
+ if(query_dname_compare(flt.zone, kkey->name) != 0) {
+ verbose(VERB_ALGO, "NSEC3 name is not b32.signer name");
+ return sec_status_bogus;
+ }
if(!param_set_same(&flt, NULL))
return sec_status_bogus; /* nsec3 params from distinct chains*/
if(nsec3_iteration_count_high(ve, &flt, kkey))
filter_init(&flt, list, num, qinfo); /* init RR iterator */
if(!flt.zone)
return sec_status_bogus; /* no RRs */
+ if(query_dname_compare(flt.zone, kkey->name) != 0) {
+ verbose(VERB_ALGO, "NSEC3 name is not b32.signer name");
+ return sec_status_bogus;
+ }
if(!param_set_same(&flt, NULL))
return sec_status_bogus; /* nsec3 params from distinct chains*/
if(nsec3_iteration_count_high(ve, &flt, kkey))
*reason = "no NSEC3 records";
return sec_status_bogus; /* no RRs */
}
+ if(query_dname_compare(flt.zone, kkey->name) != 0) {
+ verbose(VERB_ALGO, "NSEC3 name is not b32.signer name");
+ *reason = "NSEC3 name is not b32.signer name";
+ return sec_status_bogus;
+ }
if(!param_set_same(&flt, reason))
return sec_status_bogus; /* nsec3 params from distinct chains*/
if(nsec3_iteration_count_high(ve, &flt, kkey))
filter_init(&flt, list, num, qinfo); /* init RR iterator */
if(!flt.zone)
return sec_status_bogus; /* no RRs */
+ if(query_dname_compare(flt.zone, kkey->name) != 0) {
+ verbose(VERB_ALGO, "NSEC3 name is not b32.signer name");
+ return sec_status_bogus;
+ }
if(!param_set_same(&flt, NULL))
return sec_status_bogus; /* nsec3 params from distinct chains*/
if(nsec3_iteration_count_high(ve, &flt, kkey))
*reason_bogus = LDNS_EDE_DNSSEC_BOGUS;
return sec_status_bogus; /* signer name offtree */
}
+ /* NSEC3, the owner name must be the <base32hash>.signername */
+ if(ntohs(rrset->rk.type) == LDNS_RR_TYPE_NSEC3 &&
+ rrset->rk.dname_len > 0) {
+ uint8_t* dnameless = rrset->rk.dname;
+ size_t dnamelesslen = rrset->rk.dname_len;
+ dname_remove_label(&dnameless, &dnamelesslen);
+ if(query_dname_compare(dnameless, signer) != 0) {
+ verbose(VERB_QUERY, "verify: NSEC3 owner name is not b32.signer name");
+ *reason = "NSEC3 owner name is not b32.signer name";
+ if(reason_bogus)
+ *reason_bogus = LDNS_EDE_DNSSEC_BOGUS;
+ return sec_status_bogus; /* NSEC3 owner not b32.signer */
+ }
+ }
sigblock = (unsigned char*)signer+signer_len;
if(siglen < 2+18+signer_len+1) {
verbose(VERB_QUERY, "verify: too short, no signature data");