@@ -507,6 +507,7 @@ int kr_nsec3_name_error_response_check(const knot_pkt_t *pkt, knot_section_t sec
507
507
* @param sname Name to be checked.
508
508
* @param stype Type to be checked.
509
509
* @return 0 or error code.
510
+ * KNOT_EDOWNGRADED: special case where the RR would be in an insecure child zone.
510
511
* @note This does NOT check the opt-out case if type is DS;
511
512
* see RFC 5155 8.6.
512
513
*/
@@ -528,8 +529,9 @@ static int nodata_find(const knot_pkt_t *pkt, knot_section_t section_id,
528
529
529
530
const uint8_t * bm = knot_nsec3_bitmap (nsec3 -> rrs .rdata );
530
531
uint16_t bm_size = knot_nsec3_bitmap_len (nsec3 -> rrs .rdata );
531
- if (kr_nsec_bitmap_nodata_check (bm , bm_size , type , nsec3 -> owner ) == kr_ok ())
532
- return kr_ok ();
532
+ int ret = kr_nsec_bitmap_nodata_check (bm , bm_size , type , nsec3 -> owner );
533
+ if (ret == kr_ok () || ret == KNOT_EDOWNGRADED )
534
+ return ret ;
533
535
}
534
536
535
537
return kr_error (ENOENT );
@@ -602,8 +604,8 @@ int kr_nsec3_no_data(const knot_pkt_t *pkt, knot_section_t section_id,
602
604
{
603
605
/* DS record may be also matched by an existing NSEC3 RR. */
604
606
int ret = nodata_find (pkt , section_id , sname , stype );
605
- if (ret == 0 ) {
606
- /* Satisfies RFC5155 8.5 and 8.6, both first paragraph. */
607
+ if (ret == 0 || ret == KNOT_EDOWNGRADED ) {
608
+ /* If 0, satisfies RFC5155 8.5 and 8.6, both first paragraph. */
607
609
return ret ;
608
610
}
609
611
0 commit comments