]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix bugs in ECDH cofactor FIPS indicator.
authorslontis <shane.lontis@oracle.com>
Thu, 26 Sep 2024 05:18:59 +0000 (15:18 +1000)
committerTomas Mraz <tomas@openssl.org>
Mon, 30 Sep 2024 18:07:09 +0000 (20:07 +0200)
commit2f362e99a1178263c7102474f0190836166f416d
tree218d0d2a1cd84232e93855bd7ee89a73bbb87ebc
parentfc68cf21b572bc7fc76a39e4ec150d5d612f02e8
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)
providers/implementations/exchange/ecdh_exch.c
test/acvp_test.c
test/acvp_test.inc