summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_lib.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>1999-04-30 19:15:56 +0200
committerBodo Möller <bodo@openssl.org>1999-04-30 19:15:56 +0200
commit4eb77b2679729e10d4e27cae5683b1e7fdc7ba62 (patch)
treeb781363d776c1367a8a79a8dc9e8b798fbb49d29 /ssl/ssl_lib.c
parentHopefully improved compatibility with earlier versions of Perl5. (diff)
downloadopenssl-4eb77b2679729e10d4e27cae5683b1e7fdc7ba62.tar.xz
openssl-4eb77b2679729e10d4e27cae5683b1e7fdc7ba62.zip
New function SSL_CTX_set_session_id_context.
Submitted by: Reviewed by: PR:
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r--ssl/ssl_lib.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index a237dda84a..831768351c 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -186,6 +186,8 @@ SSL *SSL_new(SSL_CTX *ctx)
}
else
s->cert=NULL;
+ s->sid_ctx_length=ctx->sid_ctx_length;
+ memcpy(&s->sid_ctx,&ctx->sid_ctx,sizeof(s->sid_ctx));
s->verify_mode=ctx->verify_mode;
s->verify_callback=ctx->default_verify_callback;
CRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX);
@@ -216,6 +218,20 @@ err:
return(NULL);
}
+int SSL_CTX_set_session_id_context(SSL_CTX *ctx,const unsigned char *sid_ctx,
+ unsigned int sid_ctx_len)
+ {
+ if(sid_ctx_len > SSL_MAX_SID_CTX_LENGTH)
+ {
+ SSLerr(SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT,SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG);
+ return 0;
+ }
+ ctx->sid_ctx_length=sid_ctx_len;
+ memcpy(ctx->sid_ctx,sid_ctx,sid_ctx_len);
+
+ return 1;
+ }
+
int SSL_set_session_id_context(SSL *ssl,const unsigned char *sid_ctx,
unsigned int sid_ctx_len)
{