aboutsummaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorJanne Peltonen <janne.peltonen@nokia.com>2023-02-20 19:29:44 +0200
committerMatias Elo <matias.elo@nokia.com>2023-04-12 15:52:37 +0300
commit10b36be0d81e46181764334b9621396b61c6449b (patch)
tree5fbc53c5827dd50f173fa1d58bedf844f9ce71e3 /platform
parent1807903cc6bfe2b8286ecd50e8ea24a80774a0a3 (diff)
linux-gen: crypto: remove deprecated odp_crypto_operation()
Remove the implementation of the deprecated odp_crypto_operation(). Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Diffstat (limited to 'platform')
-rw-r--r--platform/linux-generic/arch/aarch64/odp_crypto_armv8.c99
-rw-r--r--platform/linux-generic/odp_crypto_ipsecmb.c99
-rw-r--r--platform/linux-generic/odp_crypto_null.c101
-rw-r--r--platform/linux-generic/odp_crypto_openssl.c102
-rw-r--r--platform/linux-generic/odp_event.c9
5 files changed, 1 insertions, 409 deletions
diff --git a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c
index 9b3c61210..2eefc6302 100644
--- a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c
+++ b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c
@@ -657,66 +657,6 @@ int odp_crypto_session_destroy(odp_crypto_session_t session)
return 0;
}
-#if ODP_DEPRECATED_API
-int
-odp_crypto_operation(odp_crypto_op_param_t *param,
- odp_bool_t *posted,
- odp_crypto_op_result_t *result)
-{
- odp_crypto_packet_op_param_t packet_param;
- odp_packet_t out_pkt = param->out_pkt;
- odp_crypto_packet_result_t packet_result;
- odp_crypto_op_result_t local_result;
- int rc;
-
- if (((odp_crypto_generic_session_t *)(intptr_t)param->session)->p.op_type !=
- ODP_CRYPTO_OP_TYPE_LEGACY)
- return -1;
-
- packet_param.session = param->session;
- packet_param.cipher_iv_ptr = param->cipher_iv_ptr;
- packet_param.auth_iv_ptr = param->auth_iv_ptr;
- packet_param.hash_result_offset = param->hash_result_offset;
- packet_param.aad_ptr = param->aad_ptr;
- packet_param.cipher_range = param->cipher_range;
- packet_param.auth_range = param->auth_range;
-
- rc = odp_crypto_op(&param->pkt, &out_pkt, &packet_param, 1);
- if (rc <= 0)
- return -1;
-
- rc = odp_crypto_result(&packet_result, out_pkt);
- if (rc < 0) {
- /*
- * We cannot fail since odp_crypto_op() has already processed
- * the packet. Let's indicate error in the result instead.
- */
- packet_result.ok = false;
- }
-
- /* Indicate to caller operation was sync */
- *posted = 0;
-
- packet_subtype_set(out_pkt, ODP_EVENT_PACKET_BASIC);
-
- /* Fill in result */
- local_result.ctx = param->ctx;
- local_result.pkt = out_pkt;
- local_result.cipher_status = packet_result.cipher_status;
- local_result.auth_status = packet_result.auth_status;
- local_result.ok = packet_result.ok;
-
- /*
- * Be bug-to-bug compatible. Return output packet also through params.
- */
- param->out_pkt = out_pkt;
-
- *result = local_result;
-
- return 0;
-}
-#endif
-
int _odp_crypto_init_global(void)
{
size_t mem_size;
@@ -796,45 +736,6 @@ int _odp_crypto_term_local(void)
return 0;
}
-#if ODP_DEPRECATED_API
-odp_crypto_compl_t odp_crypto_compl_from_event(odp_event_t ev)
-{
- /* This check not mandated by the API specification */
- if (odp_event_type(ev) != ODP_EVENT_CRYPTO_COMPL)
- _ODP_ABORT("Event not a crypto completion");
- return (odp_crypto_compl_t)ev;
-}
-
-odp_event_t odp_crypto_compl_to_event(odp_crypto_compl_t completion_event)
-{
- return (odp_event_t)completion_event;
-}
-
-void
-odp_crypto_compl_result(odp_crypto_compl_t completion_event,
- odp_crypto_op_result_t *result)
-{
- (void)completion_event;
- (void)result;
-
- /* We won't get such events anyway, so there can be no result */
- _ODP_ASSERT(0);
-}
-
-void
-odp_crypto_compl_free(odp_crypto_compl_t completion_event)
-{
- odp_event_t ev = odp_crypto_compl_to_event(completion_event);
-
- odp_buffer_free(odp_buffer_from_event(ev));
-}
-
-uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl)
-{
- return _odp_pri(hdl);
-}
-#endif /* ODP_DEPRECATED_API */
-
void odp_crypto_session_param_init(odp_crypto_session_param_t *param)
{
memset(param, 0, sizeof(odp_crypto_session_param_t));
diff --git a/platform/linux-generic/odp_crypto_ipsecmb.c b/platform/linux-generic/odp_crypto_ipsecmb.c
index 6532d5861..0b83adecc 100644
--- a/platform/linux-generic/odp_crypto_ipsecmb.c
+++ b/platform/linux-generic/odp_crypto_ipsecmb.c
@@ -628,66 +628,6 @@ int odp_crypto_session_destroy(odp_crypto_session_t session)
return 0;
}
-#if ODP_DEPRECATED_API
-int
-odp_crypto_operation(odp_crypto_op_param_t *param,
- odp_bool_t *posted,
- odp_crypto_op_result_t *result)
-{
- odp_crypto_packet_op_param_t packet_param;
- odp_packet_t out_pkt = param->out_pkt;
- odp_crypto_packet_result_t packet_result;
- odp_crypto_op_result_t local_result;
- int rc;
-
- if (((odp_crypto_generic_session_t *)(intptr_t)param->session)->p.op_type !=
- ODP_CRYPTO_OP_TYPE_LEGACY)
- return -1;
-
- packet_param.session = param->session;
- packet_param.cipher_iv_ptr = param->cipher_iv_ptr;
- packet_param.auth_iv_ptr = param->auth_iv_ptr;
- packet_param.hash_result_offset = param->hash_result_offset;
- packet_param.aad_ptr = param->aad_ptr;
- packet_param.cipher_range = param->cipher_range;
- packet_param.auth_range = param->auth_range;
-
- rc = odp_crypto_op(&param->pkt, &out_pkt, &packet_param, 1);
- if (rc <= 0)
- return -1;
-
- rc = odp_crypto_result(&packet_result, out_pkt);
- if (rc < 0) {
- /*
- * We cannot fail since odp_crypto_op() has already processed
- * the packet. Let's indicate error in the result instead.
- */
- packet_result.ok = false;
- }
-
- /* Indicate to caller operation was sync */
- *posted = 0;
-
- packet_subtype_set(out_pkt, ODP_EVENT_PACKET_BASIC);
-
- /* Fill in result */
- local_result.ctx = param->ctx;
- local_result.pkt = out_pkt;
- local_result.cipher_status = packet_result.cipher_status;
- local_result.auth_status = packet_result.auth_status;
- local_result.ok = packet_result.ok;
-
- /*
- * Be bug-to-bug compatible. Return output packet also through params.
- */
- param->out_pkt = out_pkt;
-
- *result = local_result;
-
- return 0;
-}
-#endif
-
int _odp_crypto_init_global(void)
{
size_t mem_size;
@@ -779,45 +719,6 @@ int _odp_crypto_term_local(void)
return 0;
}
-#if ODP_DEPRECATED_API
-odp_crypto_compl_t odp_crypto_compl_from_event(odp_event_t ev)
-{
- /* This check not mandated by the API specification */
- if (odp_event_type(ev) != ODP_EVENT_CRYPTO_COMPL)
- _ODP_ABORT("Event not a crypto completion");
- return (odp_crypto_compl_t)ev;
-}
-
-odp_event_t odp_crypto_compl_to_event(odp_crypto_compl_t completion_event)
-{
- return (odp_event_t)completion_event;
-}
-
-void
-odp_crypto_compl_result(odp_crypto_compl_t completion_event,
- odp_crypto_op_result_t *result)
-{
- (void)completion_event;
- (void)result;
-
- /* We won't get such events anyway, so there can be no result */
- _ODP_ASSERT(0);
-}
-
-void
-odp_crypto_compl_free(odp_crypto_compl_t completion_event)
-{
- odp_event_t ev = odp_crypto_compl_to_event(completion_event);
-
- odp_buffer_free(odp_buffer_from_event(ev));
-}
-
-uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl)
-{
- return _odp_pri(hdl);
-}
-#endif /* ODP_DEPRECATED_API */
-
void odp_crypto_session_param_init(odp_crypto_session_param_t *param)
{
memset(param, 0, sizeof(odp_crypto_session_param_t));
diff --git a/platform/linux-generic/odp_crypto_null.c b/platform/linux-generic/odp_crypto_null.c
index 6680a760b..c93691e92 100644
--- a/platform/linux-generic/odp_crypto_null.c
+++ b/platform/linux-generic/odp_crypto_null.c
@@ -275,66 +275,6 @@ int odp_crypto_session_destroy(odp_crypto_session_t session)
return 0;
}
-#if ODP_DEPRECATED_API
-int
-odp_crypto_operation(odp_crypto_op_param_t *param,
- odp_bool_t *posted,
- odp_crypto_op_result_t *result)
-{
- odp_crypto_packet_op_param_t packet_param;
- odp_packet_t out_pkt = param->out_pkt;
- odp_crypto_packet_result_t packet_result;
- odp_crypto_op_result_t local_result;
- int rc;
-
- if (((odp_crypto_generic_session_t *)(intptr_t)param->session)->p.op_type !=
- ODP_CRYPTO_OP_TYPE_LEGACY)
- return -1;
-
- packet_param.session = param->session;
- packet_param.cipher_iv_ptr = param->cipher_iv_ptr;
- packet_param.auth_iv_ptr = param->auth_iv_ptr;
- packet_param.hash_result_offset = param->hash_result_offset;
- packet_param.aad_ptr = param->aad_ptr;
- packet_param.cipher_range = param->cipher_range;
- packet_param.auth_range = param->auth_range;
-
- rc = odp_crypto_op(&param->pkt, &out_pkt, &packet_param, 1);
- if (rc <= 0)
- return -1;
-
- rc = odp_crypto_result(&packet_result, out_pkt);
- if (rc < 0) {
- /*
- * We cannot fail since odp_crypto_op() has already processed
- * the packet. Let's indicate error in the result instead.
- */
- packet_result.ok = false;
- }
-
- /* Indicate to caller operation was sync */
- *posted = 0;
-
- packet_subtype_set(out_pkt, ODP_EVENT_PACKET_BASIC);
-
- /* Fill in result */
- local_result.ctx = param->ctx;
- local_result.pkt = out_pkt;
- local_result.cipher_status = packet_result.cipher_status;
- local_result.auth_status = packet_result.auth_status;
- local_result.ok = packet_result.ok;
-
- /*
- * Be bug-to-bug compatible. Return output packet also through params.
- */
- param->out_pkt = out_pkt;
-
- *result = local_result;
-
- return 0;
-}
-#endif
-
int
_odp_crypto_init_global(void)
{
@@ -410,45 +350,6 @@ int _odp_crypto_term_local(void)
return 0;
}
-#if ODP_DEPRECATED_API
-odp_crypto_compl_t odp_crypto_compl_from_event(odp_event_t ev)
-{
- /* This check not mandated by the API specification */
- if (odp_event_type(ev) != ODP_EVENT_CRYPTO_COMPL)
- _ODP_ABORT("Event not a crypto completion");
- return (odp_crypto_compl_t)ev;
-}
-
-odp_event_t odp_crypto_compl_to_event(odp_crypto_compl_t completion_event)
-{
- return (odp_event_t)completion_event;
-}
-
-void
-odp_crypto_compl_result(odp_crypto_compl_t completion_event,
- odp_crypto_op_result_t *result)
-{
- (void)completion_event;
- (void)result;
-
- /* We won't get such events anyway, so there can be no result */
- _ODP_ASSERT(0);
-}
-
-void
-odp_crypto_compl_free(odp_crypto_compl_t completion_event)
-{
- odp_event_t ev = odp_crypto_compl_to_event(completion_event);
-
- odp_buffer_free(odp_buffer_from_event(ev));
-}
-
-uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl)
-{
- return _odp_pri(hdl);
-}
-#endif
-
void odp_crypto_session_param_init(odp_crypto_session_param_t *param)
{
memset(param, 0, sizeof(odp_crypto_session_param_t));
@@ -567,7 +468,7 @@ int odp_crypto_op_enq(const odp_packet_t pkt_in[],
const odp_crypto_packet_op_param_t param[],
int num_pkt)
{
- odp_packet_t pkt;
+ odp_packet_t pkt = ODP_PACKET_INVALID;
odp_event_t event;
odp_crypto_generic_session_t *session;
int i, rc;
diff --git a/platform/linux-generic/odp_crypto_openssl.c b/platform/linux-generic/odp_crypto_openssl.c
index c1b250b18..d4c7a3f1a 100644
--- a/platform/linux-generic/odp_crypto_openssl.c
+++ b/platform/linux-generic/odp_crypto_openssl.c
@@ -2343,69 +2343,6 @@ int odp_crypto_session_destroy(odp_crypto_session_t session)
return 0;
}
-/*
- * Shim function around packet operation, can be used by other implementations.
- */
-#if ODP_DEPRECATED_API
-int
-odp_crypto_operation(odp_crypto_op_param_t *param,
- odp_bool_t *posted,
- odp_crypto_op_result_t *result)
-{
- odp_crypto_packet_op_param_t packet_param;
- odp_packet_t out_pkt = param->out_pkt;
- odp_crypto_packet_result_t packet_result;
- odp_crypto_op_result_t local_result;
- int rc;
-
- if (((odp_crypto_generic_session_t *)(intptr_t)param->session)->p.op_type !=
- ODP_CRYPTO_OP_TYPE_LEGACY)
- return -1;
-
- packet_param.session = param->session;
- packet_param.cipher_iv_ptr = param->cipher_iv_ptr;
- packet_param.auth_iv_ptr = param->auth_iv_ptr;
- packet_param.hash_result_offset = param->hash_result_offset;
- packet_param.aad_ptr = param->aad_ptr;
- packet_param.cipher_range = param->cipher_range;
- packet_param.auth_range = param->auth_range;
-
- rc = odp_crypto_op(&param->pkt, &out_pkt, &packet_param, 1);
- if (rc <= 0)
- return -1;
-
- rc = odp_crypto_result(&packet_result, out_pkt);
- if (rc < 0) {
- /*
- * We cannot fail since odp_crypto_op() has already processed
- * the packet. Let's indicate error in the result instead.
- */
- packet_result.ok = false;
- }
-
- /* Indicate to caller operation was sync */
- *posted = 0;
-
- packet_subtype_set(out_pkt, ODP_EVENT_PACKET_BASIC);
-
- /* Fill in result */
- local_result.ctx = param->ctx;
- local_result.pkt = out_pkt;
- local_result.cipher_status = packet_result.cipher_status;
- local_result.auth_status = packet_result.auth_status;
- local_result.ok = packet_result.ok;
-
- /*
- * Be bug-to-bug compatible. Return output packet also through params.
- */
- param->out_pkt = out_pkt;
-
- *result = local_result;
-
- return 0;
-}
-#endif
-
#if OPENSSL_VERSION_NUMBER < 0x10100000L
static void ODP_UNUSED openssl_thread_id(CRYPTO_THREADID ODP_UNUSED *id)
{
@@ -2561,45 +2498,6 @@ int _odp_crypto_term_local(void)
return 0;
}
-#if ODP_DEPRECATED_API
-odp_crypto_compl_t odp_crypto_compl_from_event(odp_event_t ev)
-{
- /* This check not mandated by the API specification */
- if (odp_event_type(ev) != ODP_EVENT_CRYPTO_COMPL)
- _ODP_ABORT("Event not a crypto completion");
- return (odp_crypto_compl_t)ev;
-}
-
-odp_event_t odp_crypto_compl_to_event(odp_crypto_compl_t completion_event)
-{
- return (odp_event_t)completion_event;
-}
-
-void
-odp_crypto_compl_result(odp_crypto_compl_t completion_event,
- odp_crypto_op_result_t *result)
-{
- (void)completion_event;
- (void)result;
-
- /* We won't get such events anyway, so there can be no result */
- _ODP_ASSERT(0);
-}
-
-void
-odp_crypto_compl_free(odp_crypto_compl_t completion_event)
-{
- odp_event_t ev = odp_crypto_compl_to_event(completion_event);
-
- odp_buffer_free(odp_buffer_from_event(ev));
-}
-
-uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl)
-{
- return _odp_pri(hdl);
-}
-#endif /* ODP_DEPRECATED_API */
-
void odp_crypto_session_param_init(odp_crypto_session_param_t *param)
{
memset(param, 0, sizeof(odp_crypto_session_param_t));
diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c
index edf77e2dc..e15cb1c50 100644
--- a/platform/linux-generic/odp_event.c
+++ b/platform/linux-generic/odp_event.c
@@ -59,11 +59,6 @@ static inline void event_free(odp_event_t event, _odp_ev_id_t id)
case ODP_EVENT_TIMEOUT:
odp_timeout_free(odp_timeout_from_event(event));
break;
-#if ODP_DEPRECATED_API
- case ODP_EVENT_CRYPTO_COMPL:
- odp_crypto_compl_free(odp_crypto_compl_from_event(event));
- break;
-#endif
case ODP_EVENT_IPSEC_STATUS:
_odp_ipsec_status_free(_odp_ipsec_status_from_event(event));
break;
@@ -115,10 +110,6 @@ int odp_event_is_valid(odp_event_t event)
return !_odp_packet_validate(odp_packet_from_event(event), _ODP_EV_EVENT_IS_VALID);
case ODP_EVENT_TIMEOUT:
/* Fall through */
-#if ODP_DEPRECATED_API
- case ODP_EVENT_CRYPTO_COMPL:
- /* Fall through */
-#endif
case ODP_EVENT_IPSEC_STATUS:
/* Fall through */
case ODP_EVENT_PACKET_VECTOR: