ipsec: fix AES CBC IV generation (CVE-2022-46397) 45/38145/1 stable/1908
authorBenoît Ganne <bganne@cisco.com>
Tue, 18 Jan 2022 14:56:41 +0000 (15:56 +0100)
committerBenoît Ganne <bganne@cisco.com>
Mon, 6 Feb 2023 15:08:09 +0000 (16:08 +0100)
commit594a4a5129aad40cf2b0ebac6f57852fa79d6876
tree7e2a1f207aadc76bd1c22d3bb8c12d2dade4693b
parentbabecb41329c68747517b8af576d08d36f42ade3
ipsec: fix AES CBC IV generation (CVE-2022-46397)

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>
src/vnet/ipsec/esp_encrypt.c
src/vnet/ipsec/ipsec_sa.h