static isc_result_t
keymgr_update(dns_dnsseckeylist_t *keyring, dns_kasp_t *kasp, isc_stdtime_t now,
isc_stdtime_t *nexttime, uint8_t opts) {
+ isc_result_t result = DNS_R_UNCHANGED;
bool changed;
bool force = ((opts & DNS_KEYMGRATTR_FORCESTEP) != 0);
/* We changed something, continue processing. */
if (changed) {
+ result = ISC_R_SUCCESS;
/* No longer force for the next run */
force = false;
goto transition;
}
- return ISC_R_SUCCESS;
+ return result;
}
/*
dns_dnsseckeylist_t *dnskeys, const char *keydir,
dns_kasp_t *kasp, uint8_t opts, isc_stdtime_t now,
isc_stdtime_t *nexttime) {
- isc_result_t result = ISC_R_SUCCESS;
+ isc_result_t result = DNS_R_UNCHANGED;
dns_dnsseckeylist_t newkeys;
int numkeys = 0;
int options = (DST_TYPE_PRIVATE | DST_TYPE_PUBLIC | DST_TYPE_STATE);
}
/* Read to update key states. */
- keymgr_update(keyring, kasp, now, nexttime, opts);
+ isc_result_t retval = keymgr_update(keyring, kasp, now, nexttime, opts);
/* Store key states and update hints. */
ISC_LIST_FOREACH(*keyring, dkey, link) {
if (dst_key_getttl(dkey->key) != dns_kasp_dnskeyttl(kasp)) {
dst_key_setttl(dkey->key, dns_kasp_dnskeyttl(kasp));
modified = true;
+ retval = ISC_R_SUCCESS;
}
if (modified && !dkey->purge) {
const char *directory = dst_key_directory(dkey->key);
dst_key_setmodified(dkey->key, false);
}
- result = ISC_R_SUCCESS;
-
+ result = retval;
failure:
- if (result != ISC_R_SUCCESS) {
+ if (result != ISC_R_SUCCESS && result != DNS_R_UNCHANGED) {
ISC_LIST_FOREACH(newkeys, newkey, link) {
ISC_LIST_UNLINK(newkeys, newkey, link);
INSIST(newkey->key != NULL);
bool newalg = false;
bool fullsign;
bool offlineksk = false;
+ bool kasp_change = false;
uint8_t options = 0;
uint32_t sigval = 0;
dns_ttl_t ttl = 3600;
kasp, options, now, &nexttime);
dns_zone_unlock_keyfiles(zone);
- if (result != ISC_R_SUCCESS) {
+ if (result == ISC_R_SUCCESS) {
+ kasp_change = true;
+ } else if (result == DNS_R_UNCHANGED) {
+ result = ISC_R_SUCCESS;
+ } else {
dnssec_log(zone, ISC_LOG_ERROR,
"zone_rekey:dns_keymgr_run "
"failed: %s",
"allowed");
}
- if (newactive || fullsign || sane_diff) {
+ if (newactive || fullsign || sane_diff || kasp_change) {
CHECK(dns_diff_apply(&diff, db, ver));
CHECK(clean_nsec3param(zone, db, ver, &diff));
CHECK(add_signing_records(db, zone->privatetype, ver,