mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
module: icp: spi: crypto_ops_t: remove unused op types
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12901
This commit is contained in:
@@ -198,8 +198,7 @@ crypto_cipher_init_prov(crypto_provider_t provider, crypto_session_id_t sid,
|
||||
mech, key, NULL, NULL, tmpl);
|
||||
}
|
||||
|
||||
error = kcf_submit_request(real_provider, ctx, crq, ¶ms,
|
||||
B_FALSE);
|
||||
error = kcf_submit_request(real_provider, ctx, crq, ¶ms);
|
||||
|
||||
if (pd->pd_prov_type == CRYPTO_LOGICAL_PROVIDER)
|
||||
KCF_PROV_REFRELE(real_provider);
|
||||
@@ -334,7 +333,7 @@ crypto_encrypt_prov(crypto_provider_t provider, crypto_session_id_t sid,
|
||||
KCF_WRAP_ENCRYPT_OPS_PARAMS(¶ms, KCF_OP_ATOMIC, sid, mech, key,
|
||||
plaintext, ciphertext, tmpl);
|
||||
|
||||
error = kcf_submit_request(real_provider, NULL, crq, ¶ms, B_FALSE);
|
||||
error = kcf_submit_request(real_provider, NULL, crq, ¶ms);
|
||||
if (pd->pd_prov_type == CRYPTO_LOGICAL_PROVIDER)
|
||||
KCF_PROV_REFRELE(real_provider);
|
||||
|
||||
@@ -400,7 +399,7 @@ retry:
|
||||
} else {
|
||||
KCF_WRAP_ENCRYPT_OPS_PARAMS(¶ms, KCF_OP_ATOMIC, pd->pd_sid,
|
||||
mech, key, plaintext, ciphertext, spi_ctx_tmpl);
|
||||
error = kcf_submit_request(pd, NULL, crq, ¶ms, B_FALSE);
|
||||
error = kcf_submit_request(pd, NULL, crq, ¶ms);
|
||||
}
|
||||
|
||||
if (error != CRYPTO_SUCCESS && error != CRYPTO_QUEUED &&
|
||||
@@ -502,7 +501,7 @@ crypto_encrypt_update(crypto_context_t context, crypto_data_t *plaintext,
|
||||
|
||||
KCF_WRAP_ENCRYPT_OPS_PARAMS(¶ms, KCF_OP_UPDATE,
|
||||
ctx->cc_session, NULL, NULL, plaintext, ciphertext, NULL);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms, B_FALSE);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms);
|
||||
|
||||
return (error);
|
||||
}
|
||||
@@ -550,7 +549,7 @@ crypto_encrypt_final(crypto_context_t context, crypto_data_t *ciphertext,
|
||||
} else {
|
||||
KCF_WRAP_ENCRYPT_OPS_PARAMS(¶ms, KCF_OP_FINAL,
|
||||
ctx->cc_session, NULL, NULL, NULL, ciphertext, NULL);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms, B_FALSE);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms);
|
||||
}
|
||||
|
||||
/* Release the hold done in kcf_new_ctx() during init step. */
|
||||
@@ -616,7 +615,7 @@ crypto_decrypt_prov(crypto_provider_t provider, crypto_session_id_t sid,
|
||||
KCF_WRAP_DECRYPT_OPS_PARAMS(¶ms, KCF_OP_ATOMIC, sid, mech, key,
|
||||
ciphertext, plaintext, tmpl);
|
||||
|
||||
rv = kcf_submit_request(real_provider, NULL, crq, ¶ms, B_FALSE);
|
||||
rv = kcf_submit_request(real_provider, NULL, crq, ¶ms);
|
||||
if (pd->pd_prov_type == CRYPTO_LOGICAL_PROVIDER)
|
||||
KCF_PROV_REFRELE(real_provider);
|
||||
|
||||
@@ -683,7 +682,7 @@ retry:
|
||||
} else {
|
||||
KCF_WRAP_DECRYPT_OPS_PARAMS(¶ms, KCF_OP_ATOMIC, pd->pd_sid,
|
||||
mech, key, ciphertext, plaintext, spi_ctx_tmpl);
|
||||
error = kcf_submit_request(pd, NULL, crq, ¶ms, B_FALSE);
|
||||
error = kcf_submit_request(pd, NULL, crq, ¶ms);
|
||||
}
|
||||
|
||||
if (error != CRYPTO_SUCCESS && error != CRYPTO_QUEUED &&
|
||||
@@ -785,7 +784,7 @@ crypto_decrypt_update(crypto_context_t context, crypto_data_t *ciphertext,
|
||||
|
||||
KCF_WRAP_DECRYPT_OPS_PARAMS(¶ms, KCF_OP_UPDATE,
|
||||
ctx->cc_session, NULL, NULL, ciphertext, plaintext, NULL);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms, B_FALSE);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms);
|
||||
|
||||
return (error);
|
||||
}
|
||||
@@ -834,77 +833,7 @@ crypto_decrypt_final(crypto_context_t context, crypto_data_t *plaintext,
|
||||
} else {
|
||||
KCF_WRAP_DECRYPT_OPS_PARAMS(¶ms, KCF_OP_FINAL,
|
||||
ctx->cc_session, NULL, NULL, NULL, plaintext, NULL);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms, B_FALSE);
|
||||
}
|
||||
|
||||
/* Release the hold done in kcf_new_ctx() during init step. */
|
||||
KCF_CONTEXT_COND_RELEASE(error, kcf_ctx);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* See comments for crypto_encrypt_update().
|
||||
*/
|
||||
int
|
||||
crypto_encrypt_single(crypto_context_t context, crypto_data_t *plaintext,
|
||||
crypto_data_t *ciphertext, crypto_call_req_t *cr)
|
||||
{
|
||||
crypto_ctx_t *ctx = (crypto_ctx_t *)context;
|
||||
kcf_context_t *kcf_ctx;
|
||||
kcf_provider_desc_t *pd;
|
||||
int error;
|
||||
kcf_req_params_t params;
|
||||
|
||||
if ((ctx == NULL) ||
|
||||
((kcf_ctx = (kcf_context_t *)ctx->cc_framework_private) == NULL) ||
|
||||
((pd = kcf_ctx->kc_prov_desc) == NULL)) {
|
||||
return (CRYPTO_INVALID_CONTEXT);
|
||||
}
|
||||
|
||||
/* The fast path for SW providers. */
|
||||
if (CHECK_FASTPATH(cr, pd)) {
|
||||
error = KCF_PROV_ENCRYPT(pd, ctx, plaintext,
|
||||
ciphertext, NULL);
|
||||
KCF_PROV_INCRSTATS(pd, error);
|
||||
} else {
|
||||
KCF_WRAP_ENCRYPT_OPS_PARAMS(¶ms, KCF_OP_SINGLE, pd->pd_sid,
|
||||
NULL, NULL, plaintext, ciphertext, NULL);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms, B_FALSE);
|
||||
}
|
||||
|
||||
/* Release the hold done in kcf_new_ctx() during init step. */
|
||||
KCF_CONTEXT_COND_RELEASE(error, kcf_ctx);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* See comments for crypto_decrypt_update().
|
||||
*/
|
||||
int
|
||||
crypto_decrypt_single(crypto_context_t context, crypto_data_t *ciphertext,
|
||||
crypto_data_t *plaintext, crypto_call_req_t *cr)
|
||||
{
|
||||
crypto_ctx_t *ctx = (crypto_ctx_t *)context;
|
||||
kcf_context_t *kcf_ctx;
|
||||
kcf_provider_desc_t *pd;
|
||||
int error;
|
||||
kcf_req_params_t params;
|
||||
|
||||
if ((ctx == NULL) ||
|
||||
((kcf_ctx = (kcf_context_t *)ctx->cc_framework_private) == NULL) ||
|
||||
((pd = kcf_ctx->kc_prov_desc) == NULL)) {
|
||||
return (CRYPTO_INVALID_CONTEXT);
|
||||
}
|
||||
|
||||
/* The fast path for SW providers. */
|
||||
if (CHECK_FASTPATH(cr, pd)) {
|
||||
error = KCF_PROV_DECRYPT(pd, ctx, ciphertext,
|
||||
plaintext, NULL);
|
||||
KCF_PROV_INCRSTATS(pd, error);
|
||||
} else {
|
||||
KCF_WRAP_DECRYPT_OPS_PARAMS(¶ms, KCF_OP_SINGLE, pd->pd_sid,
|
||||
NULL, NULL, ciphertext, plaintext, NULL);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms, B_FALSE);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms);
|
||||
}
|
||||
|
||||
/* Release the hold done in kcf_new_ctx() during init step. */
|
||||
@@ -925,6 +854,4 @@ EXPORT_SYMBOL(crypto_decrypt_init_prov);
|
||||
EXPORT_SYMBOL(crypto_decrypt_init);
|
||||
EXPORT_SYMBOL(crypto_decrypt_update);
|
||||
EXPORT_SYMBOL(crypto_decrypt_final);
|
||||
EXPORT_SYMBOL(crypto_encrypt_single);
|
||||
EXPORT_SYMBOL(crypto_decrypt_single);
|
||||
#endif
|
||||
|
||||
@@ -109,7 +109,7 @@ crypto_digest_prov(crypto_provider_t provider, crypto_session_id_t sid,
|
||||
data, digest);
|
||||
|
||||
/* no crypto context to carry between multiple parts. */
|
||||
rv = kcf_submit_request(real_provider, NULL, crq, ¶ms, B_FALSE);
|
||||
rv = kcf_submit_request(real_provider, NULL, crq, ¶ms);
|
||||
if (pd->pd_prov_type == CRYPTO_LOGICAL_PROVIDER)
|
||||
KCF_PROV_REFRELE(real_provider);
|
||||
|
||||
@@ -159,8 +159,7 @@ retry:
|
||||
pd->pd_sid, mech, NULL, data, digest);
|
||||
|
||||
/* no crypto context to carry between multiple parts. */
|
||||
error = kcf_submit_request(pd, NULL, crq, ¶ms,
|
||||
B_FALSE);
|
||||
error = kcf_submit_request(pd, NULL, crq, ¶ms);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,8 +240,7 @@ crypto_digest_init_prov(crypto_provider_t provider, crypto_session_id_t sid,
|
||||
} else {
|
||||
KCF_WRAP_DIGEST_OPS_PARAMS(¶ms, KCF_OP_INIT, sid,
|
||||
mech, NULL, NULL, NULL);
|
||||
error = kcf_submit_request(real_provider, ctx, crq, ¶ms,
|
||||
B_FALSE);
|
||||
error = kcf_submit_request(real_provider, ctx, crq, ¶ms);
|
||||
}
|
||||
|
||||
if (pd->pd_prov_type == CRYPTO_LOGICAL_PROVIDER)
|
||||
@@ -352,7 +350,7 @@ crypto_digest_update(crypto_context_t context, crypto_data_t *data,
|
||||
} else {
|
||||
KCF_WRAP_DIGEST_OPS_PARAMS(¶ms, KCF_OP_UPDATE,
|
||||
ctx->cc_session, NULL, NULL, data, NULL);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms, B_FALSE);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms);
|
||||
}
|
||||
|
||||
return (error);
|
||||
@@ -401,77 +399,7 @@ crypto_digest_final(crypto_context_t context, crypto_data_t *digest,
|
||||
} else {
|
||||
KCF_WRAP_DIGEST_OPS_PARAMS(¶ms, KCF_OP_FINAL,
|
||||
ctx->cc_session, NULL, NULL, NULL, digest);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms, B_FALSE);
|
||||
}
|
||||
|
||||
/* Release the hold done in kcf_new_ctx() during init step. */
|
||||
KCF_CONTEXT_COND_RELEASE(error, kcf_ctx);
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Performs a digest update on the specified key. Note that there is
|
||||
* no k-API crypto_digest_key() equivalent of this function.
|
||||
*/
|
||||
int
|
||||
crypto_digest_key_prov(crypto_context_t context, crypto_key_t *key,
|
||||
crypto_call_req_t *cr)
|
||||
{
|
||||
crypto_ctx_t *ctx = (crypto_ctx_t *)context;
|
||||
kcf_context_t *kcf_ctx;
|
||||
kcf_provider_desc_t *pd;
|
||||
int error;
|
||||
kcf_req_params_t params;
|
||||
|
||||
if ((ctx == NULL) ||
|
||||
((kcf_ctx = (kcf_context_t *)ctx->cc_framework_private) == NULL) ||
|
||||
((pd = kcf_ctx->kc_prov_desc) == NULL)) {
|
||||
return (CRYPTO_INVALID_CONTEXT);
|
||||
}
|
||||
|
||||
ASSERT(pd->pd_prov_type != CRYPTO_LOGICAL_PROVIDER);
|
||||
|
||||
/* The fast path for SW providers. */
|
||||
if (CHECK_FASTPATH(cr, pd)) {
|
||||
error = KCF_PROV_DIGEST_KEY(pd, ctx, key, NULL);
|
||||
KCF_PROV_INCRSTATS(pd, error);
|
||||
} else {
|
||||
KCF_WRAP_DIGEST_OPS_PARAMS(¶ms, KCF_OP_DIGEST_KEY,
|
||||
ctx->cc_session, NULL, key, NULL, NULL);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms, B_FALSE);
|
||||
}
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* See comments for crypto_digest_update() and crypto_digest_final().
|
||||
*/
|
||||
int
|
||||
crypto_digest_single(crypto_context_t context, crypto_data_t *data,
|
||||
crypto_data_t *digest, crypto_call_req_t *cr)
|
||||
{
|
||||
crypto_ctx_t *ctx = (crypto_ctx_t *)context;
|
||||
kcf_context_t *kcf_ctx;
|
||||
kcf_provider_desc_t *pd;
|
||||
int error;
|
||||
kcf_req_params_t params;
|
||||
|
||||
if ((ctx == NULL) ||
|
||||
((kcf_ctx = (kcf_context_t *)ctx->cc_framework_private) == NULL) ||
|
||||
((pd = kcf_ctx->kc_prov_desc) == NULL)) {
|
||||
return (CRYPTO_INVALID_CONTEXT);
|
||||
}
|
||||
|
||||
|
||||
/* The fast path for SW providers. */
|
||||
if (CHECK_FASTPATH(cr, pd)) {
|
||||
error = KCF_PROV_DIGEST(pd, ctx, data, digest, NULL);
|
||||
KCF_PROV_INCRSTATS(pd, error);
|
||||
} else {
|
||||
KCF_WRAP_DIGEST_OPS_PARAMS(¶ms, KCF_OP_SINGLE, pd->pd_sid,
|
||||
NULL, NULL, data, digest);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms, B_FALSE);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms);
|
||||
}
|
||||
|
||||
/* Release the hold done in kcf_new_ctx() during init step. */
|
||||
@@ -486,6 +414,4 @@ EXPORT_SYMBOL(crypto_digest_init_prov);
|
||||
EXPORT_SYMBOL(crypto_digest_init);
|
||||
EXPORT_SYMBOL(crypto_digest_update);
|
||||
EXPORT_SYMBOL(crypto_digest_final);
|
||||
EXPORT_SYMBOL(crypto_digest_key_prov);
|
||||
EXPORT_SYMBOL(crypto_digest_single);
|
||||
#endif
|
||||
|
||||
@@ -109,7 +109,7 @@ crypto_mac_prov(crypto_provider_t provider, crypto_session_id_t sid,
|
||||
|
||||
KCF_WRAP_MAC_OPS_PARAMS(¶ms, KCF_OP_ATOMIC, sid, mech, key,
|
||||
data, mac, tmpl);
|
||||
rv = kcf_submit_request(real_provider, NULL, crq, ¶ms, B_FALSE);
|
||||
rv = kcf_submit_request(real_provider, NULL, crq, ¶ms);
|
||||
if (pd->pd_prov_type == CRYPTO_LOGICAL_PROVIDER)
|
||||
KCF_PROV_REFRELE(real_provider);
|
||||
|
||||
@@ -187,8 +187,7 @@ retry:
|
||||
KCF_WRAP_MAC_OPS_PARAMS(¶ms, KCF_OP_ATOMIC,
|
||||
pd->pd_sid, mech, key, data, mac, spi_ctx_tmpl);
|
||||
|
||||
error = kcf_submit_request(pd, NULL, crq, ¶ms,
|
||||
KCF_ISDUALREQ(crq));
|
||||
error = kcf_submit_request(pd, NULL, crq, ¶ms);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,7 +233,7 @@ crypto_mac_verify_prov(crypto_provider_t provider, crypto_session_id_t sid,
|
||||
|
||||
KCF_WRAP_MAC_OPS_PARAMS(¶ms, KCF_OP_MAC_VERIFY_ATOMIC, sid, mech,
|
||||
key, data, mac, tmpl);
|
||||
rv = kcf_submit_request(real_provider, NULL, crq, ¶ms, B_FALSE);
|
||||
rv = kcf_submit_request(real_provider, NULL, crq, ¶ms);
|
||||
if (pd->pd_prov_type == CRYPTO_LOGICAL_PROVIDER)
|
||||
KCF_PROV_REFRELE(real_provider);
|
||||
|
||||
@@ -308,8 +307,7 @@ retry:
|
||||
KCF_OP_MAC_VERIFY_ATOMIC, pd->pd_sid, mech,
|
||||
key, data, mac, spi_ctx_tmpl);
|
||||
|
||||
error = kcf_submit_request(pd, NULL, crq, ¶ms,
|
||||
KCF_ISDUALREQ(crq));
|
||||
error = kcf_submit_request(pd, NULL, crq, ¶ms);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,8 +402,7 @@ crypto_mac_init_prov(crypto_provider_t provider, crypto_session_id_t sid,
|
||||
} else {
|
||||
KCF_WRAP_MAC_OPS_PARAMS(¶ms, KCF_OP_INIT, sid, mech, key,
|
||||
NULL, NULL, tmpl);
|
||||
rv = kcf_submit_request(real_provider, ctx, crq, ¶ms,
|
||||
B_FALSE);
|
||||
rv = kcf_submit_request(real_provider, ctx, crq, ¶ms);
|
||||
}
|
||||
|
||||
if (pd->pd_prov_type == CRYPTO_LOGICAL_PROVIDER)
|
||||
@@ -539,7 +536,7 @@ crypto_mac_update(crypto_context_t context, crypto_data_t *data,
|
||||
} else {
|
||||
KCF_WRAP_MAC_OPS_PARAMS(¶ms, KCF_OP_UPDATE,
|
||||
ctx->cc_session, NULL, NULL, data, NULL, NULL);
|
||||
rv = kcf_submit_request(pd, ctx, cr, ¶ms, B_FALSE);
|
||||
rv = kcf_submit_request(pd, ctx, cr, ¶ms);
|
||||
}
|
||||
|
||||
return (rv);
|
||||
@@ -588,7 +585,7 @@ crypto_mac_final(crypto_context_t context, crypto_data_t *mac,
|
||||
} else {
|
||||
KCF_WRAP_MAC_OPS_PARAMS(¶ms, KCF_OP_FINAL,
|
||||
ctx->cc_session, NULL, NULL, NULL, mac, NULL);
|
||||
rv = kcf_submit_request(pd, ctx, cr, ¶ms, B_FALSE);
|
||||
rv = kcf_submit_request(pd, ctx, cr, ¶ms);
|
||||
}
|
||||
|
||||
/* Release the hold done in kcf_new_ctx() during init step. */
|
||||
@@ -596,42 +593,6 @@ crypto_mac_final(crypto_context_t context, crypto_data_t *mac,
|
||||
return (rv);
|
||||
}
|
||||
|
||||
/*
|
||||
* See comments for crypto_mac_update() and crypto_mac_final().
|
||||
*/
|
||||
int
|
||||
crypto_mac_single(crypto_context_t context, crypto_data_t *data,
|
||||
crypto_data_t *mac, crypto_call_req_t *cr)
|
||||
{
|
||||
crypto_ctx_t *ctx = (crypto_ctx_t *)context;
|
||||
kcf_context_t *kcf_ctx;
|
||||
kcf_provider_desc_t *pd;
|
||||
int error;
|
||||
kcf_req_params_t params;
|
||||
|
||||
|
||||
if ((ctx == NULL) ||
|
||||
((kcf_ctx = (kcf_context_t *)ctx->cc_framework_private) == NULL) ||
|
||||
((pd = kcf_ctx->kc_prov_desc) == NULL)) {
|
||||
return (CRYPTO_INVALID_CONTEXT);
|
||||
}
|
||||
|
||||
|
||||
/* The fast path for SW providers. */
|
||||
if (CHECK_FASTPATH(cr, pd)) {
|
||||
error = KCF_PROV_MAC(pd, ctx, data, mac, NULL);
|
||||
KCF_PROV_INCRSTATS(pd, error);
|
||||
} else {
|
||||
KCF_WRAP_MAC_OPS_PARAMS(¶ms, KCF_OP_SINGLE, pd->pd_sid,
|
||||
NULL, NULL, data, mac, NULL);
|
||||
error = kcf_submit_request(pd, ctx, cr, ¶ms, B_FALSE);
|
||||
}
|
||||
|
||||
/* Release the hold done in kcf_new_ctx() during init step. */
|
||||
KCF_CONTEXT_COND_RELEASE(error, kcf_ctx);
|
||||
return (error);
|
||||
}
|
||||
|
||||
#if defined(_KERNEL)
|
||||
EXPORT_SYMBOL(crypto_mac_prov);
|
||||
EXPORT_SYMBOL(crypto_mac);
|
||||
@@ -641,5 +602,4 @@ EXPORT_SYMBOL(crypto_mac_init_prov);
|
||||
EXPORT_SYMBOL(crypto_mac_init);
|
||||
EXPORT_SYMBOL(crypto_mac_update);
|
||||
EXPORT_SYMBOL(crypto_mac_final);
|
||||
EXPORT_SYMBOL(crypto_mac_single);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user