mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Fail processing incoming DNS message on first validation failure
Stop processing the DNS validation when first validation failure occurs in the DNS message.
This commit is contained in:
parent
439e16e4de
commit
0add293477
2 changed files with 8 additions and 14 deletions
|
|
@ -148,6 +148,7 @@ struct dns_validator {
|
|||
unsigned int depth;
|
||||
unsigned int authcount;
|
||||
unsigned int authfail;
|
||||
bool failed;
|
||||
isc_stdtime_t start;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1591,20 +1591,9 @@ validate_answer(dns_validator_t *val, bool resume) {
|
|||
continue;
|
||||
}
|
||||
|
||||
do {
|
||||
isc_result_t tresult;
|
||||
vresult = verify(val, val->key, &rdata,
|
||||
val->siginfo->keyid);
|
||||
if (vresult == ISC_R_SUCCESS) {
|
||||
break;
|
||||
}
|
||||
|
||||
tresult = select_signing_key(val, val->keyset);
|
||||
if (tresult != ISC_R_SUCCESS) {
|
||||
break;
|
||||
}
|
||||
} while (1);
|
||||
vresult = verify(val, val->key, &rdata, val->siginfo->keyid);
|
||||
if (vresult != ISC_R_SUCCESS) {
|
||||
val->failed = true;
|
||||
validator_log(val, ISC_LOG_DEBUG(3),
|
||||
"failed to verify rdataset");
|
||||
} else {
|
||||
|
|
@ -1641,9 +1630,13 @@ validate_answer(dns_validator_t *val, bool resume) {
|
|||
} else {
|
||||
validator_log(val, ISC_LOG_DEBUG(3),
|
||||
"verify failure: %s",
|
||||
isc_result_totext(result));
|
||||
isc_result_totext(vresult));
|
||||
resume = false;
|
||||
}
|
||||
if (val->failed) {
|
||||
result = ISC_R_NOMORE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (result != ISC_R_NOMORE) {
|
||||
validator_log(val, ISC_LOG_DEBUG(3),
|
||||
|
|
|
|||
Loading…
Reference in a new issue