Case: NSEC3 with too many iterations used for a positive wildcard proof.
It certainly isn't a perfect fix yet; the whole validator would benefit
from a general overhaul.
if (rrset->type != KNOT_RRTYPE_NSEC3) {
continue;
}
+ /* Avoid hashing with too many iterations;
+ * on "normal packets" we shouldn't get to this point. */
+ if (knot_nsec3_iters(rrset->rrs.rdata) > KR_NSEC3_MAX_ITERATIONS) {
+ continue;
+ }
int ret = covers_name(&flags, rrset, sname);
if (ret != 0) {
return ret;
* KNOT_ERANGE - NSEC3 RR that covers a wildcard
* has been found, but has opt-out flag set;
* otherwise - error.
+ * Records over KR_NSEC3_MAX_ITERATIONS are skipped, so you probably get kr_error(ENOENT).
*/
int kr_nsec3_wildcard_answer_response_check(const knot_pkt_t *pkt, knot_section_t section_id,
const knot_dname_t *sname, int trim_to_next);