diff options
author | Benoît Ganne <bganne@cisco.com> | 2022-01-18 15:56:41 +0100 |
---|---|---|
committer | Benoît Ganne <bganne@cisco.com> | 2023-02-06 16:27:55 +0100 |
commit | 70fc5aff89103acaa5768522e45497134b48a982 (patch) | |
tree | 217b84b8f04dd34b0e993c262789389356a98e00 /src/vnet/ipsec/ipsec_sa.h | |
parent | e88582facad678701457fa68cbe4ed24f6ec4266 (diff) |
ipsec: fix AES CBC IV generation (CVE-2022-46397)stable/1904
For AES-CBC, the IV must be unpredictable (see NIST SP800-38a Appendix
C). Chaining IVs like is done by ipsecmb and native backends for the
VNET_CRYPTO_OP_FLAG_INIT_IV is fully predictable.
Encrypt a counter as part of the message, making the (predictable)
counter-generated IV unpredictable.
Fixes: VPP-2037
Type: fix
Change-Id: If4f192d62bf97dda553e7573331c75efa11822ae
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/ipsec/ipsec_sa.h')
-rw-r--r-- | src/vnet/ipsec/ipsec_sa.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vnet/ipsec/ipsec_sa.h b/src/vnet/ipsec/ipsec_sa.h index f25a760592e..1bc34e328f7 100644 --- a/src/vnet/ipsec/ipsec_sa.h +++ b/src/vnet/ipsec/ipsec_sa.h @@ -134,6 +134,8 @@ typedef struct /* data accessed by dataplane code should be above this comment */ CLIB_CACHE_LINE_ALIGN_MARK (cacheline1); + u64 iv_counter; + union { ip4_header_t ip4_hdr; |