]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: ssl: suboptimal certificate selection with TLSv1.3 and dual ECDSA/RSA
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 24 Oct 2023 21:58:02 +0000 (23:58 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 26 Oct 2023 17:17:13 +0000 (19:17 +0200)
commit23093c72f139eddfce68ea5580193ee131901591
treee906e8e924efeb13d6a747e32a1e438aa637ff50
parent4a89dba6d576677219ec897fc3ab99e8f40d3923
BUG/MINOR: ssl: suboptimal certificate selection with TLSv1.3 and dual ECDSA/RSA

When using TLSv1.3, the signature algorithms extension is used to chose
the right ECDSA or RSA certificate.

However there was an old test for previous version of TLS (< 1.3) which
was testing if the cipher is compatible with ECDSA when an ECDSA
signature algorithm is used. This test was relying on
SSL_CIPHER_get_auth_nid(cipher) == NID_auth_ecdsa to verify if the
cipher is still good.

Problem is, with TLSv1.3, all ciphersuites are compatible with any
authentication algorithm, but SSL_CIPHER_get_auth_nid(cipher) does not
return NID_auth_ecdsa, but NID_auth_any.

Because of this, with TLSv1.3 when both ECDSA and RSA certificates are
available for a domain, the ECDSA one is not chosen in priority.

This patch also introduces a test on the cipher IDs for the signaling
ciphersuites, because they would always return NID_auth_any, and are not
relevent for this selection.

This patch fixes issue #2300.

Must be backported in all stable versions.
src/ssl_sock.c