Skip to content

Commit

Permalink
linux-dpdk: crypto: reject all unsupported op types
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Matias Elo <[email protected]>
  • Loading branch information
JannePeltonen authored and MatiasElo committed Oct 27, 2023
1 parent c11b278 commit 77d57e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions platform/linux-dpdk/odp_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 77d57e6

Please sign in to comment.