diff options
author | Janne Peltonen <janne.peltonen@nokia.com> | 2021-12-21 16:46:54 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2022-01-28 10:09:30 +0200 |
commit | 596b76e34d9d4fbab38c741794681810547c51ff (patch) | |
tree | fc2ef5c53e0c09e88e883b5a1c56d9f076d1af7d /example | |
parent | 5e8911cb5aa6367330dc2e4959fd216661d4d6f5 (diff) |
example: ipsec_crypto: use new cipher IV API
Use the new cipher_iv_len session parameter for IV length and leave
the cipher IV data to its default value now that the API allows it.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Diffstat (limited to 'example')
-rw-r--r-- | example/ipsec_crypto/odp_ipsec_cache.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/example/ipsec_crypto/odp_ipsec_cache.c b/example/ipsec_crypto/odp_ipsec_cache.c index 7f0431fd8..f5646d467 100644 --- a/example/ipsec_crypto/odp_ipsec_cache.c +++ b/example/ipsec_crypto/odp_ipsec_cache.c @@ -56,7 +56,6 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa, odp_crypto_ses_create_err_t ses_create_rc; odp_crypto_session_t session; sa_mode_t mode = IPSEC_SA_MODE_TRANSPORT; - uint8_t unused_iv[cipher_sa ? cipher_sa->iv_len : 1]; /* Verify we have a good entry */ entry = &ipsec_cache->array[ipsec_cache->index]; @@ -96,13 +95,11 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa, params.cipher_alg = cipher_sa->alg.u.cipher; params.cipher_key.data = cipher_sa->key.data; params.cipher_key.length = cipher_sa->key.length; - params.cipher_iv.data = unused_iv; - params.cipher_iv.length = cipher_sa->iv_len; + params.cipher_iv_len = cipher_sa->iv_len; mode = cipher_sa->mode; } else { params.cipher_alg = ODP_CIPHER_ALG_NULL; - params.cipher_iv.data = NULL; - params.cipher_iv.length = 0; + params.cipher_iv_len = 0; } /* Auth */ |