diff options
author | Christian Hopps <chopps@labn.net> | 2019-11-03 01:02:18 -0400 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-11-07 21:39:40 +0000 |
commit | d58419f19b33560d224471bc16674a525427308e (patch) | |
tree | eeb78abb002c0e6d05b64d99280ab31aac989883 /src/plugins/dpdk/ipsec/ipsec.c | |
parent | bc2e640db7533394a3de7bdffd78fadf2a2ffd9f (diff) |
dpdk: ipsec gcm fixes
- Fix AAD initialization. With use-esn the aad data consists of the SPI
and the 64-bit sequence number in big-endian order. Fix the u32 swapped
code.
- Remove salt-reinitialization. The GCM code seems inspired by the GCM
RFCs recommendations on IKE keydata and how to produce a salt
value (create an extra 4 octets of keying material). This is not IKE
code though and the SA already holds the configured salt value which
this code is blowing away. Use the configured value instead.
Type: fix
Change-Id: I5e75518aa7c1d91037bb24b2a40fe4fc90bdfdb0
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'src/plugins/dpdk/ipsec/ipsec.c')
-rw-r--r-- | src/plugins/dpdk/ipsec/ipsec.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/plugins/dpdk/ipsec/ipsec.c b/src/plugins/dpdk/ipsec/ipsec.c index 93efc6bcf7e..260775b0695 100644 --- a/src/plugins/dpdk/ipsec/ipsec.c +++ b/src/plugins/dpdk/ipsec/ipsec.c @@ -494,7 +494,6 @@ dpdk_crypto_session_disposal (crypto_session_disposal_t * v, u64 ts) static clib_error_t * add_del_sa_session (u32 sa_index, u8 is_add) { - ipsec_main_t *im = &ipsec_main; dpdk_crypto_main_t *dcm = &dpdk_crypto_main; crypto_data_t *data; struct rte_cryptodev_sym_session *s; @@ -502,25 +501,7 @@ add_del_sa_session (u32 sa_index, u8 is_add) u32 drv_id; if (is_add) - { -#if 1 - ipsec_sa_t *sa = pool_elt_at_index (im->sad, sa_index); - u32 seed; - switch (sa->crypto_alg) - { - case IPSEC_CRYPTO_ALG_AES_GCM_128: - case IPSEC_CRYPTO_ALG_AES_GCM_192: - case IPSEC_CRYPTO_ALG_AES_GCM_256: - clib_memcpy (&sa->salt, - &sa->crypto_key.data[sa->crypto_key.len - 4], 4); - break; - default: - seed = (u32) clib_cpu_time_now (); - sa->salt = random_u32 (&seed); - } -#endif - return 0; - } + return 0; /* *INDENT-OFF* */ vec_foreach (data, dcm->data) |