aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/tls_session_manager.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-11-13 15:34:52 -0500
committerJack Lloyd <[email protected]>2015-11-13 15:34:52 -0500
commit81edfc8221b9da94ac1a453e78bf57a5a739b4ce (patch)
tree14ae41bfae45495ccfc2b5d1efe2b01b28a2c849 /src/lib/tls/tls_session_manager.h
parent309252789ec3d3b29a7cd30f7d3095fe38e02fa2 (diff)
Add remove_all to TLS session manager interface
DB::spin now returns the number of rows affected
Diffstat (limited to 'src/lib/tls/tls_session_manager.h')
-rw-r--r--src/lib/tls/tls_session_manager.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/tls/tls_session_manager.h b/src/lib/tls/tls_session_manager.h
index c7aa1960b..5ab151c26 100644
--- a/src/lib/tls/tls_session_manager.h
+++ b/src/lib/tls/tls_session_manager.h
@@ -55,6 +55,11 @@ class BOTAN_DLL Session_Manager
virtual void remove_entry(const std::vector<byte>& session_id) = 0;
/**
+ * Remove all sessions from the cache, return number of sessions deleted
+ */
+ virtual size_t remove_all() = 0;
+
+ /**
* Save a session on a best effort basis; the manager may not in
* fact be able to save the session for whatever reason; this is
* not an error. Caller cannot assume that calling save followed
@@ -89,6 +94,8 @@ class BOTAN_DLL Session_Manager_Noop : public Session_Manager
void remove_entry(const std::vector<byte>&) override {}
+ size_t remove_all() override { return 0; }
+
void save(const Session&) override {}
std::chrono::seconds session_lifetime() const override
@@ -120,6 +127,8 @@ class BOTAN_DLL Session_Manager_In_Memory : public Session_Manager
void remove_entry(const std::vector<byte>& session_id) override;
+ size_t remove_all();
+
void save(const Session& session_data) override;
std::chrono::seconds session_lifetime() const override
@@ -136,7 +145,7 @@ class BOTAN_DLL Session_Manager_In_Memory : public Session_Manager
std::chrono::seconds m_session_lifetime;
RandomNumberGenerator& m_rng;
- SymmetricKey m_session_key;
+ secure_vector<byte> m_session_key;
std::map<std::string, std::vector<byte>> m_sessions; // hex(session_id) -> session
std::map<Server_Information, std::string> m_info_sessions;