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:08:09 +0100 |
commit | 594a4a5129aad40cf2b0ebac6f57852fa79d6876 (patch) | |
tree | 7e2a1f207aadc76bd1c22d3bb8c12d2dade4693b /src/vnet/ipsec/ipsec_sa.h | |
parent | babecb41329c68747517b8af576d08d36f42ade3 (diff) |
ipsec: fix AES CBC IV generation (CVE-2022-46397)stable/1908
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 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vnet/ipsec/ipsec_sa.h b/src/vnet/ipsec/ipsec_sa.h index b3e138bfbea..bc9f3b47683 100644 --- a/src/vnet/ipsec/ipsec_sa.h +++ b/src/vnet/ipsec/ipsec_sa.h @@ -122,6 +122,8 @@ typedef struct u64 replay_window; dpo_id_t dpo; + u64 iv_counter; + vnet_crypto_key_index_t crypto_key_index; vnet_crypto_key_index_t integ_key_index; vnet_crypto_op_id_t crypto_enc_op_id:16; @@ -161,7 +163,6 @@ typedef struct /* Salt used in GCM modes - stored in network byte order */ u32 salt; - u64 gcm_iv_counter; } ipsec_sa_t; STATIC_ASSERT_OFFSET_OF (ipsec_sa_t, cacheline1, CLIB_CACHE_LINE_BYTES); |