diff options
author | 2019-11-03 01:02:18 -0400 | |
---|---|---|
committer | 2019-11-18 13:30:59 +0000 | |
commit | 8f6b9a39e63190639bfc19e162bfb63ccbf26871 (patch) | |
tree | 3f20e2727d9cd4f39de3845679ca7e8f6a59d4db /src/plugins/dpdk/ipsec/esp_decrypt.c | |
parent | cde7068bbe8d76d84c2e44f79e32c60a1525bcc9 (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>
(cherry picked from commit d58419f19b33560d224471bc16674a525427308e)
Diffstat (limited to 'src/plugins/dpdk/ipsec/esp_decrypt.c')
-rw-r--r-- | src/plugins/dpdk/ipsec/esp_decrypt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/dpdk/ipsec/esp_decrypt.c b/src/plugins/dpdk/ipsec/esp_decrypt.c index afbab963009..112b96a12bd 100644 --- a/src/plugins/dpdk/ipsec/esp_decrypt.c +++ b/src/plugins/dpdk/ipsec/esp_decrypt.c @@ -330,7 +330,10 @@ dpdk_esp_decrypt_inline (vlib_main_t * vm, /* _aad[3] should always be 0 */ if (PREDICT_FALSE (ipsec_sa_is_set_USE_ESN (sa0))) - _aad[2] = clib_host_to_net_u32 (sa0->seq_hi); + { + _aad[2] = _aad[1]; + _aad[1] = clib_host_to_net_u32 (sa0->seq_hi); + } else _aad[2] = 0; } |