continue;
}
- if (check_successor &&
- keymgr_key_match_state(dkey->key, key->key, type,
- next_state, states2))
- {
- /* Found a possible successor, look for predecessor. */
- for (dns_dnsseckey_t *pkey = ISC_LIST_HEAD(*keyring);
- pkey != NULL; pkey = ISC_LIST_NEXT(pkey, link))
- {
- if (pkey == dkey) {
- continue;
- }
- if (!keymgr_key_match_state(pkey->key, key->key,
- type, next_state,
- states)) {
- continue;
- }
+ if (!keymgr_key_match_state(dkey->key, key->key, type,
+ next_state, states)) {
+ continue;
+ }
- /*
- * Found a possible predecessor, check
- * relationship.
- */
- if (keymgr_key_is_successor(pkey->key,
- dkey->key)) {
- return (true);
- }
- }
+ /* Found a match. */
+ if (!check_successor) {
+ return (true);
}
- if (!check_successor &&
- keymgr_key_match_state(dkey->key, key->key, type,
- next_state, states))
+ /*
+ * We have to make sure that the key we are checking, also
+ * has a successor relationship with another key.
+ */
+ for (dns_dnsseckey_t *skey = ISC_LIST_HEAD(*keyring);
+ skey != NULL; skey = ISC_LIST_NEXT(skey, link))
{
- return (true);
+ if (skey == dkey) {
+ continue;
+ }
+
+ if (!keymgr_key_match_state(skey->key, key->key, type,
+ next_state, states2)) {
+ continue;
+ }
+
+ /*
+ * Found a possible successor, check.
+ */
+ if (keymgr_key_is_successor(dkey->key, skey->key,
+ key->key, type, next_state,
+ keyring))
+ {
+ return (true);
+ }
}
}
/* No match. */
for (dns_dnsseckey_t *successor = ISC_LIST_HEAD(*keyring);
successor != NULL; successor = ISC_LIST_NEXT(successor, link))
{
- if (keymgr_key_is_successor(predecessor->key, successor->key)) {
+ if (keymgr_direct_dep(predecessor->key, successor->key)) {
return (true);
}
}
if (!dst_key_is_unused(dkey->key) &&
(dst_key_goal(dkey->key) ==
OMNIPRESENT) &&
- !keymgr_key_is_successor(
- dkey->key,
- active_key->key) &&
- !keymgr_key_is_successor(
- active_key->key, dkey->key))
+ !keymgr_dep(dkey->key, keyring,
+ NULL) &&
+ !keymgr_dep(active_key->key,
+ keyring, NULL))
{
/*
* Multiple signing keys match