openssl/ssl
Benjamin Kaduk d74014c4b8 Don't write to the session when computing TLS 1.3 keys
TLS 1.3 maintains a separate keys chedule in the SSL object, but
was writing to the 'master_key_length' field in the SSL_SESSION
when generating the per-SSL master_secret.  (The generate_master_secret
SSL3_ENC_METHOD function needs an output variable for the master secret
length, but the TLS 1.3 implementation just uses the output size of
the handshake hash function to get the lengths, so the only natural-looking
thing to use as the output length was the field in the session.
This would potentially involve writing to a SSL_SESSION object that was
in the cache (i.e., resumed) and shared with other threads, though.

The thread-safety impact should be minimal, since TLS 1.3 requires the
hash from the original handshake to be associated with the resumption
PSK and used for the subsequent connection.  This means that (in the
resumption case) the value being written would be the same value that was
previously there, so the only risk would be on architectures that can
produce torn writes/reads for aligned size_t values.

Since the value is essentially ignored anyway, just provide the
address of a local dummy variable to generate_master_secret() instead.

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 Don't write to the session when computing TLS 1.3 keys 2020-03-13 14:20:14 -07:00
bio_ssl.c Reorganize local header files 2019-09-28 20:26:35 +02:00
build.info If we are multiblock capable make sure we use it 2019-08-14 11:04:09 +01:00
d1_lib.c Reorganize local header files 2019-09-28 20:26:35 +02:00
d1_msg.c Reorganize local header files 2019-09-28 20:26:35 +02:00
d1_srtp.c Reorganize local header files 2019-09-28 20:26:35 +02:00
methods.c Update some inclusions of <openssl/macros.h> 2019-11-07 11:37:25 +01:00
pqueue.c Reorganize local header files 2019-09-28 20:26:35 +02:00
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 Reorganize local header files 2019-09-28 20:26:35 +02:00
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 Following the license change, modify the boilerplates in ssl/ 2018-12-06 14:20:59 +01:00
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 Reorganize local header files 2019-09-28 20:26:35 +02:00
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 Reorganize local header files 2019-09-28 20:26:35 +02:00
ssl_txt.c Explicitly fetch ciphers and digests in libssl 2020-02-06 11:59:07 +00:00
ssl_utst.c Reorganize local header files 2019-09-28 20:26:35 +02:00
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