mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-27 21:04:17 -04:00
Fix keymgr key init bug
The 'keymgr_key_init()' function initializes key states if they have not been set previously. It looks at the key timing metadata and determines using the given times whether a state should be set to RUMOURED or OMNIPRESENT. However, the DNSKEY and ZRRSIG states were mixed up: When looking at the Activate timing metadata we should set the ZRRSIG state, and when looking at the Published timing metadata we should set the DNSKEY state.
This commit is contained in:
parent
c40c1ebcb1
commit
27e7d5f698
1 changed files with 10 additions and 10 deletions
|
|
@ -1549,23 +1549,23 @@ keymgr_key_init(dns_dnsseckey_t *key, dns_kasp_t *kasp, isc_stdtime_t now) {
|
|||
/* Get time metadata. */
|
||||
ret = dst_key_gettime(key->key, DST_TIME_ACTIVATE, &active);
|
||||
if (active <= now && ret == ISC_R_SUCCESS) {
|
||||
dns_ttl_t key_ttl = dst_key_getttl(key->key);
|
||||
key_ttl += dns_kasp_zonepropagationdelay(kasp);
|
||||
if ((active + key_ttl) <= now) {
|
||||
dnskey_state = OMNIPRESENT;
|
||||
dns_ttl_t zone_ttl = dns_kasp_zonemaxttl(kasp);
|
||||
zone_ttl += dns_kasp_zonepropagationdelay(kasp);
|
||||
if ((active + zone_ttl) <= now) {
|
||||
zrrsig_state = OMNIPRESENT;
|
||||
} else {
|
||||
dnskey_state = RUMOURED;
|
||||
zrrsig_state = RUMOURED;
|
||||
}
|
||||
goal_state = OMNIPRESENT;
|
||||
}
|
||||
ret = dst_key_gettime(key->key, DST_TIME_PUBLISH, &pub);
|
||||
if (pub <= now && ret == ISC_R_SUCCESS) {
|
||||
dns_ttl_t zone_ttl = dns_kasp_zonemaxttl(kasp);
|
||||
zone_ttl += dns_kasp_zonepropagationdelay(kasp);
|
||||
if ((pub + zone_ttl) <= now) {
|
||||
zrrsig_state = OMNIPRESENT;
|
||||
dns_ttl_t key_ttl = dst_key_getttl(key->key);
|
||||
key_ttl += dns_kasp_zonepropagationdelay(kasp);
|
||||
if ((pub + key_ttl) <= now) {
|
||||
dnskey_state = OMNIPRESENT;
|
||||
} else {
|
||||
zrrsig_state = RUMOURED;
|
||||
dnskey_state = RUMOURED;
|
||||
}
|
||||
goal_state = OMNIPRESENT;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue