From: Tobias Brunner Date: Thu, 11 Feb 2021 16:09:04 +0000 (+0100) Subject: tls-crypto: Don't filter suites with specific ECDH group if any is available X-Git-Tag: 5.9.2rc1~23^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=311405c34d5a943f4b302c5ef13727a15e23d93f;p=thirdparty%2Fstrongswan.git tls-crypto: Don't filter suites with specific ECDH group if any is available Since DH groups (or with TLS < 1.3 curves) are negotiated separately, it doesn't matter which one is listed in the cipher suite as any one could be used. --- diff --git a/src/libtls/tls_crypto.c b/src/libtls/tls_crypto.c index 07d5ce7146..d7faa4e253 100644 --- a/src/libtls/tls_crypto.c +++ b/src/libtls/tls_crypto.c @@ -837,8 +837,10 @@ static void filter_suite(suite_algs_t suites[], int *count, int offset, } if (current.dh && current.dh != suites[i].dh) { - if (suites[i].dh != MODP_NONE) - { /* skip DH group, does not match nor NONE */ + if (suites[i].dh != MODP_NONE && + !(diffie_hellman_group_is_ec(current.dh) && + diffie_hellman_group_is_ec(suites[i].dh))) + { /* skip DH group, does not match nor NONE nor both ECDH */ continue; } }