diff options
author | Matt Caswell <matt@openssl.org> | 2017-07-05 08:45:46 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-07-07 15:02:09 +0100 |
commit | 9b6a82546151d6f971628e2d7828752ee47bfef7 (patch) | |
tree | d06ef726a463be94649301639b19307a59260fc0 /ssl/ssl_sess.c | |
parent | 07ff590f8f2d0affcd89afad103274100bb5705b (diff) | |
download | openssl-new-9b6a82546151d6f971628e2d7828752ee47bfef7.tar.gz |
Send and receive the ticket_nonce field in a NewSessionTicket
This just adds the processing for sending and receiving the newly added
ticket_nonce field. It doesn't actually use it yet.
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/3852)
Diffstat (limited to 'ssl/ssl_sess.c')
-rw-r--r-- | ssl/ssl_sess.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index e7fe714e58..8740e15daa 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -130,6 +130,8 @@ SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket) dest->peer = NULL; memset(&dest->ex_data, 0, sizeof(dest->ex_data)); + dest->ext.tick_nonce = NULL; + /* We deliberately don't copy the prev and next pointers */ dest->prev = NULL; dest->next = NULL; @@ -222,6 +224,13 @@ SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket) } } + if (src->ext.tick_nonce != NULL) { + dest->ext.tick_nonce = OPENSSL_memdup(src->ext.tick_nonce, + src->ext.tick_nonce_len); + if (dest->ext.tick_nonce == NULL) + goto err; + } + #ifndef OPENSSL_NO_SRP if (src->srp_username) { dest->srp_username = OPENSSL_strdup(src->srp_username); @@ -785,6 +794,7 @@ void SSL_SESSION_free(SSL_SESSION *ss) OPENSSL_free(ss->srp_username); #endif OPENSSL_free(ss->ext.alpn_selected); + OPENSSL_free(ss->ext.tick_nonce); CRYPTO_THREAD_lock_free(ss->lock); OPENSSL_clear_free(ss, sizeof(*ss)); } |