From f3c3a6d47e0296723cf6a478283e6dfc3eb1cd96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Fri, 24 Dec 2021 17:04:32 +0100 Subject: [PATCH] module: icp: remove unused p[di]_flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #12901 --- module/icp/core/kcf_callprov.c | 3 +-- module/icp/include/sys/crypto/impl.h | 6 ------ module/icp/include/sys/crypto/spi.h | 20 -------------------- module/icp/spi/kcf_spi.c | 19 ------------------- 4 files changed, 1 insertion(+), 47 deletions(-) diff --git a/module/icp/core/kcf_callprov.c b/module/icp/core/kcf_callprov.c index 270579061f..8059670a1c 100644 --- a/module/icp/core/kcf_callprov.c +++ b/module/icp/core/kcf_callprov.c @@ -114,8 +114,7 @@ kcf_get_mech_provider(crypto_mech_type_t mech_type, kcf_mech_entry_t **mepp, pd = mdesc->pm_prov_desc; if (!IS_FG_SUPPORTED(mdesc, fg) || !KCF_IS_PROV_USABLE(pd) || - IS_PROVIDER_TRIED(pd, triedl) || - (pd->pd_flags & KCF_PROV_RESTRICTED)) + IS_PROVIDER_TRIED(pd, triedl)) pd = NULL; } diff --git a/module/icp/include/sys/crypto/impl.h b/module/icp/include/sys/crypto/impl.h index 8b45c0536e..a2be8849c4 100644 --- a/module/icp/include/sys/crypto/impl.h +++ b/module/icp/include/sys/crypto/impl.h @@ -145,9 +145,6 @@ typedef enum { #define KCF_IS_PROV_USABLE(pd) ((pd)->pd_state == KCF_PROV_READY) #define KCF_IS_PROV_REMOVED(pd) ((pd)->pd_state >= KCF_PROV_REMOVED) -/* Internal flags valid for pd_flags field */ -#define KCF_PROV_RESTRICTED 0x40000000 - /* * A provider descriptor structure. There is one such structure per * provider. It is allocated and initialized at registration time and @@ -170,8 +167,6 @@ typedef enum { * by the provider during registration * pd_remove_cv: cv to wait on while the provider queue drains * pd_description: Provider description string - * pd_flags bitwise OR of pi_flags from crypto_provider_info_t - * and other internal flags defined above. * pd_hash_limit Maximum data size that hash mechanisms of this provider * can support. * pd_kcf_prov_handle: KCF-private handle assigned by KCF @@ -195,7 +190,6 @@ typedef struct kcf_provider_desc { uint_t pd_mech_list_count; kcondvar_t pd_remove_cv; const char *pd_description; - uint_t pd_flags; uint_t pd_hash_limit; crypto_kcf_provider_handle_t pd_kcf_prov_handle; crypto_provider_id_t pd_prov_id; diff --git a/module/icp/include/sys/crypto/spi.h b/module/icp/include/sys/crypto/spi.h index fdf8d85114..a047a30a06 100644 --- a/module/icp/include/sys/crypto/spi.h +++ b/module/icp/include/sys/crypto/spi.h @@ -236,13 +236,6 @@ typedef struct crypto_mech_info { ssize_t cm_max_key_length; uint32_t cm_mech_flags; } crypto_mech_info_t; - - -/* - * The following is used by a provider that sets - * CRYPTO_HASH_NO_UPDATE. It needs to specify the maximum - * input data size it can digest in this field. - */ #define cm_max_input_length cm_max_key_length /* @@ -266,21 +259,8 @@ typedef struct crypto_provider_info { const crypto_ops_t *pi_ops_vector; uint_t pi_mech_list_count; const crypto_mech_info_t *pi_mechanisms; - uint_t pi_flags; } crypto_provider_info_t; -/* - * provider can not do multi-part digest (updates) and has a limit - * on maximum input data that it can digest. - */ -#define CRYPTO_HASH_NO_UPDATE 0x00000002 - -/* provider can handle the request without returning a CRYPTO_QUEUED */ -#define CRYPTO_SYNCHRONOUS 0x00000004 - -#define CRYPTO_PIFLAGS_RESERVED2 0x40000000 -#define CRYPTO_PIFLAGS_RESERVED1 0x80000000 - /* * Functions exported by Solaris to cryptographic providers. Providers * call these functions to register and unregister, notify the kernel diff --git a/module/icp/spi/kcf_spi.c b/module/icp/spi/kcf_spi.c index e40291a129..89ecb4e411 100644 --- a/module/icp/spi/kcf_spi.c +++ b/module/icp/spi/kcf_spi.c @@ -77,7 +77,6 @@ crypto_register_provider(const crypto_provider_info_t *info, /* Change from Illumos: the ops vector is persistent. */ prov_desc->pd_ops_vector = info->pi_ops_vector; - prov_desc->pd_flags = info->pi_flags; /* process the mechanisms supported by the provider */ if ((ret = init_prov_mechs(info, prov_desc)) != CRYPTO_SUCCESS) @@ -279,24 +278,6 @@ init_prov_mechs(const crypto_provider_info_t *info, kcf_provider_desc_t *desc) break; } - if (desc->pd_flags & CRYPTO_HASH_NO_UPDATE && - mi->cm_func_group_mask & CRYPTO_FG_DIGEST) { - /* - * We ask the provider to specify the limit - * per hash mechanism. But, in practice, a - * hardware limitation means all hash mechanisms - * will have the same maximum size allowed for - * input data. So, we make it a per provider - * limit to keep it simple. - */ - if (mi->cm_max_input_length == 0) { - err = CRYPTO_ARGUMENTS_BAD; - break; - } else { - desc->pd_hash_limit = mi->cm_max_input_length; - } - } - if ((err = kcf_add_mech_provider(mech_idx, desc, &pmd)) != KCF_SUCCESS) break;