diff options
author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2021-12-23 17:27:44 +0000 |
---|---|---|
committer | Brian Behlendorf <behlendorf1@llnl.gov> | 2022-02-16 00:23:40 +0000 |
commit | b0502ab09721aec6867b991c437b9d63df08ff3d (patch) | |
tree | c15daad58cb4acbb74eacbfcd7efdac96f517392 /module/icp/spi | |
parent | d59a7fae403f8d91b3512a559ec89432c87051a7 (diff) | |
download | src-b0502ab09721aec6867b991c437b9d63df08ff3d.tar.gz src-b0502ab09721aec6867b991c437b9d63df08ff3d.zip |
Diffstat (limited to 'module/icp/spi')
-rw-r--r-- | module/icp/spi/kcf_spi.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/module/icp/spi/kcf_spi.c b/module/icp/spi/kcf_spi.c index bf772ec335be..284b56b85fa7 100644 --- a/module/icp/spi/kcf_spi.c +++ b/module/icp/spi/kcf_spi.c @@ -58,26 +58,6 @@ static const kcf_prov_stats_t kcf_stats_ks_data_template = { { "kcf_ops_returned_busy", KSTAT_DATA_UINT64 } }; -#define KCF_SPI_COPY_OPS(src, dst, ops) if ((src)->ops != NULL) \ - memcpy((void *) (dst)->ops, (src)->ops, sizeof (*(src)->ops)); - -/* - * Copy an ops vector from src to dst. Used during provider registration - * to copy the ops vector from the provider info structure to the - * provider descriptor maintained by KCF. - * Copying the ops vector specified by the provider is needed since the - * framework does not require the provider info structure to be - * persistent. - */ -static void -copy_ops_vector(const crypto_ops_t *src_ops, crypto_ops_t *dst_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); - KCF_SPI_COPY_OPS(src_ops, dst_ops, co_ctx_ops); -} - /* * This routine is used to add cryptographic providers to the KEF framework. * Providers pass a crypto_provider_info structure to crypto_register_provider() @@ -130,12 +110,9 @@ crypto_register_provider(const crypto_provider_info_t *info, (size_t)CRYPTO_PROVIDER_DESCR_MAX_LEN)); } + /* Change from Illumos: the ops vector is persistent. */ if (info->pi_provider_type != CRYPTO_LOGICAL_PROVIDER) { - if (info->pi_ops_vector == NULL) { - goto bail; - } - crypto_ops_t *pvec = (crypto_ops_t *)prov_desc->pd_ops_vector; - copy_ops_vector(info->pi_ops_vector, pvec); + prov_desc->pd_ops_vector = info->pi_ops_vector; prov_desc->pd_flags = info->pi_flags; } |