Browse Source

Set SID from SSL_CTX

This change ensures that the session ID context of an SSL* is updated
when its SSL_CTX is updated.
kris/onging/CECPQ3_patch15
Adam Langley 10 years ago
parent
commit
a5dc545bbc
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      ssl/ssl_lib.c

+ 5
- 0
ssl/ssl_lib.c 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);
}



Loading…
Cancel
Save