openssl/providers/implementations/exchange
slontis a9fe6f05e9 Fix bugs in ECDH cofactor FIPS indicator.
The code was not detecting that the cofactor was set up correctly
if OSSL_PKEY_PARAM_USE_COFACTOR_ECDH was set, resulting in an incorrect
FIPS indicator error being triggered.

Added a test for all possible combinations of a EVP_PKEY setting
OSSL_PKEY_PARAM_USE_COFACTOR_ECDH and the derive context setting
OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE.

This only affects the B & K curves (which have a cofactor that is not 1).

Bug reported by @abkarcher

Testing this properly, also detected a memory leak of privk when the
FIPS indicator error was triggered (in the case where mode = 0 and
use_cofactor was 1).

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25548)

(cherry picked from commit 2f362e99a1)
2024-09-30 20:07:22 +02:00
..
build.info
dh_exch.c fips: Prohibit SHA1 in DH & ECDH exchange 2024-09-27 09:14:37 +02:00
ecdh_exch.c Fix bugs in ECDH cofactor FIPS indicator. 2024-09-30 20:07:22 +02:00
ecx_exch.c Copyright year updates 2024-09-05 09:35:49 +02:00
kdf_exch.c Copyright year updates 2024-09-05 09:35:49 +02:00