Commit 6743258f authored by Libor Peltan's avatar Libor Peltan

knotc (mostly): submittion-confirm without keytag as parameter

parent 5edc3446
......@@ -346,12 +346,6 @@ static int zone_sign(zone_t *zone, ctl_args_t *args)
static int zone_ksk_sbm_confirm(zone_t *zone, ctl_args_t *args)
{
const char *data = args->data[KNOT_CTL_IDX_OWNER];
uint16_t keytag;
if (data == NULL || sscanf(data, "%hu", &keytag) != 1) {
return KNOT_EINVAL;
}
kdnssec_ctx_t ctx = { 0 };
int ret = kdnssec_ctx_init(conf(), &ctx, zone->name, NULL);
......@@ -359,7 +353,7 @@ static int zone_ksk_sbm_confirm(zone_t *zone, ctl_args_t *args)
return ret;
}
ret = knot_dnssec_ksk_sbm_confirm(&ctx, keytag);
ret = knot_dnssec_ksk_sbm_confirm(&ctx);
kdnssec_ctx_deinit(&ctx);
......
......@@ -431,12 +431,11 @@ int knot_dnssec_key_rollover(kdnssec_ctx_t *ctx, zone_sign_reschedule_t *resched
return (ret == KNOT_ESEMCHECK ? KNOT_EOK : ret);
}
int knot_dnssec_ksk_sbm_confirm(kdnssec_ctx_t *ctx, uint16_t for_key)
int knot_dnssec_ksk_sbm_confirm(kdnssec_ctx_t *ctx)
{
for (size_t i = 0; i < ctx->zone->num_keys; i++) {
knot_kasp_key_t *key = &ctx->zone->keys[i];
if (dnssec_key_get_flags(key->key) == DNSKEY_FLAGS_KSK &&
dnssec_key_get_keytag(key->key) == for_key &&
get_key_state(key, ctx->now) == DNSSEC_KEY_STATE_READY) {
int ret = exec_new_signatures(ctx, key);
if (ret == KNOT_EOK) {
......
......@@ -38,6 +38,6 @@
*/
int knot_dnssec_key_rollover(kdnssec_ctx_t *ctx, zone_sign_reschedule_t *reschedule);
int knot_dnssec_ksk_sbm_confirm(kdnssec_ctx_t *ctx, uint16_t for_key);
int knot_dnssec_ksk_sbm_confirm(kdnssec_ctx_t *ctx);
bool zone_has_key_sbm(const kdnssec_ctx_t *ctx);
......@@ -200,7 +200,7 @@ int event_parent_ds_q(conf_t *conf, zone_t *zone)
if (dnssec_key_get_flags(key->key) == DNSKEY_FLAGS_KSK &&
key->is_ready && !key->is_active) {
if (parents_have_ds(zone, conf, key)) {
ret = knot_dnssec_ksk_sbm_confirm(&ctx, dnssec_key_get_keytag(key->key)); // TODO get rid of keytag
ret = knot_dnssec_ksk_sbm_confirm(&ctx);
} else {
ret = KNOT_ENOENT;
}
......
......@@ -1062,7 +1062,7 @@ const cmd_desc_t cmd_table[] = {
{ CMD_ZONE_RETRANSFER, cmd_zone_ctl, CTL_ZONE_RETRANSFER, CMD_FOPT_ZONE },
{ CMD_ZONE_FLUSH, cmd_zone_filter_ctl, CTL_ZONE_FLUSH, CMD_FOPT_ZONE },
{ CMD_ZONE_SIGN, cmd_zone_ctl, CTL_ZONE_SIGN, CMD_FOPT_ZONE },
{ CMD_ZONE_SBM_CONFIRM, cmd_zone_node_ctl, CTL_ZONE_SBM_CONFIRM, CMD_FREQ_ZONE },
{ CMD_ZONE_SBM_CONFIRM, cmd_zone_ctl, CTL_ZONE_SBM_CONFIRM, CMD_FREQ_ZONE },
{ CMD_ZONE_FREEZE, cmd_zone_ctl, CTL_ZONE_FREEZE, CMD_FOPT_ZONE },
{ CMD_ZONE_THAW, cmd_zone_ctl, CTL_ZONE_THAW, CMD_FOPT_ZONE },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment