diff options
author | Matias Elo <matias.elo@nokia.com> | 2022-07-01 11:44:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-01 11:44:35 +0300 |
commit | 3b9d1514e55955953786211f1fdec8e97f3688c7 (patch) | |
tree | 1d8ffcc8573670792ec788fd4a006103ff5e8a8e /platform/linux-generic/odp_crypto_openssl.c | |
parent | 58fe883d5e43dc315d4751433f73c5d8ed7e5ba7 (diff) | |
parent | 3f7e35f89ff349d531542d73ba854de9695568f4 (diff) |
Merge ODP v1.37.1.0v1.37.1.0_DPDK_19.11
Merge ODP linux-generic v1.37.1.0 into linux-dpdk
Diffstat (limited to 'platform/linux-generic/odp_crypto_openssl.c')
-rw-r--r-- | platform/linux-generic/odp_crypto_openssl.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/platform/linux-generic/odp_crypto_openssl.c b/platform/linux-generic/odp_crypto_openssl.c index 9f0978b49..9402c805b 100644 --- a/platform/linux-generic/odp_crypto_openssl.c +++ b/platform/linux-generic/odp_crypto_openssl.c @@ -1957,11 +1957,19 @@ int odp_crypto_capability(odp_crypto_capability_t *capa) /* Initialize crypto capability structure */ memset(capa, 0, sizeof(odp_crypto_capability_t)); + capa->max_sessions = MAX_SESSIONS; capa->sync_mode = ODP_SUPPORT_PREFERRED; capa->async_mode = ODP_SUPPORT_YES; capa->queue_type_plain = 1; capa->queue_type_sched = 1; + /* Memory allocation in libssl is not compatible with process mode */ + if (odp_global_ro.init_param.mem_model == ODP_MEM_MODEL_PROCESS) { + capa->ciphers.bit.null = 1; + capa->auths.bit.null = 1; + return 0; + } + capa->ciphers.bit.null = 1; capa->ciphers.bit.trides_cbc = 1; capa->ciphers.bit.trides_ecb = 1; @@ -2001,8 +2009,6 @@ int odp_crypto_capability(odp_crypto_capability_t *capa) capa->auths.bit.sha384 = 1; capa->auths.bit.sha512 = 1; - capa->max_sessions = MAX_SESSIONS; - return 0; } @@ -2196,6 +2202,16 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param, return -1; } + /* Process mode is not supported with libssl based algos */ + if (odp_global_ro.init_param.mem_model == ODP_MEM_MODEL_PROCESS && + (param->cipher_alg != ODP_CIPHER_ALG_NULL || + param->auth_alg != ODP_AUTH_ALG_NULL)) { + *status = param->cipher_alg != ODP_CIPHER_ALG_NULL ? + ODP_CRYPTO_SES_ERR_CIPHER : ODP_CRYPTO_SES_ERR_AUTH; + *session_out = ODP_CRYPTO_SESSION_INVALID; + return -1; + } + /* Allocate memory for this session */ session = alloc_session(); if (NULL == session) { |