aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-12-22 22:03:00 +0100
committerBrian Behlendorf <[email protected]>2022-02-15 16:23:19 -0800
commit959b9d63927a18d711c8d49c9b904d0f3c7a1fa4 (patch)
tree8bf03a5bd22cc4b7038d5a1c31433bb1910ec298
parent9cdf015d0a1713c213f1bd5cbda956995a79c74c (diff)
module: icp: spi: remove crypto_control_ops_t
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12901
-rw-r--r--module/icp/core/kcf_prov_tabs.c9
-rw-r--r--module/icp/include/sys/crypto/impl.h12
-rw-r--r--module/icp/include/sys/crypto/spi.h20
-rw-r--r--module/icp/io/aes.c17
-rw-r--r--module/icp/io/sha2_mod.c17
-rw-r--r--module/icp/io/skein_mod.c17
-rw-r--r--module/icp/spi/kcf_spi.c1
7 files changed, 0 insertions, 93 deletions
diff --git a/module/icp/core/kcf_prov_tabs.c b/module/icp/core/kcf_prov_tabs.c
index 1f501f0ba..59ff07133 100644
--- a/module/icp/core/kcf_prov_tabs.c
+++ b/module/icp/core/kcf_prov_tabs.c
@@ -208,10 +208,6 @@ static void
allocate_ops_v1(const crypto_ops_t *src, crypto_ops_t *dst,
uint_t *mech_list_count)
{
- if (src->co_control_ops != NULL)
- dst->co_control_ops = kmem_alloc(sizeof (crypto_control_ops_t),
- KM_SLEEP);
-
if (src->co_digest_ops != NULL)
dst->co_digest_ops = kmem_alloc(sizeof (crypto_digest_ops_t),
KM_SLEEP);
@@ -412,11 +408,6 @@ kcf_free_provider_desc(kcf_provider_desc_t *desc)
CRYPTO_PROVIDER_DESCR_MAX_LEN + 1);
if (desc->pd_ops_vector != NULL) {
-
- if (desc->pd_ops_vector->co_control_ops != NULL)
- kmem_free(desc->pd_ops_vector->co_control_ops,
- sizeof (crypto_control_ops_t));
-
if (desc->pd_ops_vector->co_digest_ops != NULL)
kmem_free(desc->pd_ops_vector->co_digest_ops,
sizeof (crypto_digest_ops_t));
diff --git a/module/icp/include/sys/crypto/impl.h b/module/icp/include/sys/crypto/impl.h
index 4906549b5..bb777e689 100644
--- a/module/icp/include/sys/crypto/impl.h
+++ b/module/icp/include/sys/crypto/impl.h
@@ -509,7 +509,6 @@ typedef struct crypto_minor {
* of type kcf_prov_desc_t.
*/
-#define KCF_PROV_CONTROL_OPS(pd) ((pd)->pd_ops_vector->co_control_ops)
#define KCF_PROV_CTX_OPS(pd) ((pd)->pd_ops_vector->co_ctx_ops)
#define KCF_PROV_DIGEST_OPS(pd) ((pd)->pd_ops_vector->co_digest_ops)
#define KCF_PROV_CIPHER_OPS(pd) ((pd)->pd_ops_vector->co_cipher_ops)
@@ -529,17 +528,6 @@ typedef struct crypto_minor {
((pd)->pd_ops_vector->co_nostore_key_ops)
/*
- * Wrappers for crypto_control_ops(9S) entry points.
- */
-
-#define KCF_PROV_STATUS(pd, status) ( \
- (KCF_PROV_CONTROL_OPS(pd) && \
- KCF_PROV_CONTROL_OPS(pd)->provider_status) ? \
- KCF_PROV_CONTROL_OPS(pd)->provider_status( \
- (pd)->pd_prov_handle, status) : \
- CRYPTO_NOT_SUPPORTED)
-
-/*
* Wrappers for crypto_ctx_ops(9S) entry points.
*/
diff --git a/module/icp/include/sys/crypto/spi.h b/module/icp/include/sys/crypto/spi.h
index 8938b25ea..4a4909544 100644
--- a/module/icp/include/sys/crypto/spi.h
+++ b/module/icp/include/sys/crypto/spi.h
@@ -120,16 +120,6 @@ typedef struct crypto_ctx {
#define CRYPTO_EXTF_SO_PIN_TO_BE_CHANGED 0x00800000
/*
- * The crypto_control_ops structure contains pointers to control
- * operations for cryptographic providers. It is passed through
- * the crypto_ops(9S) structure when providers register with the
- * kernel using crypto_register_provider(9F).
- */
-typedef struct crypto_control_ops {
- void (*provider_status)(crypto_provider_handle_t, uint_t *);
-} __no_const crypto_control_ops_t;
-
-/*
* The crypto_ctx_ops structure contains points to context and context
* templates management operations for cryptographic providers. It is
* passed through the crypto_ops(9S) structure when providers register
@@ -498,7 +488,6 @@ typedef struct crypto_nostore_key_ops {
* by calling crypto_register_provider(9F).
*/
typedef struct crypto_ops_v1 {
- const crypto_control_ops_t *co_control_ops;
const crypto_digest_ops_t *co_digest_ops;
const crypto_cipher_ops_t *co_cipher_ops;
const crypto_mac_ops_t *co_mac_ops;
@@ -532,7 +521,6 @@ typedef struct crypto_ops {
} cou;
} crypto_ops_t;
-#define co_control_ops cou.cou_v1.co_control_ops
#define co_digest_ops cou.cou_v1.co_digest_ops
#define co_cipher_ops cou.cou_v1.co_cipher_ops
#define co_mac_ops cou.cou_v1.co_mac_ops
@@ -698,14 +686,6 @@ typedef struct crypto_provider_info {
#define CRYPTO_PIFLAGS_RESERVED1 0x80000000
/*
- * Provider status passed by a provider to crypto_provider_notification(9F)
- * and returned by the provider_status(9E) entry point.
- */
-#define CRYPTO_PROVIDER_READY 0
-#define CRYPTO_PROVIDER_BUSY 1
-#define CRYPTO_PROVIDER_FAILED 2
-
-/*
* Functions exported by Solaris to cryptographic providers. Providers
* call these functions to register and unregister, notify the kernel
* of state changes, and notify the kernel when a asynchronous request
diff --git a/module/icp/io/aes.c b/module/icp/io/aes.c
index e1bd17335..510764e7b 100644
--- a/module/icp/io/aes.c
+++ b/module/icp/io/aes.c
@@ -75,12 +75,6 @@ static const crypto_mech_info_t aes_mech_info_tab[] = {
AES_MIN_KEY_BYTES, AES_MAX_KEY_BYTES, CRYPTO_KEYSIZE_UNIT_IN_BYTES}
};
-static void aes_provider_status(crypto_provider_handle_t, uint_t *);
-
-static const crypto_control_ops_t aes_control_ops = {
- aes_provider_status
-};
-
static int aes_encrypt_init(crypto_ctx_t *, crypto_mechanism_t *,
crypto_key_t *, crypto_spi_ctx_template_t, crypto_req_handle_t);
static int aes_decrypt_init(crypto_ctx_t *, crypto_mechanism_t *,
@@ -150,7 +144,6 @@ static const crypto_ctx_ops_t aes_ctx_ops = {
};
static const crypto_ops_t aes_crypto_ops = {{{{{
- &aes_control_ops,
NULL,
&aes_cipher_ops,
&aes_mac_ops,
@@ -284,16 +277,6 @@ init_keysched(crypto_key_t *key, void *newbie)
return (CRYPTO_SUCCESS);
}
-/*
- * KCF software provider control entry points.
- */
-static void
-aes_provider_status(crypto_provider_handle_t provider, uint_t *status)
-{
- (void) provider;
- *status = CRYPTO_PROVIDER_READY;
-}
-
static int
aes_encrypt_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism,
crypto_key_t *key, crypto_spi_ctx_template_t template,
diff --git a/module/icp/io/sha2_mod.c b/module/icp/io/sha2_mod.c
index 7ee16e137..df25d1544 100644
--- a/module/icp/io/sha2_mod.c
+++ b/module/icp/io/sha2_mod.c
@@ -105,12 +105,6 @@ static const crypto_mech_info_t sha2_mech_info_tab[] = {
CRYPTO_KEYSIZE_UNIT_IN_BYTES}
};
-static void sha2_provider_status(crypto_provider_handle_t, uint_t *);
-
-static const crypto_control_ops_t sha2_control_ops = {
- sha2_provider_status
-};
-
static int sha2_digest_init(crypto_ctx_t *, crypto_mechanism_t *,
crypto_req_handle_t);
static int sha2_digest(crypto_ctx_t *, crypto_data_t *, crypto_data_t *,
@@ -164,7 +158,6 @@ static const crypto_ctx_ops_t sha2_ctx_ops = {
};
static const crypto_ops_t sha2_crypto_ops = {{{{{
- &sha2_control_ops,
&sha2_digest_ops,
NULL,
&sha2_mac_ops,
@@ -230,16 +223,6 @@ sha2_mod_fini(void)
}
/*
- * KCF software provider control entry points.
- */
-static void
-sha2_provider_status(crypto_provider_handle_t provider, uint_t *status)
-{
- (void) provider;
- *status = CRYPTO_PROVIDER_READY;
-}
-
-/*
* KCF software provider digest entry points.
*/
diff --git a/module/icp/io/skein_mod.c b/module/icp/io/skein_mod.c
index d0917e71b..b54685873 100644
--- a/module/icp/io/skein_mod.c
+++ b/module/icp/io/skein_mod.c
@@ -51,12 +51,6 @@ static const crypto_mech_info_t skein_mech_info_tab[] = {
CRYPTO_KEYSIZE_UNIT_IN_BYTES}
};
-static void skein_provider_status(crypto_provider_handle_t, uint_t *);
-
-static const crypto_control_ops_t skein_control_ops = {
- skein_provider_status
-};
-
static int skein_digest_init(crypto_ctx_t *, crypto_mechanism_t *,
crypto_req_handle_t);
static int skein_digest(crypto_ctx_t *, crypto_data_t *, crypto_data_t *,
@@ -102,7 +96,6 @@ static const crypto_ctx_ops_t skein_ctx_ops = {
};
static const crypto_ops_t skein_crypto_ops = {{{{{
- &skein_control_ops,
&skein_digest_ops,
NULL,
&skein_mac_ops,
@@ -223,16 +216,6 @@ skein_mod_fini(void)
}
/*
- * KCF software provider control entry points.
- */
-static void
-skein_provider_status(crypto_provider_handle_t provider, uint_t *status)
-{
- (void) provider;
- *status = CRYPTO_PROVIDER_READY;
-}
-
-/*
* General Skein hashing helper functions.
*/
diff --git a/module/icp/spi/kcf_spi.c b/module/icp/spi/kcf_spi.c
index e6b8e29a1..7e7487912 100644
--- a/module/icp/spi/kcf_spi.c
+++ b/module/icp/spi/kcf_spi.c
@@ -72,7 +72,6 @@ static const kcf_prov_stats_t kcf_stats_ks_data_template = {
static void
copy_ops_vector_v1(const crypto_ops_t *src_ops, crypto_ops_t *dst_ops)
{
- KCF_SPI_COPY_OPS(src_ops, dst_ops, co_control_ops);
KCF_SPI_COPY_OPS(src_ops, dst_ops, co_digest_ops);
KCF_SPI_COPY_OPS(src_ops, dst_ops, co_cipher_ops);
KCF_SPI_COPY_OPS(src_ops, dst_ops, co_mac_ops);