module: icp: remove unused p[di]_flags

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12901
This commit is contained in:
наб 2021-12-24 17:04:32 +01:00 committed by Brian Behlendorf
parent d77702035a
commit f3c3a6d47e
4 changed files with 1 additions and 47 deletions

View File

@ -114,8 +114,7 @@ kcf_get_mech_provider(crypto_mech_type_t mech_type, kcf_mech_entry_t **mepp,
pd = mdesc->pm_prov_desc; pd = mdesc->pm_prov_desc;
if (!IS_FG_SUPPORTED(mdesc, fg) || if (!IS_FG_SUPPORTED(mdesc, fg) ||
!KCF_IS_PROV_USABLE(pd) || !KCF_IS_PROV_USABLE(pd) ||
IS_PROVIDER_TRIED(pd, triedl) || IS_PROVIDER_TRIED(pd, triedl))
(pd->pd_flags & KCF_PROV_RESTRICTED))
pd = NULL; pd = NULL;
} }

View File

@ -145,9 +145,6 @@ typedef enum {
#define KCF_IS_PROV_USABLE(pd) ((pd)->pd_state == KCF_PROV_READY) #define KCF_IS_PROV_USABLE(pd) ((pd)->pd_state == KCF_PROV_READY)
#define KCF_IS_PROV_REMOVED(pd) ((pd)->pd_state >= KCF_PROV_REMOVED) #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 * A provider descriptor structure. There is one such structure per
* provider. It is allocated and initialized at registration time and * provider. It is allocated and initialized at registration time and
@ -170,8 +167,6 @@ typedef enum {
* by the provider during registration * by the provider during registration
* pd_remove_cv: cv to wait on while the provider queue drains * pd_remove_cv: cv to wait on while the provider queue drains
* pd_description: Provider description string * 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 * pd_hash_limit Maximum data size that hash mechanisms of this provider
* can support. * can support.
* pd_kcf_prov_handle: KCF-private handle assigned by KCF * 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; uint_t pd_mech_list_count;
kcondvar_t pd_remove_cv; kcondvar_t pd_remove_cv;
const char *pd_description; const char *pd_description;
uint_t pd_flags;
uint_t pd_hash_limit; uint_t pd_hash_limit;
crypto_kcf_provider_handle_t pd_kcf_prov_handle; crypto_kcf_provider_handle_t pd_kcf_prov_handle;
crypto_provider_id_t pd_prov_id; crypto_provider_id_t pd_prov_id;

View File

@ -236,13 +236,6 @@ typedef struct crypto_mech_info {
ssize_t cm_max_key_length; ssize_t cm_max_key_length;
uint32_t cm_mech_flags; uint32_t cm_mech_flags;
} crypto_mech_info_t; } 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 #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; const crypto_ops_t *pi_ops_vector;
uint_t pi_mech_list_count; uint_t pi_mech_list_count;
const crypto_mech_info_t *pi_mechanisms; const crypto_mech_info_t *pi_mechanisms;
uint_t pi_flags;
} crypto_provider_info_t; } 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 * Functions exported by Solaris to cryptographic providers. Providers
* call these functions to register and unregister, notify the kernel * call these functions to register and unregister, notify the kernel

View File

@ -77,7 +77,6 @@ crypto_register_provider(const crypto_provider_info_t *info,
/* Change from Illumos: the ops vector is persistent. */ /* Change from Illumos: the ops vector is persistent. */
prov_desc->pd_ops_vector = info->pi_ops_vector; prov_desc->pd_ops_vector = info->pi_ops_vector;
prov_desc->pd_flags = info->pi_flags;
/* process the mechanisms supported by the provider */ /* process the mechanisms supported by the provider */
if ((ret = init_prov_mechs(info, prov_desc)) != CRYPTO_SUCCESS) 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; 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)) != if ((err = kcf_add_mech_provider(mech_idx, desc, &pmd)) !=
KCF_SUCCESS) KCF_SUCCESS)
break; break;