Copy custom extension flags in a call to SSL_set_SSL_CTX()
authorMatt Caswell <matt@openssl.org>
Wed, 10 May 2017 10:28:53 +0000 (11:28 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 10 May 2017 15:49:00 +0000 (16:49 +0100)
commit21181889d78f95f10738813285f681acd3b32c6c
treec5ff13183d4986cba98218d581eafcdeeb0163da
parentcf53cbea5bbf9c3a1998e2ddd0173881a5a97475
Copy custom extension flags in a call to SSL_set_SSL_CTX()

The function SSL_set_SSL_CTX() can be used to swap the SSL_CTX used for
a connection as part of an SNI callback. One result of this is that the
s->cert structure is replaced. However this structure contains information
about any custom extensions that have been loaded. In particular flags are
set indicating whether a particular extension has been received in the
ClientHello. By replacing the s->cert structure we lose the custom
extension flag values, and it appears as if a client has not sent those
extensions.

SSL_set_SSL_CTX() should copy any flags for custom extensions that appear
in both the old and the new cert structure.

Fixes #2180

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3425)
ssl/ssl_lib.c
ssl/ssl_locl.h
ssl/statem/extensions_cust.c