MINOR: ssl: Update ssl_fc_curve/ssl_bc_curve to use SSL_get0_group_name
authorMariam John <john.mariam.oss@gmail.com>
Fri, 29 Dec 2023 17:14:41 +0000 (11:14 -0600)
committerWilly Tarreau <w@1wt.eu>
Tue, 9 Jan 2024 18:22:13 +0000 (19:22 +0100)
commit28aff55347279e090860a46817e566ec7a128ad7
treea36ed205b32120ca93257d4fb0749688a77418c1
parent6e0d5bfdf022294e36bb2586fbbf2c834ce3ba5c
MINOR: ssl: Update ssl_fc_curve/ssl_bc_curve to use SSL_get0_group_name

The function `smp_fetch_ssl_fc_ec` gets the curve name used during key
exchange. It currently uses the `SSL_get_negotiated_group`, available
since OpenSSLv3.0 to get the nid and derive the short name of the curve
from the nid. In OpenSSLv3.2, a new function, `SSL_get0_group_name` was
added that directly gives the curve name.

The function `smp_fetch_ssl_fc_ec` has been updated to use
`SSL_get0_group_name` if using OpenSSL>=3.2 and for versions >=3.0 and <
3.2 use the old SSL_get_negotiated_group to get the curve name. Another
change made is to normalize the return value, so that
`smp_fetch_ssl_fc_ec` returns curve name in uppercase.
(`SSL_get0_group_name` returns the curve name in lowercase and
`SSL_get_negotiated_group` + `OBJ_nid2sn` returns curve name in
uppercase).

Can be backported to 2.8.

(cherry picked from commit 25da2174c62b536b00bc5b0c0bb64ae95fd826b9)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/ssl_sample.c