diff options
author | Remi Gacogne <rgacogne-github@coredump.fr> | 2016-08-06 12:54:29 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-08-17 10:38:20 +0100 |
commit | fddfc0afc84728f8a5140685163e66ce6471742d (patch) | |
tree | b05067c6ca0c4edd19affd7476fd5e04cee451b8 /ssl/ssl_sess.c | |
parent | 46117d31fe420124dd07f8f16d7a76fecc290980 (diff) |
Add missing session id and tlsext_status accessors
* SSL_SESSION_set1_id()
* SSL_SESSION_get0_id_context()
* SSL_CTX_get_tlsext_status_cb()
* SSL_CTX_get_tlsext_status_arg()
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'ssl/ssl_sess.c')
-rw-r--r-- | ssl/ssl_sess.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 1a2872c6e0..509175b1ab 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -240,6 +240,13 @@ const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, *len = s->session_id_length; return s->session_id; } +const unsigned char *SSL_SESSION_get0_id_context(const SSL_SESSION *s, + unsigned int *len) +{ + if (len != NULL) + *len = s->sid_ctx_length; + return s->sid_ctx; +} unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s) { @@ -792,6 +799,19 @@ int SSL_set_session(SSL *s, SSL_SESSION *session) return 1; } +int SSL_SESSION_set1_id(SSL_SESSION *s, const unsigned char *sid, + unsigned int sid_len) +{ + if (sid_len > SSL_MAX_SSL_SESSION_ID_LENGTH) { + SSLerr(SSL_F_SSL_SESSION_SET1_ID, + SSL_R_SSL_SESSION_ID_TOO_LONG); + return 0; + } + s->session_id_length = sid_len; + memcpy(s->session_id, sid, sid_len); + return 1; +} + long SSL_SESSION_set_timeout(SSL_SESSION *s, long t) { if (s == NULL) |