From 02ddbfdf463a730601af4bea5f51a1ed00df5f7a Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Sun, 11 Jan 2015 13:09:11 -0500 Subject: [PATCH] Move Channel ID initialization out of ssl3_new. Configuration data inherited from the ctx happens in SSL_new. (This also gets in the way of using ssl3_free/ssl3_new to implement SSL_clear.) Change-Id: I2773af91abf4e1edc0c1a324bc1e94088d7c2274 Reviewed-on: https://boringssl-review.googlesource.com/2821 Reviewed-by: Adam Langley --- ssl/s3_lib.c | 6 ------ ssl/ssl_lib.c | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index dcdf4eeb..e783c8f0 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -640,12 +640,6 @@ int ssl3_new(SSL *s) { memset(s3->wrec.seq_num, 0, sizeof(s3->wrec.seq_num)); s->s3 = s3; - - s->tlsext_channel_id_enabled = s->ctx->tlsext_channel_id_enabled; - if (s->ctx->tlsext_channel_id_private) { - s->tlsext_channel_id_private = - EVP_PKEY_dup(s->ctx->tlsext_channel_id_private); - } s->method->ssl_clear(s); return 1; diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 5ed35312..76f74084 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -329,6 +329,11 @@ SSL *SSL_new(SSL_CTX *ctx) { s->psk_client_callback = ctx->psk_client_callback; s->psk_server_callback = ctx->psk_server_callback; + s->tlsext_channel_id_enabled = ctx->tlsext_channel_id_enabled; + if (ctx->tlsext_channel_id_private) { + s->tlsext_channel_id_private = EVP_PKEY_dup(ctx->tlsext_channel_id_private); + } + s->signed_cert_timestamps_enabled = s->ctx->signed_cert_timestamps_enabled; s->ocsp_stapling_enabled = s->ctx->ocsp_stapling_enabled;