summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-03-14 17:26:46 +0000
committerMatt Caswell <matt@openssl.org>2017-03-14 23:15:21 +0000
commite29d7cea332e58678640aaa84c6ddfaa0adce74f (patch)
tree9dd45a99c86bc852ae316f24ec21f6ac6b9a2c8f
parente0926ef49df09a85117d7442db83f321aeb5b982 (diff)
Ensure we set the session id context in ossl_shim
OpenSSL requires that we set the session id context. BoringSSL apparently does not require this, so wasn't setting it. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2942)
-rw-r--r--test/ossl_shim/ossl_shim.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ossl_shim/ossl_shim.cc b/test/ossl_shim/ossl_shim.cc
index 79edaddae4..be589e36d1 100644
--- a/test/ossl_shim/ossl_shim.cc
+++ b/test/ossl_shim/ossl_shim.cc
@@ -518,6 +518,7 @@ class SocketCloser {
};
static bssl::UniquePtr<SSL_CTX> SetupCtx(const TestConfig *config) {
+ const char sess_id_ctx[] = "ossl_shim";
bssl::UniquePtr<SSL_CTX> ssl_ctx(SSL_CTX_new(
config->is_dtls ? DTLS_method() : TLS_method()));
if (!ssl_ctx) {
@@ -633,6 +634,10 @@ static bssl::UniquePtr<SSL_CTX> SetupCtx(const TestConfig *config) {
SSL_CTX_set_client_CA_list(ssl_ctx.get(), nullptr);
}
+ SSL_CTX_set_session_id_context(ssl_ctx.get(),
+ (const unsigned char *)sess_id_ctx,
+ sizeof(sess_id_ctx) - 1);
+
return ssl_ctx;
}