uint16_t i;
uint8_t window_block_nr;
+ if (!nsec_bitmap) {
+ return false;
+ }
+
/* Check the bitmap if our type is there */
bitmap = ldns_rdf_data(nsec_bitmap);
window_block_nr = (uint8_t) (type / 256);
i = 0;
+
while (i < ldns_rdf_size(nsec_bitmap)) {
if (bitmap[i] == window_block_nr) {
/* this is the right window, check the bit */
return LDNS_STATUS_CRYPTO_NO_TRUSTED_DNSKEY;
} else {
/* Try to see if there are NSECS in the packet */
- nsecs = ldns_pkt_rr_list_by_type(pkt, LDNS_RR_TYPE_NSEC, LDNS_SECTION_ANY);
+ nsecs = ldns_pkt_rr_list_by_type(pkt, LDNS_RR_TYPE_NSEC, LDNS_SECTION_ANY_NOQUESTION);
result = LDNS_STATUS_CRYPTO_NO_RRSIG;
for (nsec_i = 0; nsec_i < ldns_rr_list_rr_count(nsecs); nsec_i++) {