aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/tls12/tls_server_impl_12.cpp
diff options
context:
space:
mode:
authorRenĂ© Meusel <[email protected]>2022-05-18 13:18:05 +0200
committerGitHub <[email protected]>2022-05-18 13:18:05 +0200
commit15228710faef1b85aaad0cad4f207b8b6dfcdf74 (patch)
treef9bc7580ac098b1cb4ef0b5d284ab59b12ddeca8 /src/lib/tls/tls12/tls_server_impl_12.cpp
parent2fb7ba81b0304f0864a557e3f3a010f4c2ce08d3 (diff)
parent3bedb5f3cb94ecc5607572b404c4a324f7acc2a7 (diff)
Merge pull request #2976 from randombit/tls/timestamp_callbackHEADmaster
Introduce TLS::Callbacks::tls_current_timestamp()
Diffstat (limited to 'src/lib/tls/tls12/tls_server_impl_12.cpp')
-rw-r--r--src/lib/tls/tls12/tls_server_impl_12.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/tls/tls12/tls_server_impl_12.cpp b/src/lib/tls/tls12/tls_server_impl_12.cpp
index 26bfce45d..06fc7dac1 100644
--- a/src/lib/tls/tls12/tls_server_impl_12.cpp
+++ b/src/lib/tls/tls12/tls_server_impl_12.cpp
@@ -62,6 +62,7 @@ namespace {
bool check_for_resume(Session& session_info,
Session_Manager& session_manager,
Credentials_Manager& credentials,
+ Callbacks& cb,
const Client_Hello_12* client_hello,
std::chrono::seconds session_ticket_lifetime)
{
@@ -87,7 +88,7 @@ bool check_for_resume(Session& session_info,
credentials.psk("tls-server", "session-ticket", ""));
if(session_ticket_lifetime != std::chrono::seconds(0) &&
- session_info.session_age() > session_ticket_lifetime)
+ cb.tls_current_timestamp() - session_info.start_time() > session_ticket_lifetime)
return false; // ticket has expired
}
catch(...)
@@ -489,6 +490,7 @@ void Server_Impl_12::process_client_hello_msg(const Handshake_State* active_stat
check_for_resume(session_info,
session_manager(),
m_creds,
+ callbacks(),
pending_state.client_hello(),
std::chrono::seconds(policy().session_ticket_lifetime()));
@@ -637,7 +639,8 @@ void Server_Impl_12::process_finished_msg(Server_Handshake_State& pending_state,
get_peer_cert_chain(pending_state),
std::vector<uint8_t>(),
Server_Information(pending_state.client_hello()->sni_hostname()),
- pending_state.server_hello()->srtp_profile());
+ pending_state.server_hello()->srtp_profile(),
+ callbacks().tls_current_timestamp());
if(save_session(session_info))
{
@@ -825,7 +828,7 @@ void Server_Impl_12::session_create(Server_Handshake_State& pending_state,
*pending_state.client_hello());
Server_Hello_12::Settings srv_settings(
- make_hello_random(rng(), policy()), // new session ID
+ make_hello_random(rng(), callbacks(), policy()), // new session ID
pending_state.version(),
ciphersuite,
have_session_ticket_key);