* the delegation.
*
* Returns:
- *\li #ISC_R_SUCCESS the NS bitmap was set in the NSEC or NSEC3 record, or
- * the NSEC3 covers the name (in case of opt-out), or
- * we cannot validate the insecurity proof and are going
- * to treat the message as isnecure.
- *\li #ISC_R_NOTFOUND the NS bitmap was not set,
+ *\li #true the NS bitmap was set in the NSEC or NSEC3 record, or
+ * the NSEC3 covers the name (in case of opt-out), or
+ * we cannot validate the insecurity proof and are going
+ * to treat the message as insecure.
+ *\li #false the NS bitmap was not set.
*/
-static isc_result_t
+static bool
isdelegation(dns_validator_t *val, dns_name_t *name, dns_rdataset_t *rdataset,
isc_result_t dbresult, const char *caller) {
dns_fixedname_t fixed;
goto trynsec3;
}
if (result != ISC_R_SUCCESS) {
- return ISC_R_NOTFOUND;
+ return false;
}
}
dns_rdata_reset(&rdata);
}
dns_rdataset_disassociate(&set);
- return found ? ISC_R_SUCCESS : ISC_R_NOTFOUND;
+ return found;
trynsec3:
/*
"%s: too many iterations",
caller);
dns_rdataset_disassociate(&set);
- return ISC_R_SUCCESS;
+ return true;
}
length = isc_iterated_hash(
hash, nsec3.hash, nsec3.iterations, nsec3.salt,
found = dns_nsec3_typepresent(&rdata,
dns_rdatatype_ns);
dns_rdataset_disassociate(&set);
- return found ? ISC_R_SUCCESS : ISC_R_NOTFOUND;
+ return found;
}
if ((nsec3.flags & DNS_NSEC3FLAG_OPTOUT) == 0) {
continue;
memcmp(hash, nsec3.next, length) < 0)))
{
dns_rdataset_disassociate(&set);
- return ISC_R_SUCCESS;
+ return true;
}
}
dns_rdataset_disassociate(&set);
}
- return found ? ISC_R_SUCCESS : ISC_R_NOTFOUND;
+ return found;
}
/*%
goto unexpected;
} else if (eresult != DNS_R_CNAME &&
isdelegation(val, devent->foundname, &val->frdataset,
- eresult,
- "fetch_callback_ds") == ISC_R_SUCCESS)
+ eresult, "fetch_callback_ds"))
{
/*
* Failed to find a DS while trying to prove
val->frdataset.covers == dns_rdatatype_ds &&
NEGATIVE(&val->frdataset) &&
isdelegation(val, name, &val->frdataset,
- DNS_R_NCACHENXRRSET,
- "validator_callback_ds") == ISC_R_SUCCESS)
+ DNS_R_NCACHENXRRSET, "validator_callback_ds"))
{
result = markanswer(val, "validator_callback_ds",
"no DS and this is a delegation");
return ISC_R_COMPLETE;
}
- result = isdelegation(val, tname, &val->frdataset, result,
- "seek_ds");
- if (result == ISC_R_SUCCESS) {
+ if (isdelegation(val, tname, &val->frdataset, result,
+ "seek_ds"))
+ {
*resp = markanswer(val, "seek_ds (3)",
"this is a delegation");
return ISC_R_COMPLETE;