Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
285f93f
Add EDE EDNS0 Option code
wtoorop Jun 24, 2021
a8d78b2
Simple EDE example
wtoorop Jun 24, 2021
4049885
add locations for EDE errors
Aug 13, 2021
0703a38
Fix: use EDE codes with EDNS_OPT_APPEND_EDE
Aug 16, 2021
eac4eb3
Return EDE_DNSSEC_BOGUS when returning bogus answers
Aug 16, 2021
6b5f314
Show reason when returning EDE_DNSSEC_BOGUS
Aug 16, 2021
a9e6f6b
add variable bogus reason
Aug 17, 2021
b3f60db
add local anwser blocked
Aug 19, 2021
935634d
Revert "add local anwser blocked"
Aug 19, 2021
5fff0f7
Fix dont echo edns0 option list ...
Aug 19, 2021
5f1bad7
Merge branch 'master' into features/rfc8914-ede
Aug 20, 2021
04daac4
set up for tpkg test
Aug 23, 2021
8b06787
add localzones test
Aug 23, 2021
160fd01
add DNSSEC indeterminate EDE and DNAME expansion test
Sep 8, 2021
8bcc78c
add mesh bogus test, possible locations for more EDE and remove super…
Sep 13, 2021
c62828f
First step towards specific EDE DNSSEC errors
Sep 14, 2021
f840be0
add possible EDE spots
Sep 15, 2021
2b422df
Answer LDNS_EDE_RRSIGS_MISSING for normal answers with missing signat…
Sep 15, 2021
c3a2ce2
add routine to do EDE on ACL blocked messages
Sep 20, 2021
4ac3a7c
add forgotten compile error fixes from previous commit
Sep 20, 2021
8b3e1d8
add routine to add EDE to ACL:refused at correct location
Sep 27, 2021
7d0d645
change strncpy to memmove at @wcawijngaards' suggestion
Sep 28, 2021
6d0cd16
process @wcawijngaards' comments
Sep 28, 2021
3b20150
process @wcawijngaards' comments v2
Sep 28, 2021
65e71a3
fix CH class response
Sep 28, 2021
8e4e6c6
add QDCOUNT=0 to CHAOS query in ACL
Sep 29, 2021
d386e3a
add EDE response to autotrust_init_fail test
Sep 30, 2021
0e959d4
add EDE response to autotrust_init_failsig test
Sep 30, 2021
16f8248
add EDE responses to unittests
Oct 1, 2021
b3dca3a
add DNSKEY EDE code
Oct 8, 2021
869ea6e
add more tests
Oct 8, 2021
98eb2bf
add test setup for DNSSEC EDEs
Oct 13, 2021
3f9c631
- Introduce 'ede=<info-code>' and 'all_noedns' as options in the MATC…
gthess Oct 13, 2021
97f9ee6
change unittests to match just the ede code
Oct 13, 2021
59604cc
- Fix testcode, 0 is a valid EDE INFO-CODE.
gthess Oct 14, 2021
2856dea
add dnssec ede tests
Oct 18, 2021
9be2025
Merge branch 'master' into features/rfc8914-ede
Nov 15, 2021
f9b8b5c
Fix merge bugs
Nov 15, 2021
eec427d
remove superfluous EDE left over from merge
Nov 16, 2021
f836793
merge all basic EDE changes, merge with current master, and resolve …
Jan 12, 2022
2d420d3
Merge branch 'master' into features/ede-basic
Jan 12, 2022
6a9b6fc
remove unused function 'msgparse_check_edns_in_packet' left over from…
Jan 12, 2022
d1c9516
finish up adding validator EDEs and other TODOs and fix tests with mo…
Dec 6, 2021
aa1da52
add config options to test conf, fix local-zone EDE printing logic, a…
Dec 7, 2021
c853492
expand ede.tdir to do validator test for DNSKEY, RRSIG and NSEC missing
Dec 15, 2021
6c86de2
add todo for tests and fix EDE codes for DNSKEY missing
Dec 15, 2021
df694bb
fix DNSSEC nsec-failure test
Dec 15, 2021
7278e8e
fix rpl tests
Dec 15, 2021
f12a2ae
remove parent-split artifacts in localzone and fix tests correspondingly
Jan 12, 2022
ad386ba
modify tdir test to ignore localzone tests and add cache snoop case
Jan 13, 2022
6a7599e
add EDE stale and modify rpl tests accordingly
Jan 19, 2022
a970078
add forgotten rpl test for EDE stale
Jan 19, 2022
9485dbc
add EDE stale for mesh, change rpl tests accordingly
Jan 19, 2022
063c71e
Apply suggestions to ACL code
TCY16 Jan 24, 2022
6ad896f
Cleanup of the not so simple EDE cases
TCY16 Jan 24, 2022
71e7bbf
remove more not-so-simple EDE cases in local_zone and the corespondin…
Jan 26, 2022
bbe04d4
add serve-expired-ede as a config option and processed review comment…
Jan 27, 2022
de451eb
process review comments on validator
Jan 27, 2022
9d05fbc
add verbose EDE attach logging, change simple tpk tests to .rpls, and…
Feb 3, 2022
9148a97
fix typo in doc/unbound.conf.5.in
TCY16 Feb 3, 2022
02dbbdd
remove tpkg test cases that became rpls
Feb 3, 2022
c7584a0
Merge branch 'master' into features/ede-basic
Feb 4, 2022
4a2466f
add EDE code in EDNS list, stop-gap nsid_bogus rpl, and fix error in …
Feb 4, 2022
ea384ae
add global do-ede config option which is checked when attaching an ED…
Feb 8, 2022
1e77cca
- Introduce 'ede=any' as option in the MATCH line for replay test
gthess Feb 9, 2022
41072e5
- Update replay tests for new EDE matching logic.
gthess Feb 9, 2022
99b92db
add debug statement to make test which gives the output of the failed…
Feb 10, 2022
a1c4382
process @wtoorop's review comments v1
Feb 10, 2022
451d0f3
add missing sec_status_bogus EDEs
Feb 10, 2022
9440292
- Show the replay test that failed again after the output.
gthess Feb 11, 2022
95fd5b6
- Makefile commands should be oneliners.
gthess Feb 11, 2022
a1f0a88
- Add missing '\'.
gthess Feb 11, 2022
3ee6812
- Fix for EDE test code: initialise variable.
gthess Feb 16, 2022
bb32641
- Fix for EDE test code: Restore the original packet for each entry.
gthess Feb 16, 2022
a562af1
- Fix typo in test.
gthess Feb 16, 2022
a03c660
- Fix doc string after feedback from doxygen.
gthess Feb 16, 2022
19796fd
Merge branch 'master' into features/ede-basic
gthess Feb 16, 2022
665d618
- Fix EDE test code: reset the original packet on return.
gthess Feb 16, 2022
be73653
change logic in validator.c:processValidate to not overwrite previous…
Feb 17, 2022
f3375e4
remove superflous _ede from functions
Feb 18, 2022
9da1992
add missing do-ede: yes to tpkg conf
Feb 21, 2022
da8c6e0
process first round of review comments by @wcawijngaards
Feb 24, 2022
b756131
correctly remove broken keys in tdir script
Mar 2, 2022
3ce652c
make ede.tdir compatible with MacOS
Mar 9, 2022
96649c6
move from only using ede.tdir to using the .pre/.post structure
Mar 9, 2022
4d5a7ea
fix correct scenario name
Mar 9, 2022
b8bb920
process final round of comments by @wcawijngaards
Mar 10, 2022
d828b1e
Merge branch 'master' into features/ede-basic
Mar 10, 2022
5841bea
apply suggestions from @gthess's code review, as well as consolidatin…
Apr 25, 2022
a3ea4ec
add a few nits from @gthess's review, add LDNS_EDE_NONE as none-type …
Apr 26, 2022
e37b9bd
Merge branch 'master' into features/ede-basic
Apr 28, 2022
306a5b2
EDE review: properly use LDNS_EDE_NONE in localzone.c.
gthess May 1, 2022
43035ab
EDE review: document reason_bougs for dnskeyset_verify_rrset().
gthess May 1, 2022
0e16468
Apply click suggestions from @gthess's code review
TCY16 May 2, 2022
a769821
change LDNS_EDE_NONE to be outside of the EDE range, correct nsec3 ed…
May 3, 2022
03717b7
store ede code in key_entry_data struct to remember why key is bad, c…
May 4, 2022
4121755
remove superfluous check in val_kentry:key_entry_get_reason_bogus()
May 4, 2022
785bff6
fix typo in doc
May 4, 2022
bcd8db1
rename cfg serve-expired-ede to ede-serve-expired and add add checkin…
May 6, 2022
e229826
document the ede-serve-expired changes in the manpage
May 6, 2022
e63616f
rename do-ede option to do ede
May 6, 2022
1f30be2
EDE review: update man page.
gthess May 6, 2022
1126c50
EDE review: update example.conf.in
gthess May 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add a few nits from @gthess's review, add LDNS_EDE_NONE as none-type …
…and change logic accordingly, and change validator logic to be more careful with EDE overwrites and change logic accordingly
  • Loading branch information
