Botan 3.9.0
Crypto and TLS for C&
tls_session_manager_noop.h
Go to the documentation of this file.
1/*
2* TLS Session Manager Noop
3* (C) 2011 Jack Lloyd
4* 2023 René Meusel - Rohde & Schwarz Cybersecurity
5*
6* Botan is released under the Simplified BSD License (see license.txt)
7*/
8
9#ifndef BOTAN_TLS_SESSION_MANAGER_NOOP_H_
10#define BOTAN_TLS_SESSION_MANAGER_NOOP_H_
11
12#include <botan/tls_session_manager.h>
13
14namespace Botan::TLS {
15
16/**
17 * An implementation of Session_Manager that does not save sessions at all,
18 * preventing session resumption.
19 *
20 * For applications that do not want to support session resumption at all,
21 * this is typically a good choice.
22 */
24 public:
26
27 std::optional<Session_Handle> establish(const Session& /*session*/,
28 const std::optional<Session_ID>& /*session_id*/ = std::nullopt,
29 bool /*tls12_no_ticket*/ = false) override {
30 return {};
31 }
32
33 void store(const Session& /*session*/, const Session_Handle& /*handle*/) override {}
34
35 size_t remove(const Session_Handle& /*session*/) override { return 0; }
36
37 size_t remove_all() override { return 0; }
38
39 protected:
40 std::optional<Session> retrieve_one(const Session_Handle& /*handle*/) override { return {}; }
41
42 std::vector<Session_with_Handle> find_some(const Server_Information& /*info*/,
43 size_t /*max_sessions_hint*/) override {
44 return {};
45 }
46};
47
48} // namespace Botan::TLS
49
50#endif
#define BOTAN_PUBLIC_API(maj, min)
Definition api.h:21
Helper class to embody a session handle in all protocol versions.
Definition tls_session.h:63
size_t remove(const Session_Handle &) override
std::optional< Session_Handle > establish(const Session &, const std::optional< Session_ID > &=std::nullopt, bool=false) override
Save a new Session and assign a Session_Handle (TLS Server)
void store(const Session &, const Session_Handle &) override
Save a Session under a Session_Handle (TLS Client)
std::vector< Session_with_Handle > find_some(const Server_Information &, size_t) override
Internal retrieval function to find sessions to resume.
std::optional< Session > retrieve_one(const Session_Handle &) override
Internal retrieval function for a single session.
BOTAN_FUTURE_EXPLICIT Session_Manager(const std::shared_ptr< RandomNumberGenerator > &rng)