openssl/ssl
Benjamin Kaduk 2e3ec2e157 Code to thread-safety in ChangeCipherState
The server-side ChangeCipherState processing stores the new cipher
in the SSL_SESSION object, so that the new state can be used if
this session gets resumed.  However, writing to the session is only
thread-safe for initial handshakes, as at other times the session
object may be in a shared cache and in use by another thread at the
same time.  Reflect this invariant in the code by only writing to
s->session->cipher when it is currently NULL (we do not cache sessions
with no cipher).  The code prior to this change would never actually
change the (non-NULL) cipher value in a session object, since our
server enforces that (pre-TLS-1.3) resumptions use the exact same
cipher as the initial connection, and non-abbreviated renegotiations
have produced a new session object before we get to this point.
Regardless, include logic to detect such a condition and abort the
handshake if it occurs, to avoid any risk of inadvertently using
the wrong cipher on a connection.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/10943)
2020-03-13 14:20:14 -07:00
..
record Handle max_fragment_length overflow for DTLS 2020-02-19 09:21:10 +01:00
statem Code to thread-safety in ChangeCipherState 2020-03-13 14:20:14 -07: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 Explicitly fetch ciphers and digests in libssl 2020-02-06 11:59:07 +00:00
s3_lib.c Fix whitespace nit in ssl_generate_master_secret() 2020-03-13 14:20:14 -07:00
s3_msg.c
ssl_asn1.c Explicitly test against NULL; do not use !p or similar 2019-10-09 21:32:15 +02:00
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 Explicitly fetch ciphers and digests in libssl 2020-02-06 11:59:07 +00: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 Detect EOF while reading in libssl 2020-02-04 14:39:29 +00:00
ssl_init.c Explicitly fetch ciphers and digests in libssl 2020-02-06 11:59:07 +00:00
ssl_lib.c Fix coverity issues 2020-02-14 07:28:46 +10:00
ssl_local.h Deprecate the low level Diffie-Hellman functions. 2020-02-20 19:04:57 +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 Explicitly fetch ciphers and digests in libssl 2020-02-06 11:59:07 +00:00
ssl_utst.c
t1_enc.c Explicitly fetch ciphers and digests in libssl 2020-02-06 11:59:07 +00:00
t1_lib.c Deprecate the low level RSA functions. 2020-02-20 18:58:40 +10:00
t1_trce.c Process GOST ClientKeyExchange message in SSL_trace 2019-11-23 16:27:30 +03:00
tls13_enc.c Explicitly fetch ciphers and digests in libssl 2020-02-06 11:59:07 +00:00
tls_srp.c Replace BUF_ string function calls with OPENSSL_ ones 2019-10-17 23:19:59 +02:00