TCY16 committed Apr 26, 2022
commit a3ea4ecada732b2790714e61161cac863985b1a0
3 changes: 2 additions & 1 deletion services/authzone.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ msg_create(struct regional* region, struct query_info* qinfo)
return NULL;
msg->rep->flags = (uint16_t)(BIT_QR | BIT_AA);
msg->rep->authoritative = 1;
msg->rep->reason_bogus = LDNS_EDE_NONE;
msg->rep->qdcount = 1;
/* rrsets is NULL, no rrsets yet */
return msg;
Expand Down Expand Up @@ -7753,7 +7754,7 @@ static int zonemd_dnssec_verify_rrset(struct auth_zone* z,
auth_zone_log(z->name, VERB_ALGO,
"zonemd: verify %s RRset with DNSKEY", typestr);
}
sec = dnskeyset_verify_rrset(env, ve, &pk, dnskey, sigalg, why_bogus,
sec = dnskeyset_verify_rrset(env, ve, &pk, dnskey, sigalg, why_bogus, NULL,
LDNS_SECTION_ANSWER, NULL);
if(sec == sec_status_secure) {
return 1;
Expand Down
5 changes: 5 additions & 0 deletions services/cache/dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ dns_msg_create(uint8_t* qname, size_t qnamelen, uint16_t qtype,
return NULL; /* integer overflow protection */
msg->rep->flags = BIT_QR; /* with QR, no AA */
msg->rep->qdcount = 1;
msg->rep->reason_bogus = LDNS_EDE_NONE;
msg->rep->rrsets = (struct ub_packed_rrset_key**)
regional_alloc(region,
capacity*sizeof(struct ub_packed_rrset_key*));
Expand Down Expand Up @@ -524,6 +525,7 @@ gen_dns_msg(struct regional* region, struct query_info* q, size_t num)
sizeof(struct reply_info) - sizeof(struct rrset_ref));
if(!msg->rep)
return NULL;
msg->rep->reason_bogus = LDNS_EDE_NONE;
if(num > RR_COUNT_MAX)
return NULL; /* integer overflow protection */
msg->rep->rrsets = (struct ub_packed_rrset_key**)
Expand Down Expand Up @@ -577,6 +579,7 @@ tomsg(struct module_env* env, struct query_info* q, struct reply_info* r,
msg->rep->ar_numrrsets = r->ar_numrrsets;
msg->rep->rrset_count = r->rrset_count;
msg->rep->authoritative = r->authoritative;
msg->rep->reason_bogus = r->reason_bogus;
if(!rrset_array_lock(r->ref, r->rrset_count, now_control)) {
return NULL;
}
Expand Down Expand Up @@ -632,6 +635,7 @@ rrset_msg(struct ub_packed_rrset_key* rrset, struct regional* region,
msg->rep->ns_numrrsets = 0;
msg->rep->ar_numrrsets = 0;
msg->rep->rrset_count = 1;
msg->rep->reason_bogus = LDNS_EDE_NONE;
msg->rep->rrsets[0] = packed_rrset_copy_region(rrset, region, now);
if(!msg->rep->rrsets[0]) /* copy CNAME */
return NULL;
Expand Down Expand Up @@ -670,6 +674,7 @@ synth_dname_msg(struct ub_packed_rrset_key* rrset, struct regional* region,
msg->rep->ns_numrrsets = 0;
msg->rep->ar_numrrsets = 0;
msg->rep->rrset_count = 1;
msg->rep->reason_bogus = LDNS_EDE_NONE;
msg->rep->rrsets[0] = packed_rrset_copy_region(rrset, region, now);
if(!msg->rep->rrsets[0]) /* copy DNAME */
return NULL;
Expand Down
3 changes: 1 addition & 2 deletions services/localzone.c
Original file line number Diff line number Diff line change
Expand Up @@ -1340,8 +1340,7 @@ local_error_encode(struct query_info* qinfo, struct module_env* env,
rcode, edns, repinfo, temp, env->now_tv))
edns->opt_list_inplace_cb_out = NULL;

if (ede_code >= 0 /* >= 0 means a defined sldns_ede_code */
&& env->cfg->do_ede) {
if (ede_code != LDNS_EDE_NONE && env->cfg->do_ede) {
edns_opt_list_append_ede(&edns->opt_list_out, temp,
ede_code, ede_txt);
}
Expand Down
26 changes: 20 additions & 6 deletions services/mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ mesh_send_reply(struct mesh_state* m, int rcode, struct reply_info* rep,
(rep->security <= sec_status_bogus ||
rep->security == sec_status_secure_sentinel_fail)) {
rcode = LDNS_RCODE_SERVFAIL;
if(m->s.env->cfg->stat_extended)
if(m->s.env->cfg->stat_extended)
m->s.env->mesh->ans_bogus++;
}
if(rep && rep->security == sec_status_secure)
Expand Down Expand Up @@ -1301,14 +1301,28 @@ mesh_send_reply(struct mesh_state* m, int rcode, struct reply_info* rep,
m->s.env->cfg->ignore_cd) && rep &&
(rep->security <= sec_status_bogus ||
rep->security == sec_status_secure_sentinel_fail)) {

char *reason = m->s.env->cfg->val_log_level >= 2
? errinf_to_str_bogus(&m->s) : NULL;
sldns_ede_code reason_bogus = rep->reason_bogus != LDNS_EDE_DNSSEC_BOGUS
? rep->reason_bogus : errinf_to_reason_bogus(&m->s);

edns_opt_list_append_ede(&r->edns.opt_list_out, m->s.region,
reason_bogus, reason);
/* During validation the EDE code can be received via two
* code paths. One code path fills the reply_info EDE, and
* the other fills it in the errinf_strlist. These paths
* intersect at some points, but where is opaque due to
* the complexity of the validator. At the time of writing
* we make the choice to prefer the EDE from errinf_strlist
* but a compelling reason to do otherwise is just as valid
*/
sldns_ede_code reason_bogus = errinf_to_reason_bogus(&m->s);
if ((reason_bogus == LDNS_EDE_DNSSEC_BOGUS &&
rep->reason_bogus != LDNS_EDE_NONE) ||
reason_bogus == LDNS_EDE_NONE) {
reason_bogus = rep->reason_bogus;
}

if(reason_bogus != LDNS_EDE_NONE) {
edns_opt_list_append_ede(&r->edns.opt_list_out,
m->s.region, reason_bogus, reason);
}
free(reason);
}
error_encode(r_buffer, rcode, &m->s.qinfo, r->qid,
Expand Down
3 changes: 2 additions & 1 deletion sldns/rrdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ enum sldns_enum_ede_code
LDNS_EDE_NOT_SUPPORTED = 21,
LDNS_EDE_NO_REACHABLE_AUTHORITY = 22,
LDNS_EDE_NETWORK_ERROR = 23,
LDNS_EDE_INVALID_DATA = 24
LDNS_EDE_INVALID_DATA = 24,
LDNS_EDE_NONE = 65535 /* From the *private* range of EDE codes, used internally */
};
typedef enum sldns_enum_ede_code sldns_ede_code;

Expand Down
2 changes: 1 addition & 1 deletion testcode/unitverify.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ verifytest_rrset(struct module_env* env, struct val_env* ve,
}
setup_sigalg(dnskey, sigalg); /* check all algorithms in the dnskey */
/* ok to give null as qstate here, won't be used for answer section. */
sec = dnskeyset_verify_rrset(env, ve, rrset, dnskey, sigalg, &reason,
sec = dnskeyset_verify_rrset(env, ve, rrset, dnskey, sigalg, &reason, NULL,
LDNS_SECTION_ANSWER, NULL);
if(vsig) {
printf("verify outcome is: %s %s\n", sec_status_to_string(sec),
Expand Down
161 changes: 1 addition & 160 deletions util/config_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2492,7 +2492,7 @@ char* cfg_ptr_reverse(char* str)
while(*ip_end && isspace((unsigned char)*ip_end))
ip_end++;
if(name>ip_end) {
snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "%.*s",
snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "%.*s",
(int)(name-ip_end), ip_end);
}
snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), " PTR %s", name);
Expand Down Expand Up @@ -2563,165 +2563,6 @@ void w_config_adjust_directory(struct config_file* cfg)
}
#endif /* UB_ON_WINDOWS */

void errinf(struct module_qstate* qstate, const char* str)
{
struct config_strlist* p;
if((qstate->env->cfg->val_log_level < 2 && !qstate->env->cfg->log_servfail) || !str)
return;
p = (struct config_strlist*)regional_alloc(qstate->region, sizeof(*p));
if(!p) {
log_err("malloc failure in validator-error-info string");
return;
}
p->next = NULL;
p->str = regional_strdup(qstate->region, str);
p->reason_bogus = LDNS_EDE_DNSSEC_BOGUS;
if(!p->str) {
log_err("malloc failure in validator-error-info string");
return;
}
/* add at end */
if(qstate->errinf) {
struct config_strlist* q = qstate->errinf;
while(q->next)
q = q->next;
q->next = p;
} else qstate->errinf = p;
}

void errinf_ede(struct module_qstate* qstate,
const char* str, sldns_ede_code reason_bogus)
{
struct config_strlist* p;
if((qstate->env->cfg->val_log_level < 2 && !qstate->env->cfg->log_servfail) || !str)
return;
p = (struct config_strlist*)regional_alloc(qstate->region, sizeof(*p));
if(!p) {
log_err("malloc failure in validator-error-info string");
return;
}
p->next = NULL;
p->str = regional_strdup(qstate->region, str);
p->reason_bogus = reason_bogus;
if(!p->str) {
log_err("malloc failure in validator-error-info string");
return;
}
/* add at end */
if(qstate->errinf) {
struct config_strlist* q = qstate->errinf;
while(q->next)
q = q->next;
q->next = p;
} else qstate->errinf = p;
}

void errinf_origin(struct module_qstate* qstate, struct sock_list *origin)
{
struct sock_list* p;
if(qstate->env->cfg->val_log_level < 2 && !qstate->env->cfg->log_servfail)
return;
for(p=origin; p; p=p->next) {
char buf[256];
if(p == origin)
snprintf(buf, sizeof(buf), "from ");
else snprintf(buf, sizeof(buf), "and ");
if(p->len == 0)
snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf),
"cache");
else
addr_to_str(&p->addr, p->len, buf+strlen(buf),
sizeof(buf)-strlen(buf));
errinf(qstate, buf);
}
}

char* errinf_to_str_bogus(struct module_qstate* qstate)
{
char buf[20480];
char* p = buf;
size_t left = sizeof(buf);
struct config_strlist* s;
char dname[LDNS_MAX_DOMAINLEN+1];
char t[16], c[16];
sldns_wire2str_type_buf(qstate->qinfo.qtype, t, sizeof(t));
sldns_wire2str_class_buf(qstate->qinfo.qclass, c, sizeof(c));
dname_str(qstate->qinfo.qname, dname);
snprintf(p, left, "validation failure <%s %s %s>:", dname, t, c);
left -= strlen(p); p += strlen(p);
if(!qstate->errinf)
snprintf(p, left, " misc failure");
else for(s=qstate->errinf; s; s=s->next) {
snprintf(p, left, " %s", s->str);
left -= strlen(p); p += strlen(p);
}
p = strdup(buf);
if(!p)
log_err("malloc failure in errinf_to_str");
return p;
}

sldns_ede_code errinf_to_reason_bogus(struct module_qstate* qstate)
{
struct config_strlist* s;
for(s=qstate->errinf; s; s=s->next) {
if (s->reason_bogus != LDNS_EDE_DNSSEC_BOGUS) {
return s->reason_bogus;
}
}
return LDNS_EDE_DNSSEC_BOGUS;
}

char* errinf_to_str_servfail(struct module_qstate* qstate)
{
char buf[20480];
char* p = buf;
size_t left = sizeof(buf);
struct config_strlist* s;
char dname[LDNS_MAX_DOMAINLEN+1];
char t[16], c[16];
sldns_wire2str_type_buf(qstate->qinfo.qtype, t, sizeof(t));
sldns_wire2str_class_buf(qstate->qinfo.qclass, c, sizeof(c));
dname_str(qstate->qinfo.qname, dname);
snprintf(p, left, "SERVFAIL <%s %s %s>:", dname, t, c);
left -= strlen(p); p += strlen(p);
if(!qstate->errinf)
snprintf(p, left, " misc failure");
else for(s=qstate->errinf; s; s=s->next) {
snprintf(p, left, " %s", s->str);
left -= strlen(p); p += strlen(p);
}
p = strdup(buf);
if(!p)
log_err("malloc failure in errinf_to_str");
return p;
}

void errinf_rrset(struct module_qstate* qstate, struct ub_packed_rrset_key *rr)
{
char buf[1024];
char dname[LDNS_MAX_DOMAINLEN+1];
char t[16], c[16];
if((qstate->env->cfg->val_log_level < 2 && !qstate->env->cfg->log_servfail) || !rr)
return;
sldns_wire2str_type_buf(ntohs(rr->rk.type), t, sizeof(t));
sldns_wire2str_class_buf(ntohs(rr->rk.rrset_class), c, sizeof(c));
dname_str(rr->rk.dname, dname);
snprintf(buf, sizeof(buf), "for <%s %s %s>", dname, t, c);
errinf(qstate, buf);
}

void errinf_dname(struct module_qstate* qstate, const char* str, uint8_t* dname)
{
char b[1024];
char buf[LDNS_MAX_DOMAINLEN+1];
if((qstate->env->cfg->val_log_level < 2 && !qstate->env->cfg->log_servfail) || !str || !dname)
return;
dname_str(dname, buf);
snprintf(b, sizeof(b), "%s %s", str, buf);
errinf(qstate, b);
}

int options_remote_is_address(struct config_file* cfg)
{
if(!cfg->remote_control_enable) return 0;
Expand Down
61 changes: 0 additions & 61 deletions util/config_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,6 @@ struct config_strlist {
struct config_strlist* next;
/** config option string */
char* str;
/** EDE code companion to the error str */
sldns_ede_code reason_bogus;
};

/**
Expand Down Expand Up @@ -1248,65 +1246,6 @@ char* fname_after_chroot(const char* fname, struct config_file* cfg,
*/
char* cfg_ptr_reverse(char* str);

/**
* Append text to the error info for validation.
* @param qstate: query state.
* @param str: copied into query region and appended.
* Failures to allocate are logged.
*/
void errinf(struct module_qstate* qstate, const char* str);
void errinf_ede(struct module_qstate* qstate, const char* str,
sldns_ede_code reason_bogus);

/**
* Append text to error info: from 1.2.3.4
* @param qstate: query state.
* @param origin: sock list with origin of trouble.
* Every element added.
* If NULL: nothing is added.
* if 0len element: 'from cache' is added.
*/
void errinf_origin(struct module_qstate* qstate, struct sock_list *origin);

/**
* Append text to error info: for RRset name type class
* @param qstate: query state.
* @param rr: rrset_key.
*/
void errinf_rrset(struct module_qstate* qstate, struct ub_packed_rrset_key *rr);

/**
* Append text to error info: str dname
* @param qstate: query state.
* @param str: explanation string
* @param dname: the dname.
*/
void errinf_dname(struct module_qstate* qstate, const char* str,
uint8_t* dname);

/**
* Create error info in string. For validation failures.
* @param qstate: query state.
* @return string or NULL on malloc failure (already logged).
* This string is malloced and has to be freed by caller.
*/
char* errinf_to_str_bogus(struct module_qstate* qstate);
/**
* Check the sldns_ede_code of the qstate.
* @param qstate: query state.
* @return LDNS_EDE_DNSSEC_BOGUS by default, or another sldns_ede_code
* if this is set.
*/
sldns_ede_code errinf_to_reason_bogus(struct module_qstate* qstate);

/**
* Create error info in string. For other servfails.
* @param qstate: query state.
* @return string or NULL on malloc failure (already logged).
* This string is malloced and has to be freed by caller.
*/
char* errinf_to_str_servfail(struct module_qstate* qstate);

/**
* Used during options parsing
*/
Expand Down
2 changes: 1 addition & 1 deletion util/data/msgreply.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ construct_reply_info_base(struct regional* region, uint16_t flags, size_t qd,
rep->ar_numrrsets = ar;
rep->rrset_count = total;
rep->security = sec;
rep->reason_bogus = LDNS_EDE_DNSSEC_BOGUS;
rep->reason_bogus = LDNS_EDE_NONE;
rep->authoritative = 0;
/* array starts after the refs */
if(region)
Expand Down
Loading