summaryrefslogtreecommitdiffstats
path: root/src/ssl/ssl_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ssl/ssl_lib.c')
-rw-r--r--src/ssl/ssl_lib.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ssl/ssl_lib.c b/src/ssl/ssl_lib.c
index e95226f..9e1e308 100644
--- a/src/ssl/ssl_lib.c
+++ b/src/ssl/ssl_lib.c
@@ -1975,8 +1975,16 @@ void ssl_update_cache(SSL *s, int mode) {
return;
}
+ int has_new_session = !s->hit;
+ if (!s->server && s->tlsext_ticket_expected) {
+ /* A client may see new sessions on abbreviated handshakes if the server
+ * decides to renew the ticket. Once the handshake is completed, it should
+ * be inserted into the cache. */
+ has_new_session = 1;
+ }
+
SSL_CTX *ctx = s->initial_ctx;
- if ((ctx->session_cache_mode & mode) == mode && !s->hit &&
+ if ((ctx->session_cache_mode & mode) == mode && has_new_session &&
((ctx->session_cache_mode & SSL_SESS_CACHE_NO_INTERNAL_STORE) ||
SSL_CTX_add_session(ctx, s->session)) &&
ctx->new_session_cb != NULL) {
@@ -2960,6 +2968,10 @@ err:
return 0;
}
+int SSL_initial_handshake_complete(const SSL *ssl) {
+ return ssl->s3->initial_handshake_complete;
+}
+
int SSL_CTX_sess_connect(const SSL_CTX *ctx) { return 0; }
int SSL_CTX_sess_connect_good(const SSL_CTX *ctx) { return 0; }
int SSL_CTX_sess_connect_renegotiate(const SSL_CTX *ctx) { return 0; }