Treat sessions as expired on the boundary second.
TLS 1.3 clarifies that a ticket lifetime of zero means the session is unusable. We don't currently pay attention to that field (to be fixed in later changes) but, in preparation for this, switch the >= to a >. Change-Id: I0e67a0d97bc8def04914f121e84d3e7a2d640d2c Reviewed-on: https://boringssl-review.googlesource.com/12102 Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
parent
5b7b09cfca
commit
8e816eb7b6
@ -605,7 +605,7 @@ int ssl_session_is_time_valid(const SSL *ssl, const SSL_SESSION *session) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return session->timeout >= (long)now.tv_sec - session->time;
|
||||
return session->timeout > (long)now.tv_sec - session->time;
|
||||
}
|
||||
|
||||
/* ssl_lookup_session looks up |session_id| in the session cache and sets
|
||||
|
@ -2142,7 +2142,7 @@ static bool TestSessionTimeout() {
|
||||
}
|
||||
|
||||
// Advance the clock just behind the timeout.
|
||||
g_current_time.tv_sec += SSL_DEFAULT_SESSION_TIMEOUT;
|
||||
g_current_time.tv_sec += SSL_DEFAULT_SESSION_TIMEOUT - 1;
|
||||
|
||||
if (!ExpectSessionReused(client_ctx.get(), server_ctx.get(),
|
||||
session.get(),
|
||||
|
Loading…
Reference in New Issue
Block a user