From 77d57e69ea968b465dca27aa8f6d9b423d757565 Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Fri, 27 Oct 2023 15:03:08 +0300 Subject: [PATCH] linux-dpdk: crypto: reject all unsupported op types Reverse the logic of operation type checking at session creation so that session creation fails if the operation type is not one of the supported types. After this the OOP op type continues to be rejected but also new types defined in future API versions will get rejected until support for them is added. Signed-off-by: Janne Peltonen Reviewed-by: Matias Elo --- platform/linux-dpdk/odp_crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c index 3269e30750..59854c11f6 100644 --- a/platform/linux-dpdk/odp_crypto.c +++ b/platform/linux-dpdk/odp_crypto.c @@ -1448,8 +1448,8 @@ int odp_crypto_session_create(const odp_crypto_session_param_t *param, return -1; } - /* ODP_CRYPTO_OP_TYPE_OOP not supported */ - if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) { + if (param->op_type != ODP_CRYPTO_OP_TYPE_BASIC && + param->op_type != ODP_CRYPTO_OP_TYPE_LEGACY) { *status = ODP_CRYPTO_SES_ERR_PARAMS; *session_out = ODP_CRYPTO_SESSION_INVALID; return -1;