diff options
author | наб <[email protected]> | 2021-12-24 16:43:18 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-02-15 16:24:24 -0800 |
commit | d77702035ae9db8db62f40a8ab35ce9d37751e4a (patch) | |
tree | 797600f57cd52154463bc76fd65075ed0812c24a /module | |
parent | eb1e09b7ec5c388172fac7d505cd58af7fd9f4fa (diff) |
module: icp: remove unused CRYPTO_{NOTIFY_OPDONE,SKIP_REQID,RESTRICTED}
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #12901
Diffstat (limited to 'module')
-rw-r--r-- | module/icp/api/kcf_cipher.c | 4 | ||||
-rw-r--r-- | module/icp/api/kcf_mac.c | 4 | ||||
-rw-r--r-- | module/icp/core/kcf_callprov.c | 8 | ||||
-rw-r--r-- | module/icp/core/kcf_sched.c | 8 | ||||
-rw-r--r-- | module/icp/include/sys/crypto/sched_impl.h | 6 |
5 files changed, 9 insertions, 21 deletions
diff --git a/module/icp/api/kcf_cipher.c b/module/icp/api/kcf_cipher.c index 61fb2208b..30fd0f3d1 100644 --- a/module/icp/api/kcf_cipher.c +++ b/module/icp/api/kcf_cipher.c @@ -83,7 +83,7 @@ crypto_encrypt(crypto_mechanism_t *mech, crypto_data_t *plaintext, retry: /* pd is returned held */ if ((pd = kcf_get_mech_provider(mech->cm_type, &me, &error, - list, CRYPTO_FG_ENCRYPT_ATOMIC, CHECK_RESTRICT(crq))) == NULL) { + list, CRYPTO_FG_ENCRYPT_ATOMIC)) == NULL) { if (list != NULL) kcf_free_triedlist(list); return (error); @@ -161,7 +161,7 @@ crypto_decrypt(crypto_mechanism_t *mech, crypto_data_t *ciphertext, retry: /* pd is returned held */ if ((pd = kcf_get_mech_provider(mech->cm_type, &me, &error, - list, CRYPTO_FG_DECRYPT_ATOMIC, CHECK_RESTRICT(crq))) == NULL) { + list, CRYPTO_FG_DECRYPT_ATOMIC)) == NULL) { if (list != NULL) kcf_free_triedlist(list); return (error); diff --git a/module/icp/api/kcf_mac.c b/module/icp/api/kcf_mac.c index c2260b2b0..cf805ee1c 100644 --- a/module/icp/api/kcf_mac.c +++ b/module/icp/api/kcf_mac.c @@ -102,7 +102,7 @@ crypto_mac(crypto_mechanism_t *mech, crypto_data_t *data, retry: /* The pd is returned held */ if ((pd = kcf_get_mech_provider(mech->cm_type, &me, &error, - list, CRYPTO_FG_MAC_ATOMIC, CHECK_RESTRICT(crq))) == NULL) { + list, CRYPTO_FG_MAC_ATOMIC)) == NULL) { if (list != NULL) kcf_free_triedlist(list); return (error); @@ -219,7 +219,7 @@ crypto_mac_init(crypto_mechanism_t *mech, crypto_key_t *key, retry: /* The pd is returned held */ if ((pd = kcf_get_mech_provider(mech->cm_type, &me, &error, - list, CRYPTO_FG_MAC, CHECK_RESTRICT(crq))) == NULL) { + list, CRYPTO_FG_MAC)) == NULL) { if (list != NULL) kcf_free_triedlist(list); return (error); diff --git a/module/icp/core/kcf_callprov.c b/module/icp/core/kcf_callprov.c index 3fe6e3ebc..270579061 100644 --- a/module/icp/core/kcf_callprov.c +++ b/module/icp/core/kcf_callprov.c @@ -78,14 +78,10 @@ is_in_triedlist(kcf_provider_desc_t *pd, kcf_prov_tried_t *triedl) * search to find one. This is fine as we assume there are only a few * number of providers in this list. If this assumption ever changes, * we should revisit this. - * - * call_restrict represents if the caller should not be allowed to - * use restricted providers. */ kcf_provider_desc_t * kcf_get_mech_provider(crypto_mech_type_t mech_type, kcf_mech_entry_t **mepp, - int *error, kcf_prov_tried_t *triedl, crypto_func_group_t fg, - boolean_t call_restrict) + int *error, kcf_prov_tried_t *triedl, crypto_func_group_t fg) { kcf_provider_desc_t *pd = NULL; kcf_prov_mech_desc_t *mdesc; @@ -119,7 +115,7 @@ kcf_get_mech_provider(crypto_mech_type_t mech_type, kcf_mech_entry_t **mepp, if (!IS_FG_SUPPORTED(mdesc, fg) || !KCF_IS_PROV_USABLE(pd) || IS_PROVIDER_TRIED(pd, triedl) || - (call_restrict && (pd->pd_flags & KCF_PROV_RESTRICTED))) + (pd->pd_flags & KCF_PROV_RESTRICTED)) pd = NULL; } diff --git a/module/icp/core/kcf_sched.c b/module/icp/core/kcf_sched.c index 9e66586a9..5155b4710 100644 --- a/module/icp/core/kcf_sched.c +++ b/module/icp/core/kcf_sched.c @@ -265,8 +265,7 @@ kcf_resubmit_request(kcf_areq_node_t *areq) return (error); new_pd = kcf_get_mech_provider(mech1->cm_type, NULL, &error, - areq->an_tried_plist, fg, - (areq->an_reqarg.cr_flag & CRYPTO_RESTRICTED)); + areq->an_tried_plist, fg); if (new_pd == NULL) return (error); @@ -684,16 +683,13 @@ kcf_aop_done(kcf_areq_node_t *areq, int error) * atomic operations. */ skip_notify = (IS_UPDATE_OP(optype) || IS_INIT_OP(optype)) && - (!(areq->an_reqarg.cr_flag & CRYPTO_NOTIFY_OPDONE)) && (error == CRYPTO_SUCCESS); if (!skip_notify) { NOTIFY_CLIENT(areq, error); } - if (!(areq->an_reqarg.cr_flag & CRYPTO_SKIP_REQID)) - kcf_reqid_delete(areq); - + kcf_reqid_delete(areq); KCF_AREQ_REFRELE(areq); } diff --git a/module/icp/include/sys/crypto/sched_impl.h b/module/icp/include/sys/crypto/sched_impl.h index 6d70c65bf..eb08f57ba 100644 --- a/module/icp/include/sys/crypto/sched_impl.h +++ b/module/icp/include/sys/crypto/sched_impl.h @@ -56,9 +56,6 @@ typedef enum kcf_call_type { CRYPTO_ASYNCH } kcf_call_type_t; -#define CHECK_RESTRICT(crq) (crq != NULL && \ - ((crq)->cr_flag & CRYPTO_RESTRICTED)) - #define KCF_KMFLAG(crq) (((crq) == NULL) ? KM_SLEEP : KM_NOSLEEP) /* @@ -445,8 +442,7 @@ extern void kcf_free_triedlist(kcf_prov_tried_t *); extern kcf_prov_tried_t *kcf_insert_triedlist(kcf_prov_tried_t **, kcf_provider_desc_t *, int); extern kcf_provider_desc_t *kcf_get_mech_provider(crypto_mech_type_t, - kcf_mech_entry_t **, int *, kcf_prov_tried_t *, crypto_func_group_t, - boolean_t); + kcf_mech_entry_t **, int *, kcf_prov_tried_t *, crypto_func_group_t); extern crypto_ctx_t *kcf_new_ctx(crypto_call_req_t *, kcf_provider_desc_t *, crypto_session_id_t); extern void kcf_sched_destroy(void); |