Go to file
Benjamin Kaduk 2a53855110 Fix a race condition in SNI handling
As was done for ciphers, supported groups, and EC point formats in
https://github.com/openssl/openssl/pull/9162, only write the negotiated
SNI hostname value to the session object when not resuming, even for
TLS 1.3 resumptions.  Otherwise, when using a stateful session cache
(as is done by default when 0-RTT data is enabled), we can have multiple
SSLs active using the same in-memory session object, which leads to
double-frees and similar race conditions in the SNI handler prior
to this commit.

Fortunately, since draft-ietf-tls-tls13-22, there is no requirement
that the SNI hostname be preserved across TLS 1.3 resumption, and thus
not a need to continually update the session object with the "current"
value (to be used when producing session tickets, so that the subsequent
resumption can be checked against the current value).  So we can just
relax the logic and only write to the session object for initial handshakes.
This still leaves us in a somewhat inconsistent state, since if the SNI value
does change across handshakes, the session object will continue to record
the initial handshake's value, even if that bears no relation to the
current handshake.  The current SSL_get_servername() implementation
prefers the value from the session if s->hit, but a more complete fix
for that and related issues is underway in
https://github.com/openssl/openssl/pull/10018; there is no need to wait
for the complete fix for SNI name handling in order to close the
race condition and avoid runtime crashes.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10441)
2019-11-21 18:09:59 -08:00
.github Add a GitHub issue template for documentation issues 2019-10-30 17:46:00 +01:00
apps Document command parameters. 2019-11-20 09:49:52 +01:00
boringssl@2070f8ad91
Configurations Configuration: make Solaris builds with gcc recognise GNU ld 2019-11-10 04:58:08 +01:00
crypto Core: allow NULL argument to stored_namemap_free(). 2019-11-22 08:18:42 +10:00
demos
doc Documentation updates due to naming tweaks 2019-11-21 15:49:58 +00:00
engines Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
external/perl Update the bundled external perl module Text-Template to version 1.56 2019-09-12 12:53:32 +02:00
fuzz Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
include Tweak some algorithm naming inconsistencies 2019-11-21 15:45:37 +00:00
krb5@b9ad6c4950
ms Unify all assembler file generators 2019-09-16 16:29:57 +02:00
os-dep
providers Tweak some algorithm naming inconsistencies 2019-11-21 15:45:37 +00:00
pyca-cryptography@09403100de
ssl Fix a race condition in SNI handling 2019-11-21 18:09:59 -08:00
test Allow specifying the tag after AAD in CCM mode (2) 2019-11-20 10:40:55 +01:00
tools
util Add missing EVP_PKEY_METHOD accessors for digestsign and digestverify 2019-11-17 08:27:06 +01:00
VMS
.gitattributes
.gitignore Add confdump to .gitignore 2019-11-14 09:40:24 +00:00
.gitmodules
.travis-apt-pin.preferences
.travis-create-release.sh
.travis.yml travis.yml: add arch s390x target 2019-11-15 11:15:43 +01:00
ACKNOWLEDGEMENTS
appveyor.yml Configure: Make --strict-warnings meaningful with MSVC cl 2019-11-02 11:00:13 +01:00
AUTHORS
build.info Infrastructure for templated doc in POD files 2019-10-31 14:19:29 +01:00
CHANGES Add a .pragma directive for configuration files 2019-11-12 13:33:12 +01:00
config
config.com
configdata.pm.in confdata.pm.in: New template for configdata.pm 2019-09-12 18:19:27 +02:00
Configure Change the logic and behaviour surrounding '--api' and 'no-deprecated' 2019-11-07 11:37:25 +01:00
CONTRIBUTING
e_os.h Move random-related defines from e_os.h to rand_unix.c 2019-10-19 00:04:27 +02:00
FAQ
HACKING
INSTALL Update INSTALL to document the changed '--api' and 'no-deprecated' 2019-11-07 11:37:37 +01:00
LICENSE
NEWS
NOTES.ANDROID
NOTES.DJGPP
NOTES.PERL
NOTES.UNIX
NOTES.VALGRIND
NOTES.VMS
NOTES.WIN
README Remove the version number in README 2019-10-18 12:22:00 +02:00
README.ENGINE
README.FIPS
VERSION Configure: get version from the file 'VERSION' instead of 'opensslv.h' 2019-10-18 12:22:00 +02:00

 Copyright (c) 1998-2018 The OpenSSL Project
 Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
 All rights reserved.

 DESCRIPTION
 -----------

 The OpenSSL Project is a collaborative effort to develop a robust,
 commercial-grade, fully featured, and Open Source toolkit implementing the
 Transport Layer Security (TLS) protocols (including SSLv3) as well as a
 full-strength general purpose cryptographic library.

 OpenSSL is descended from the SSLeay library developed by Eric A. Young
 and Tim J. Hudson.

 The OpenSSL toolkit is licensed under the Apache License 2.0, which means
 that you are free to get and use it for commercial and non-commercial
 purposes as long as you fulfill its conditions.

 OVERVIEW
 --------

 The OpenSSL toolkit includes:

 libssl (with platform specific naming):
     Provides the client and server-side implementations for SSLv3 and TLS.

 libcrypto (with platform specific naming):
     Provides general cryptographic and X.509 support needed by SSL/TLS but
     not logically part of it.

 openssl:
     A command line tool that can be used for:
        Creation of key parameters
        Creation of X.509 certificates, CSRs and CRLs
        Calculation of message digests
        Encryption and decryption
        SSL/TLS client and server tests
        Handling of S/MIME signed or encrypted mail
        And more...

 INSTALLATION
 ------------

 See the appropriate file:
        INSTALL         Linux, Unix, Windows, OpenVMS, ...
        NOTES.*         INSTALL addendums for different platforms

 SUPPORT
 -------

 See the OpenSSL website www.openssl.org for details on how to obtain
 commercial technical support. Free community support is available through the
 openssl-users email list (see
 https://www.openssl.org/community/mailinglists.html for further details).

 If you have any problems with OpenSSL then please take the following steps
 first:

    - Download the latest version from the repository
      to see if the problem has already been addressed
    - Configure with no-asm
    - Remove compiler optimization flags

 If you wish to report a bug then please include the following information
 and create an issue on GitHub:

    - OpenSSL version: output of 'openssl version -a'
    - Configuration data: output of 'perl configdata.pm --dump'
    - OS Name, Version, Hardware platform
    - Compiler Details (name, version)
    - Application Details (name, version)
    - Problem Description (steps that will reproduce the problem, if known)
    - Stack Traceback (if the application dumps core)

 Just because something doesn't work the way you expect does not mean it
 is necessarily a bug in OpenSSL. Use the openssl-users email list for this type
 of query.

 HOW TO CONTRIBUTE TO OpenSSL
 ----------------------------

 See CONTRIBUTING

 LEGALITIES
 ----------

 A number of nations restrict the use or export of cryptography. If you
 are potentially subject to such restrictions you should seek competent
 professional legal advice before attempting to develop or distribute
 cryptographic code.