aboutsummaryrefslogtreecommitdiffstats
path: root/module/icp/core
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-12-22 22:09:28 +0100
committerBrian Behlendorf <[email protected]>2022-02-15 16:23:24 -0800
commitf5896e2bdf9d8824befe8660c7fe1f77ff773e3b (patch)
tree73c43ac0de0187f9d9e9a929d57999c65c6736e9 /module/icp/core
parent959b9d63927a18d711c8d49c9b904d0f3c7a1fa4 (diff)
module: icp: spi: flatten struct crypto_ops, crypto_provider_info
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
Diffstat (limited to 'module/icp/core')
-rw-r--r--module/icp/core/kcf_prov_tabs.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/module/icp/core/kcf_prov_tabs.c b/module/icp/core/kcf_prov_tabs.c
index 59ff07133..734bf457c 100644
--- a/module/icp/core/kcf_prov_tabs.c
+++ b/module/icp/core/kcf_prov_tabs.c
@@ -205,7 +205,7 @@ kcf_prov_tab_lookup(crypto_provider_id_t prov_id)
}
static void
-allocate_ops_v1(const crypto_ops_t *src, crypto_ops_t *dst,
+allocate_ops(const crypto_ops_t *src, crypto_ops_t *dst,
uint_t *mech_list_count)
{
if (src->co_digest_ops != NULL)
@@ -268,19 +268,11 @@ allocate_ops_v1(const crypto_ops_t *src, crypto_ops_t *dst,
if (src->co_ctx_ops != NULL)
dst->co_ctx_ops = kmem_alloc(sizeof (crypto_ctx_ops_t),
KM_SLEEP);
-}
-static void
-allocate_ops_v2(const crypto_ops_t *src, crypto_ops_t *dst)
-{
if (src->co_mech_ops != NULL)
dst->co_mech_ops = kmem_alloc(sizeof (crypto_mech_ops_t),
KM_SLEEP);
-}
-static void
-allocate_ops_v3(const crypto_ops_t *src, crypto_ops_t *dst)
-{
if (src->co_nostore_key_ops != NULL)
dst->co_nostore_key_ops =
kmem_alloc(sizeof (crypto_nostore_key_ops_t), KM_SLEEP);
@@ -329,11 +321,7 @@ kcf_alloc_provider_desc(const crypto_provider_info_t *info)
crypto_ops_t *opvec = kmem_zalloc(sizeof (crypto_ops_t), KM_SLEEP);
if (info->pi_provider_type != CRYPTO_LOGICAL_PROVIDER) {
- allocate_ops_v1(src_ops, opvec, &mech_list_count);
- if (info->pi_interface_version >= CRYPTO_SPI_VERSION_2)
- allocate_ops_v2(src_ops, opvec);
- if (info->pi_interface_version == CRYPTO_SPI_VERSION_3)
- allocate_ops_v3(src_ops, opvec);
+ allocate_ops(src_ops, opvec, &mech_list_count);
}
desc->pd_ops_vector = opvec;