aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tls/tls_client.cpp')
-rw-r--r--src/tls/tls_client.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tls/tls_client.cpp b/src/tls/tls_client.cpp
index b7249081b..e0dd3f9dc 100644
--- a/src/tls/tls_client.cpp
+++ b/src/tls/tls_client.cpp
@@ -20,7 +20,7 @@ namespace Botan {
*/
TLS_Client::TLS_Client(std::tr1::function<void (const byte[], size_t)> output_fn,
std::tr1::function<void (const byte[], size_t, u16bit)> proc_fn,
- std::tr1::function<void (const TLS_Session&)> handshake_fn,
+ std::tr1::function<bool (const TLS_Session&)> handshake_fn,
TLS_Session_Manager& session_manager,
Credentials_Manager& creds,
const TLS_Policy& policy,
@@ -384,10 +384,13 @@ void TLS_Client::process_handshake_msg(Handshake_Type type,
""
);
- session_manager.save(session_info);
+ bool save_session = true;
if(handshake_fn)
- handshake_fn(session_info);
+ save_session = handshake_fn(session_info);
+
+ if(save_session)
+ session_manager.save(session_info);
secure_renegotiation.update(state->client_finished, state->server_finished);