Promote SSL_get_negotiated_group() for non-TLSv1.3
authorBenjamin Kaduk <bkaduk@akamai.com>
Tue, 16 Mar 2021 14:47:09 +0000 (07:47 -0700)
committerBenjamin Kaduk <bkaduk@akamai.com>
Sat, 15 May 2021 22:09:07 +0000 (15:09 -0700)
commitaa6bd216dd2691d1254eabcbd584691eb3b4b9b8
treec666b319f00d45596172c847a1c365edcfc703fd
parenta8457b4c3d86a42209eabe90eddb605f59041f9e
Promote SSL_get_negotiated_group() for non-TLSv1.3

It can be useful to know what group was used for the handshake's
key exchange process even on non-TLS 1.3 connections.  Allow this
API, new in OpenSSL 3.0.0, to be used on other TLS versions as well.
Since pre-TLS-1.3 key exchange occurs only on full handshakes, this
necessitates adding a field to the SSL_SESSION object to carry the
group information across resumptions.  The key exchange group in the
SSL_SESSION can also be relevant in TLS 1.3 when the resumption handshake
uses the "psk_ke" key-exchange mode, so also track whether a fresh key
exchange was done for TLS 1.3.

Since the new field is optional in the ASN.1 sense, there is no need
to increment SSL_SESSION_ASN1_VERSION (which incurs strong incompatibility
churn).

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14750)
doc/man3/SSL_CTX_set1_curves.pod
ssl/s3_lib.c
ssl/ssl_asn1.c
ssl/ssl_local.h
ssl/statem/extensions_clnt.c
ssl/statem/extensions_srvr.c
ssl/statem/statem_clnt.c
ssl/statem/statem_srvr.c