Skip to content

Commit

Permalink
module: icp: remove unused kcf_mac operations
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#12901
  • Loading branch information
nabijaczleweli authored and andrewc12 committed Sep 23, 2022
1 parent b178a9a commit 31a0fff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 52 deletions.
6 changes: 0 additions & 6 deletions include/sys/crypto/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,9 @@ extern int crypto_digest_final(crypto_context_t ctx, crypto_data_t *digest,
extern int crypto_mac(crypto_mechanism_t *mech, crypto_data_t *data,
crypto_key_t *key, crypto_ctx_template_t tmpl, crypto_data_t *mac,
crypto_call_req_t *cr);
extern int crypto_mac_prov(crypto_provider_t, crypto_session_id_t,
crypto_mechanism_t *, crypto_data_t *, crypto_key_t *,
crypto_ctx_template_t, crypto_data_t *, crypto_call_req_t *);
extern int crypto_mac_verify(crypto_mechanism_t *mech, crypto_data_t *data,
crypto_key_t *key, crypto_ctx_template_t tmpl, crypto_data_t *mac,
crypto_call_req_t *cr);
extern int crypto_mac_verify_prov(crypto_provider_t, crypto_session_id_t,
crypto_mechanism_t *, crypto_data_t *, crypto_key_t *,
crypto_ctx_template_t, crypto_data_t *, crypto_call_req_t *);
extern int crypto_mac_init(crypto_mechanism_t *mech, crypto_key_t *key,
crypto_ctx_template_t tmpl, crypto_context_t *ctxp, crypto_call_req_t *cr);
extern int crypto_mac_init_prov(crypto_provider_t, crypto_session_id_t,
Expand Down
48 changes: 2 additions & 46 deletions module/icp/api/kcf_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
* the specified session id.
* When complete and successful, 'mac' will contain the message
* authentication code.
* Relies on the KCF scheduler to choose a provider.
*
* Context:
* Process or interrupt, according to the semantics dictated by the 'crq'.
Expand All @@ -87,29 +88,6 @@
* See comment in the beginning of the file.
*/
int
crypto_mac_prov(crypto_provider_t provider, crypto_session_id_t sid,
crypto_mechanism_t *mech, crypto_data_t *data, crypto_key_t *key,
crypto_ctx_template_t tmpl, crypto_data_t *mac, crypto_call_req_t *crq)
{
kcf_req_params_t params;
kcf_provider_desc_t *pd = provider;
kcf_provider_desc_t *real_provider = pd;
int rv;

ASSERT(KCF_PROV_REFHELD(pd));

KCF_WRAP_MAC_OPS_PARAMS(&params, KCF_OP_ATOMIC, sid, mech, key,
data, mac, tmpl);
rv = kcf_submit_request(real_provider, NULL, crq, &params);

return (rv);
}

/*
* Same as crypto_mac_prov(), but relies on the KCF scheduler to choose
* a provider. See crypto_mac() comments for more information.
*/
int
crypto_mac(crypto_mechanism_t *mech, crypto_data_t *data,
crypto_key_t *key, crypto_ctx_template_t tmpl, crypto_data_t *mac,
crypto_call_req_t *crq)
Expand Down Expand Up @@ -183,27 +161,7 @@ crypto_mac(crypto_mechanism_t *mech, crypto_data_t *data,
* Single part operation to compute the MAC corresponding to the specified
* 'data' and to verify that it matches the MAC specified by 'mac'.
* The other arguments are the same as the function crypto_mac_prov().
*/
int
crypto_mac_verify_prov(crypto_provider_t provider, crypto_session_id_t sid,
crypto_mechanism_t *mech, crypto_data_t *data, crypto_key_t *key,
crypto_ctx_template_t tmpl, crypto_data_t *mac, crypto_call_req_t *crq)
{
kcf_req_params_t params;
kcf_provider_desc_t *pd = provider;
kcf_provider_desc_t *real_provider = pd;

ASSERT(KCF_PROV_REFHELD(pd));

KCF_WRAP_MAC_OPS_PARAMS(&params, KCF_OP_MAC_VERIFY_ATOMIC, sid, mech,
key, data, mac, tmpl);

return (kcf_submit_request(real_provider, NULL, crq, &params));
}

/*
* Same as crypto_mac_verify_prov(), but relies on the KCF scheduler to choose
* a provider. See crypto_mac_verify_prov() comments for more information.
* Relies on the KCF scheduler to choose a provider.
*/
int
crypto_mac_verify(crypto_mechanism_t *mech, crypto_data_t *data,
Expand Down Expand Up @@ -511,9 +469,7 @@ crypto_mac_final(crypto_context_t context, crypto_data_t *mac,
}

#if defined(_KERNEL)
EXPORT_SYMBOL(crypto_mac_prov);
EXPORT_SYMBOL(crypto_mac);
EXPORT_SYMBOL(crypto_mac_verify_prov);
EXPORT_SYMBOL(crypto_mac_verify);
EXPORT_SYMBOL(crypto_mac_init_prov);
EXPORT_SYMBOL(crypto_mac_init);
Expand Down

0 comments on commit 31a0fff

Please sign in to comment.