mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
The validator could fail when select_signing_key/get_dst_key failed
to select the signing key because the algorithm was not supported and the loop was prematurely aborted.
This commit is contained in:
committed by
Matthijs Mekking
parent
30b85fe4a8
commit
d475f3aeed
@@ -1126,24 +1126,25 @@ select_signing_key(dns_validator_t *val, dns_rdataset_t *rdataset) {
|
||||
INSIST(val->key == NULL);
|
||||
result = dst_key_fromdns(&siginfo->signer, rdata.rdclass, &b,
|
||||
val->view->mctx, &val->key);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto failure;
|
||||
}
|
||||
if (siginfo->algorithm == (dns_secalg_t)dst_key_alg(val->key) &&
|
||||
siginfo->keyid == (dns_keytag_t)dst_key_id(val->key) &&
|
||||
dst_key_iszonekey(val->key))
|
||||
{
|
||||
if (foundold) {
|
||||
/*
|
||||
* This is the key we're looking for.
|
||||
*/
|
||||
return (ISC_R_SUCCESS);
|
||||
} else if (dst_key_compare(oldkey, val->key)) {
|
||||
foundold = true;
|
||||
dst_key_free(&oldkey);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
if (siginfo->algorithm ==
|
||||
(dns_secalg_t)dst_key_alg(val->key) &&
|
||||
siginfo->keyid ==
|
||||
(dns_keytag_t)dst_key_id(val->key) &&
|
||||
dst_key_iszonekey(val->key))
|
||||
{
|
||||
if (foundold) {
|
||||
/*
|
||||
* This is the key we're looking for.
|
||||
*/
|
||||
return (ISC_R_SUCCESS);
|
||||
} else if (dst_key_compare(oldkey, val->key)) {
|
||||
foundold = true;
|
||||
dst_key_free(&oldkey);
|
||||
}
|
||||
}
|
||||
dst_key_free(&val->key);
|
||||
}
|
||||
dst_key_free(&val->key);
|
||||
dns_rdata_reset(&rdata);
|
||||
result = dns_rdataset_next(rdataset);
|
||||
} while (result == ISC_R_SUCCESS);
|
||||
|
Reference in New Issue
Block a user