44
44
#include "validator/val_kentry.h"
45
45
#include "validator/val_sigcrypt.h"
46
46
#include "validator/val_anchor.h"
47
#include "validator/val_nsec.h"
48
#include "validator/val_neg.h"
47
49
#include "services/cache/rrset.h"
50
#include "services/cache/dns.h"
48
51
#include "util/data/msgreply.h"
49
52
#include "util/data/packed_rrset.h"
50
53
#include "util/data/dname.h"
881
884
else *reason = "no signatures over NSEC3s";
889
val_find_DS(struct module_env* env, uint8_t* nm, size_t nmlen, uint16_t c,
890
struct regional* region)
893
struct query_info qinfo;
894
struct ub_packed_rrset_key *rrset = rrset_cache_lookup(
895
env->rrset_cache, nm, nmlen, LDNS_RR_TYPE_DS, c, 0,
898
/* DS rrset exists. Return it to the validator immediately*/
899
struct ub_packed_rrset_key* copy = packed_rrset_copy_region(
900
rrset, region, *env->now);
901
lock_rw_unlock(&rrset->entry.lock);
904
msg = dns_msg_create(nm, nmlen, LDNS_RR_TYPE_DS, c, region, 1);
907
msg->rep->rrsets[0] = copy;
908
msg->rep->rrset_count++;
909
msg->rep->an_numrrsets++;
912
/* lookup in rrset and negative cache for NSEC/NSEC3 */
914
qinfo.qname_len = nmlen;
915
qinfo.qtype = LDNS_RR_TYPE_DS;
917
/* do not add SOA to reply message, it is going to be used internal */
918
msg = val_neg_getmsg(env->neg_cache, &qinfo, region, env->rrset_cache,
919
env->scratch_buffer, *env->now, 0);