Commit 4f3b7327 authored by Jan Včelák's avatar Jan Včelák 🚀

libknot: remove useless DNSSEC related functions

parent 4ebf7fb7
......@@ -76,48 +76,3 @@ knot_lookup_table_t knot_dnssec_alg_names[] = {
{ KNOT_DNSSEC_ALG_ECDSAP384SHA384, "ECDSAP384SHA384" },
{ 0, NULL }
};
_public_
size_t knot_ds_digest_length(const uint8_t algorithm)
{
switch (algorithm) {
case KNOT_DS_ALG_SHA1:
return KNOT_DS_DIGEST_LEN_SHA1;
case KNOT_DS_ALG_SHA256:
return KNOT_DS_DIGEST_LEN_SHA256;
case KNOT_DS_ALG_GOST:
return KNOT_DS_DIGEST_LEN_GOST;
case KNOT_DS_ALG_SHA384:
return KNOT_DS_DIGEST_LEN_SHA384;
default:
return 0;
}
}
_public_
bool knot_dnssec_algorithm_is_zonesign(uint8_t algorithm, bool nsec3_enabled)
{
switch (algorithm) {
// NSEC only
case KNOT_DNSSEC_ALG_DSA:
case KNOT_DNSSEC_ALG_RSASHA1:
return !nsec3_enabled;
// NSEC3 only
case KNOT_DNSSEC_ALG_DSA_NSEC3_SHA1:
case KNOT_DNSSEC_ALG_RSASHA1_NSEC3_SHA1:
return true; // allow even with NSEC
// both NSEC and NSEC3
case KNOT_DNSSEC_ALG_RSASHA256:
case KNOT_DNSSEC_ALG_RSASHA512:
case KNOT_DNSSEC_ALG_ECC_GOST:
case KNOT_DNSSEC_ALG_ECDSAP256SHA256:
case KNOT_DNSSEC_ALG_ECDSAP384SHA384:
return true;
// unsupported or unknown
default:
return false;
}
}
......@@ -26,9 +26,6 @@
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "libknot/util/utils.h"
/*!
......@@ -184,23 +181,4 @@ extern knot_lookup_table_t knot_tkey_err_names[];
*/
extern knot_lookup_table_t knot_dnssec_alg_names[];
/*!
* \brief Returns length of TSIG digest for given algorithm.
*
* \param algorithm Algorithm code to be used.
*
* \retval Digest length for given algorithm.
*/
size_t knot_ds_digest_length(const uint8_t algorithm);
/*!
* \brief Check if algorithm is supported for zone signing.
*
* \param algorithm Algorithm identification.
* \param nsec3_enabled NSEC3 enabled for signed zone.
*
* \return Given algorithm is allowed for zone signing.
*/
bool knot_dnssec_algorithm_is_zonesign(uint8_t algorithm, bool nsec3_enabled);
/*! @} */
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