static int32_t expiration_offset = 0;
static bool do_sigchase = false;
static bool no_nomatch_msg = false;
+static int check_all_sigs = 0;
static FILE* myout;
static FILE* myerr;
ldns_rr_list* keys)
{
ldns_status status, result = LDNS_STATUS_OK;
+ int one_signature_verified = 0;
ldns_dnssec_rrs *cur_sig_bak = cur_sig;
+ int is_dnskey_rrset = ldns_rr_list_rr_count(rrset_rrs) > 0 &&
+ ldns_rr_get_type(ldns_rr_list_rr(rrset_rrs, 0)) == LDNS_RR_TYPE_DNSKEY;
/* A single valid signature validates the RRset */
- while (cur_sig) {
+ /* With check all sigs, it skips this, except for the DNSKEY RRset. */
+ if(!check_all_sigs || is_dnskey_rrset) {
+ while (cur_sig) {
if (ldns_verify_rrsig_keylist_time( rrset_rrs, cur_sig->rr
, keys, check_time, NULL)
|| rrsig_check_time_margins(cur_sig->rr))
cur_sig = cur_sig->next;
else
return LDNS_STATUS_OK;
+ }
}
/* Without any valid signature, do print all errors. */
+ /* When checking all sigs, keep track if one is valid. */
for (cur_sig = cur_sig_bak; cur_sig; cur_sig = cur_sig->next) {
status = ldns_verify_rrsig_keylist_time(rrset_rrs,
cur_sig->rr, keys, check_time, NULL);
status = status ? status
: rrsig_check_time_margins(cur_sig->rr);
+ if(check_all_sigs && status == LDNS_STATUS_OK)
+ one_signature_verified += 1;
if (!status)
; /* pass */
else if (!no_nomatch_msg || status !=
myerr, rrset_rrs, status, cur_sig);
update_error(&result, status);
}
+ if(check_all_sigs && one_signature_verified)
+ return LDNS_STATUS_OK;
return result;
}
"\t\t\tDefault is %s\n", LDNS_TRUST_ANCHOR_FILE);
fprintf(out, "\t-p [0-100]\tonly checks this percentage of "
"the zone.\n\t\t\tDefaults to 100\n");
+ fprintf(out, "\t-s\t\tcheck all signature results, instead of one.\n");
fprintf(out, "\t-S\t\tchase signature(s) to a known key. "
"The network may be\n\t\t\taccessed to "
"validate the zone's DNSKEYs. (implies -k)\n");
myout = stdout;
myerr = stderr;
- while ((c = getopt(argc, argv, "ae:hi:k:vV:p:St:Z")) != -1) {
+ while ((c = getopt(argc, argv, "ae:hi:k:vV:p:sSt:Z")) != -1) {
switch(c) {
case 'a':
apexonly = true;
}
srandom(time(NULL) ^ getpid());
break;
+ case 's':
+ check_all_sigs = 1;
+ break;
case 'S':
do_sigchase = true;
/* may chase */