mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
module: icp: remove unused crypto_provider_handle_t
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12901
This commit is contained in:
+19
-25
@@ -87,14 +87,14 @@ static int aes_decrypt_final(crypto_ctx_t *, crypto_data_t *);
|
||||
static int aes_encrypt(crypto_ctx_t *, crypto_data_t *, crypto_data_t *);
|
||||
static int aes_encrypt_update(crypto_ctx_t *, crypto_data_t *,
|
||||
crypto_data_t *);
|
||||
static int aes_encrypt_atomic(crypto_provider_handle_t, crypto_session_id_t,
|
||||
static int aes_encrypt_atomic(crypto_session_id_t,
|
||||
crypto_mechanism_t *, crypto_key_t *, crypto_data_t *,
|
||||
crypto_data_t *, crypto_spi_ctx_template_t);
|
||||
|
||||
static int aes_decrypt(crypto_ctx_t *, crypto_data_t *, crypto_data_t *);
|
||||
static int aes_decrypt_update(crypto_ctx_t *, crypto_data_t *,
|
||||
crypto_data_t *);
|
||||
static int aes_decrypt_atomic(crypto_provider_handle_t, crypto_session_id_t,
|
||||
static int aes_decrypt_atomic(crypto_session_id_t,
|
||||
crypto_mechanism_t *, crypto_key_t *, crypto_data_t *,
|
||||
crypto_data_t *, crypto_spi_ctx_template_t);
|
||||
|
||||
@@ -111,10 +111,10 @@ static const crypto_cipher_ops_t aes_cipher_ops = {
|
||||
.decrypt_atomic = aes_decrypt_atomic
|
||||
};
|
||||
|
||||
static int aes_mac_atomic(crypto_provider_handle_t, crypto_session_id_t,
|
||||
static int aes_mac_atomic(crypto_session_id_t,
|
||||
crypto_mechanism_t *, crypto_key_t *, crypto_data_t *, crypto_data_t *,
|
||||
crypto_spi_ctx_template_t);
|
||||
static int aes_mac_verify_atomic(crypto_provider_handle_t, crypto_session_id_t,
|
||||
static int aes_mac_verify_atomic(crypto_session_id_t,
|
||||
crypto_mechanism_t *, crypto_key_t *, crypto_data_t *, crypto_data_t *,
|
||||
crypto_spi_ctx_template_t);
|
||||
|
||||
@@ -127,9 +127,8 @@ static const crypto_mac_ops_t aes_mac_ops = {
|
||||
.mac_verify_atomic = aes_mac_verify_atomic
|
||||
};
|
||||
|
||||
static int aes_create_ctx_template(crypto_provider_handle_t,
|
||||
crypto_mechanism_t *, crypto_key_t *, crypto_spi_ctx_template_t *,
|
||||
size_t *);
|
||||
static int aes_create_ctx_template(crypto_mechanism_t *, crypto_key_t *,
|
||||
crypto_spi_ctx_template_t *, size_t *);
|
||||
static int aes_free_context(crypto_ctx_t *);
|
||||
|
||||
static const crypto_ctx_ops_t aes_ctx_ops = {
|
||||
@@ -146,7 +145,6 @@ static const crypto_ops_t aes_crypto_ops = {
|
||||
|
||||
static const crypto_provider_info_t aes_prov_info = {
|
||||
"AES Software Provider",
|
||||
NULL,
|
||||
&aes_crypto_ops,
|
||||
sizeof (aes_mech_info_tab) / sizeof (crypto_mech_info_t),
|
||||
aes_mech_info_tab
|
||||
@@ -840,12 +838,12 @@ aes_decrypt_final(crypto_ctx_t *ctx, crypto_data_t *data)
|
||||
}
|
||||
|
||||
static int
|
||||
aes_encrypt_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
aes_encrypt_atomic(crypto_session_id_t session_id,
|
||||
crypto_mechanism_t *mechanism,
|
||||
crypto_key_t *key, crypto_data_t *plaintext, crypto_data_t *ciphertext,
|
||||
crypto_spi_ctx_template_t template)
|
||||
{
|
||||
(void) provider, (void) session_id;
|
||||
(void) session_id;
|
||||
aes_ctx_t aes_ctx; /* on the stack */
|
||||
off_t saved_offset;
|
||||
size_t saved_length;
|
||||
@@ -976,12 +974,12 @@ out:
|
||||
}
|
||||
|
||||
static int
|
||||
aes_decrypt_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
aes_decrypt_atomic(crypto_session_id_t session_id,
|
||||
crypto_mechanism_t *mechanism,
|
||||
crypto_key_t *key, crypto_data_t *ciphertext, crypto_data_t *plaintext,
|
||||
crypto_spi_ctx_template_t template)
|
||||
{
|
||||
(void) provider, (void) session_id;
|
||||
(void) session_id;
|
||||
aes_ctx_t aes_ctx; /* on the stack */
|
||||
off_t saved_offset;
|
||||
size_t saved_length;
|
||||
@@ -1142,11 +1140,9 @@ out:
|
||||
* KCF software provider context template entry points.
|
||||
*/
|
||||
static int
|
||||
aes_create_ctx_template(crypto_provider_handle_t provider,
|
||||
crypto_mechanism_t *mechanism, crypto_key_t *key,
|
||||
aes_create_ctx_template(crypto_mechanism_t *mechanism, crypto_key_t *key,
|
||||
crypto_spi_ctx_template_t *tmpl, size_t *tmpl_size)
|
||||
{
|
||||
(void) provider;
|
||||
void *keysched;
|
||||
size_t size;
|
||||
int rv;
|
||||
@@ -1318,8 +1314,7 @@ process_gmac_mech(crypto_mechanism_t *mech, crypto_data_t *data,
|
||||
}
|
||||
|
||||
static int
|
||||
aes_mac_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
aes_mac_atomic(crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac,
|
||||
crypto_spi_ctx_template_t template)
|
||||
{
|
||||
@@ -1335,15 +1330,14 @@ aes_mac_atomic(crypto_provider_handle_t provider,
|
||||
gcm_mech.cm_param_len = sizeof (CK_AES_GCM_PARAMS);
|
||||
gcm_mech.cm_param = (char *)&gcm_params;
|
||||
|
||||
return (aes_encrypt_atomic(provider, session_id, &gcm_mech,
|
||||
return (aes_encrypt_atomic(session_id, &gcm_mech,
|
||||
key, &null_crypto_data, mac, template));
|
||||
}
|
||||
|
||||
static int
|
||||
aes_mac_verify_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac,
|
||||
crypto_spi_ctx_template_t template)
|
||||
aes_mac_verify_atomic(crypto_session_id_t session_id,
|
||||
crypto_mechanism_t *mechanism, crypto_key_t *key, crypto_data_t *data,
|
||||
crypto_data_t *mac, crypto_spi_ctx_template_t template)
|
||||
{
|
||||
CK_AES_GCM_PARAMS gcm_params;
|
||||
crypto_mechanism_t gcm_mech;
|
||||
@@ -1357,6 +1351,6 @@ aes_mac_verify_atomic(crypto_provider_handle_t provider,
|
||||
gcm_mech.cm_param_len = sizeof (CK_AES_GCM_PARAMS);
|
||||
gcm_mech.cm_param = (char *)&gcm_params;
|
||||
|
||||
return (aes_decrypt_atomic(provider, session_id, &gcm_mech,
|
||||
return (aes_decrypt_atomic(session_id, &gcm_mech,
|
||||
key, mac, &null_crypto_data, template));
|
||||
}
|
||||
|
||||
+14
-20
@@ -109,7 +109,7 @@ static int sha2_digest_init(crypto_ctx_t *, crypto_mechanism_t *);
|
||||
static int sha2_digest(crypto_ctx_t *, crypto_data_t *, crypto_data_t *);
|
||||
static int sha2_digest_update(crypto_ctx_t *, crypto_data_t *);
|
||||
static int sha2_digest_final(crypto_ctx_t *, crypto_data_t *);
|
||||
static int sha2_digest_atomic(crypto_provider_handle_t, crypto_session_id_t,
|
||||
static int sha2_digest_atomic(crypto_session_id_t,
|
||||
crypto_mechanism_t *, crypto_data_t *, crypto_data_t *);
|
||||
|
||||
static const crypto_digest_ops_t sha2_digest_ops = {
|
||||
@@ -124,10 +124,10 @@ static int sha2_mac_init(crypto_ctx_t *, crypto_mechanism_t *, crypto_key_t *,
|
||||
crypto_spi_ctx_template_t);
|
||||
static int sha2_mac_update(crypto_ctx_t *, crypto_data_t *);
|
||||
static int sha2_mac_final(crypto_ctx_t *, crypto_data_t *);
|
||||
static int sha2_mac_atomic(crypto_provider_handle_t, crypto_session_id_t,
|
||||
static int sha2_mac_atomic(crypto_session_id_t,
|
||||
crypto_mechanism_t *, crypto_key_t *, crypto_data_t *, crypto_data_t *,
|
||||
crypto_spi_ctx_template_t);
|
||||
static int sha2_mac_verify_atomic(crypto_provider_handle_t, crypto_session_id_t,
|
||||
static int sha2_mac_verify_atomic(crypto_session_id_t,
|
||||
crypto_mechanism_t *, crypto_key_t *, crypto_data_t *, crypto_data_t *,
|
||||
crypto_spi_ctx_template_t);
|
||||
|
||||
@@ -140,9 +140,8 @@ static const crypto_mac_ops_t sha2_mac_ops = {
|
||||
.mac_verify_atomic = sha2_mac_verify_atomic
|
||||
};
|
||||
|
||||
static int sha2_create_ctx_template(crypto_provider_handle_t,
|
||||
crypto_mechanism_t *, crypto_key_t *, crypto_spi_ctx_template_t *,
|
||||
size_t *);
|
||||
static int sha2_create_ctx_template(crypto_mechanism_t *, crypto_key_t *,
|
||||
crypto_spi_ctx_template_t *, size_t *);
|
||||
static int sha2_free_context(crypto_ctx_t *);
|
||||
|
||||
static const crypto_ctx_ops_t sha2_ctx_ops = {
|
||||
@@ -159,7 +158,6 @@ static const crypto_ops_t sha2_crypto_ops = {
|
||||
|
||||
static const crypto_provider_info_t sha2_prov_info = {
|
||||
"SHA2 Software Provider",
|
||||
NULL,
|
||||
&sha2_crypto_ops,
|
||||
sizeof (sha2_mech_info_tab) / sizeof (crypto_mech_info_t),
|
||||
sha2_mech_info_tab
|
||||
@@ -554,11 +552,10 @@ sha2_digest_final(crypto_ctx_t *ctx, crypto_data_t *digest)
|
||||
}
|
||||
|
||||
static int
|
||||
sha2_digest_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_data_t *data, crypto_data_t *digest)
|
||||
sha2_digest_atomic(crypto_session_id_t session_id,
|
||||
crypto_mechanism_t *mechanism, crypto_data_t *data, crypto_data_t *digest)
|
||||
{
|
||||
(void) provider, (void) session_id;
|
||||
(void) session_id;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
SHA2_CTX sha2_ctx;
|
||||
uint32_t sha_digest_len;
|
||||
@@ -916,12 +913,11 @@ sha2_mac_final(crypto_ctx_t *ctx, crypto_data_t *mac)
|
||||
}
|
||||
|
||||
static int
|
||||
sha2_mac_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
sha2_mac_atomic(crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac,
|
||||
crypto_spi_ctx_template_t ctx_template)
|
||||
{
|
||||
(void) provider, (void) session_id;
|
||||
(void) session_id;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
uchar_t digest[SHA512_DIGEST_LENGTH];
|
||||
sha2_hmac_ctx_t sha2_hmac_ctx;
|
||||
@@ -1050,12 +1046,12 @@ bail:
|
||||
}
|
||||
|
||||
static int
|
||||
sha2_mac_verify_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
sha2_mac_verify_atomic(crypto_session_id_t session_id,
|
||||
crypto_mechanism_t *mechanism,
|
||||
crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac,
|
||||
crypto_spi_ctx_template_t ctx_template)
|
||||
{
|
||||
(void) provider, (void) session_id;
|
||||
(void) session_id;
|
||||
int ret = CRYPTO_SUCCESS;
|
||||
uchar_t digest[SHA512_DIGEST_LENGTH];
|
||||
sha2_hmac_ctx_t sha2_hmac_ctx;
|
||||
@@ -1226,11 +1222,9 @@ bail:
|
||||
*/
|
||||
|
||||
static int
|
||||
sha2_create_ctx_template(crypto_provider_handle_t provider,
|
||||
crypto_mechanism_t *mechanism, crypto_key_t *key,
|
||||
sha2_create_ctx_template(crypto_mechanism_t *mechanism, crypto_key_t *key,
|
||||
crypto_spi_ctx_template_t *ctx_template, size_t *ctx_template_size)
|
||||
{
|
||||
(void) provider;
|
||||
sha2_hmac_ctx_t *sha2_hmac_ctx_tmpl;
|
||||
uint_t keylen_in_bytes = CRYPTO_BITS2BYTES(key->ck_length);
|
||||
uint32_t sha_digest_len, sha_hmac_block_size;
|
||||
|
||||
+10
-16
@@ -55,7 +55,7 @@ static int skein_digest_init(crypto_ctx_t *, crypto_mechanism_t *);
|
||||
static int skein_digest(crypto_ctx_t *, crypto_data_t *, crypto_data_t *);
|
||||
static int skein_update(crypto_ctx_t *, crypto_data_t *);
|
||||
static int skein_final(crypto_ctx_t *, crypto_data_t *);
|
||||
static int skein_digest_atomic(crypto_provider_handle_t, crypto_session_id_t,
|
||||
static int skein_digest_atomic(crypto_session_id_t,
|
||||
crypto_mechanism_t *, crypto_data_t *, crypto_data_t *);
|
||||
|
||||
static const crypto_digest_ops_t skein_digest_ops = {
|
||||
@@ -68,7 +68,7 @@ static const crypto_digest_ops_t skein_digest_ops = {
|
||||
|
||||
static int skein_mac_init(crypto_ctx_t *, crypto_mechanism_t *, crypto_key_t *,
|
||||
crypto_spi_ctx_template_t);
|
||||
static int skein_mac_atomic(crypto_provider_handle_t, crypto_session_id_t,
|
||||
static int skein_mac_atomic(crypto_session_id_t,
|
||||
crypto_mechanism_t *, crypto_key_t *, crypto_data_t *, crypto_data_t *,
|
||||
crypto_spi_ctx_template_t);
|
||||
|
||||
@@ -81,9 +81,8 @@ static const crypto_mac_ops_t skein_mac_ops = {
|
||||
.mac_verify_atomic = NULL
|
||||
};
|
||||
|
||||
static int skein_create_ctx_template(crypto_provider_handle_t,
|
||||
crypto_mechanism_t *, crypto_key_t *, crypto_spi_ctx_template_t *,
|
||||
size_t *);
|
||||
static int skein_create_ctx_template(crypto_mechanism_t *, crypto_key_t *,
|
||||
crypto_spi_ctx_template_t *, size_t *);
|
||||
static int skein_free_context(crypto_ctx_t *);
|
||||
|
||||
static const crypto_ctx_ops_t skein_ctx_ops = {
|
||||
@@ -100,7 +99,6 @@ static const crypto_ops_t skein_crypto_ops = {
|
||||
|
||||
static const crypto_provider_info_t skein_prov_info = {
|
||||
"Skein Software Provider",
|
||||
NULL,
|
||||
&skein_crypto_ops,
|
||||
sizeof (skein_mech_info_tab) / sizeof (crypto_mech_info_t),
|
||||
skein_mech_info_tab
|
||||
@@ -475,11 +473,10 @@ skein_final(crypto_ctx_t *ctx, crypto_data_t *digest)
|
||||
* Supported input/output formats are raw, uio and mblk.
|
||||
*/
|
||||
static int
|
||||
skein_digest_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_data_t *data, crypto_data_t *digest)
|
||||
skein_digest_atomic(crypto_session_id_t session_id,
|
||||
crypto_mechanism_t *mechanism, crypto_data_t *data, crypto_data_t *digest)
|
||||
{
|
||||
(void) provider, (void) session_id;
|
||||
(void) session_id;
|
||||
int error;
|
||||
skein_ctx_t skein_ctx;
|
||||
crypto_ctx_t ctx;
|
||||
@@ -579,13 +576,12 @@ errout:
|
||||
* function as to those of the partial operations above.
|
||||
*/
|
||||
static int
|
||||
skein_mac_atomic(crypto_provider_handle_t provider,
|
||||
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
skein_mac_atomic(crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
|
||||
crypto_key_t *key, crypto_data_t *data, crypto_data_t *mac,
|
||||
crypto_spi_ctx_template_t ctx_template)
|
||||
{
|
||||
/* faux crypto context just for skein_digest_{update,final} */
|
||||
(void) provider, (void) session_id;
|
||||
(void) session_id;
|
||||
int error;
|
||||
crypto_ctx_t ctx;
|
||||
skein_ctx_t skein_ctx;
|
||||
@@ -620,11 +616,9 @@ errout:
|
||||
* skein_mac_init.
|
||||
*/
|
||||
static int
|
||||
skein_create_ctx_template(crypto_provider_handle_t provider,
|
||||
crypto_mechanism_t *mechanism, crypto_key_t *key,
|
||||
skein_create_ctx_template(crypto_mechanism_t *mechanism, crypto_key_t *key,
|
||||
crypto_spi_ctx_template_t *ctx_template, size_t *ctx_template_size)
|
||||
{
|
||||
(void) provider;
|
||||
int error;
|
||||
skein_ctx_t *ctx_tmpl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user