openssl/ssl
Matt Caswell 7955c1f16e Fix SSL_get_servername() and SNI behaviour
The SNI behaviour for TLSv1.3 and the behaviour of SSL_get_servername()
was not quite right, and not entirely consistent with the RFC.

The TLSv1.3 RFC explicitly says that SNI is negotiated on each handshake
and the server is not required to associate it with the session. This was
not quite reflected in the code so we fix that.

Additionally there were some additional checks around early_data checking
that the SNI between the original session and this session were
consistent. In fact the RFC does not require any such checks, so they are
removed.

Finally the behaviour of SSL_get_servername() was not quite right. The
behaviour was not consistent between resumption and normal handshakes,
and also not quite consistent with historical behaviour. We clarify the
behaviour in various scenarios and also attempt to make it match historical
behaviour as closely as possible.

Fixes #8822

Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/10018)
2020-01-30 16:01:25 +00:00
..
record Make sure we use RAND_bytes_ex and RAND_priv_bytes_ex in libssl 2020-01-24 15:12:56 +00:00
statem Fix SSL_get_servername() and SNI behaviour 2020-01-30 16:01:25 +00:00
bio_ssl.c
build.info
d1_lib.c
d1_msg.c
d1_srtp.c
methods.c Update some inclusions of <openssl/macros.h> 2019-11-07 11:37:25 +01:00
pqueue.c
s3_cbc.c Deprecate the low level MD5 functions. 2020-01-19 10:14:39 +10:00
s3_enc.c Stop using EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 2019-10-11 09:52:31 +02:00
s3_lib.c TLS: use EVP for HMAC throughout libssl. 2020-01-29 19:49:23 +10:00
s3_msg.c
ssl_asn1.c
ssl_cert_table.h
ssl_cert.c SSL: Document SSL_add_{file,dir,store}_cert_subjects_to_stack() 2019-11-12 13:38:36 +01:00
ssl_ciph.c Deprecate most of debug-memory 2019-12-14 20:57:35 +01:00
ssl_conf.c X509_LOOKUP_store: new X509_LOOKUP_METHOD that works by OSSL_STORE URI 2019-11-03 18:38:23 +01:00
ssl_err.c
ssl_init.c
ssl_lib.c Fix SSL_get_servername() and SNI behaviour 2020-01-30 16:01:25 +00:00
ssl_local.h TLS: use EVP for HMAC throughout libssl. 2020-01-29 19:49:23 +10:00
ssl_mcnf.c
ssl_rsa.c commit a6efbe123af3d98b4d10d4fcdfe68dc5303212f8 2019-11-16 08:29:26 +10:00
ssl_sess.c Make sure we use RAND_bytes_ex and RAND_priv_bytes_ex in libssl 2020-01-24 15:12:56 +00:00
ssl_stat.c
ssl_txt.c
ssl_utst.c
t1_enc.c Fix some typos 2019-12-11 19:04:01 +01:00
t1_lib.c TLS: use EVP for HMAC throughout libssl. 2020-01-29 19:49:23 +10:00
t1_trce.c Process GOST ClientKeyExchange message in SSL_trace 2019-11-23 16:27:30 +03:00
tls13_enc.c Update tls13_enc.c 2020-01-02 13:49:41 +01:00
tls_srp.c Replace BUF_ string function calls with OPENSSL_ ones 2019-10-17 23:19:59 +02:00