openssl/ssl
John Baldwin 074a6e86e6 Use a flag in SSL3_BUFFER to track when an application buffer is reused.
With KTLS, writes to an SSL connection store the application buffer
pointer directly in the 'buf' member instead of allocating a separate
buffer to hold the encrypted data.  As a result,
ssl3_release_write_buffer() has to avoid freeing these 'buf' pointers.

Previously, ssl3_release_write_buffer() checked for KTLS being enabled
on the write BIO to determine if a buffer should be freed.  However, a
buffer can outlive a BIO.  For example, 'openssl s_time' creates new
write BIOs when reusing sessions.  Since the new BIO did not have KTLS
enabled at the start of a connection, ssl3_release_write_buffer()
would incorrectly try to free the 'buf' pointer from the previous KTLS
connection.  To fix, track the state of 'buf' explicitly in
SSL3_BUFFER to determine if the 'buf' should be freed or simply
cleared.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/10489)
2020-03-16 10:41:51 +01:00
..
record Use a flag in SSL3_BUFFER to track when an application buffer is reused. 2020-03-16 10:41:51 +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