Set SID from SSL_CTX

This change ensures that the session ID context of an SSL* is updated
when its SSL_CTX is updated.
This commit is contained in:
Adam Langley
2014-06-20 13:17:36 -07:00
parent dc9b141127
commit a5dc545bbc
+5
View File
@@ -3166,6 +3166,11 @@ SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX* ctx)
if (ssl->ctx != NULL)
SSL_CTX_free(ssl->ctx); /* decrement reference count */
ssl->ctx = ctx;
ssl->sid_ctx_length = ctx->sid_ctx_length;
assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx));
memcpy(ssl->sid_ctx, ctx->sid_ctx, sizeof(ssl->sid_ctx));
return(ssl->ctx);
}