mirror of
https://gitlab.nic.cz/knot/knot-dns.git
synced 2026-05-28 04:02:31 -04:00
WIP fixup! WIP keymgr: add the 'import-trash' command
This commit is contained in:
parent
a1662b6b03
commit
b66a054e52
3 changed files with 1 additions and 25 deletions
|
|
@ -543,18 +543,6 @@ knot_kasp_keystore_t *knot_store_for_key(knot_kasp_keystore_t *keystores, bool k
|
|||
return NULL;
|
||||
}
|
||||
|
||||
bool knot_store_ok_for_key(knot_kasp_keystore_t *keystores, const char *kst_name, bool ksk)
|
||||
{
|
||||
size_t len = strlen(kst_name);
|
||||
for (size_t i = 0; i < keystores[0].count; i++) {
|
||||
if ((ksk || !keystores[i].ksk_only) &&
|
||||
strncmp(keystores[i].name, kst_name, len) == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Load private keys for active keys.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -160,18 +160,6 @@ int kdnssec_load_private(knot_kasp_keystore_t *keystores, const char *id,
|
|||
*/
|
||||
knot_kasp_keystore_t *knot_store_for_key(knot_kasp_keystore_t *keystores, bool ksk);
|
||||
|
||||
/*!
|
||||
* \brief Find out if there is a keystore of the same name suitable for the key.
|
||||
*
|
||||
* \param keystores Array of keystores.
|
||||
* \param kst_name Required name of the keystore.
|
||||
* \param ksk If the generated key is a KSK or CSK.
|
||||
*
|
||||
* \return true if there is a suitable keystore of the given name, false otherwise
|
||||
*/
|
||||
bool knot_store_ok_for_key(knot_kasp_keystore_t *keystores, const char *kst_name,
|
||||
bool ksk);
|
||||
|
||||
/*!
|
||||
* \brief Load zone keys and init cryptographic context.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -806,7 +806,7 @@ int keymgr_import_trash(kdnssec_ctx_t *ctx, char *key_id, int argc, char *argv[]
|
|||
return KNOT_DNSSEC_ENOKEYSTORE;
|
||||
}
|
||||
|
||||
if (!knot_store_ok_for_key(ctx->keystores, info.ks_name, params.is_ksk)) {
|
||||
if (!params.is_ksk && info.ksk_only) {
|
||||
WARN2("key %s: policy configuration conflict for keystore %s and this key",
|
||||
key_id, info.ks_name);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue