Botan 3.11.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
31 void store(const Session& /*session*/, const Session_Handle& /*handle*/) override {}
32
33 size_t remove(const Session_Handle& /*session*/) override { return 0; }
34
35 size_t remove_all() override { return 0; }
36
37 protected:
38 std::optional<Session> retrieve_one(const Session_Handle& handle) override;
39
40 std::vector<Session_with_Handle> find_some(const Server_Information& info, size_t max_sessions_hint) override;
41};
42
43} // namespace Botan::TLS
44
45#endif
#define BOTAN_PUBLIC_API(maj, min)
Definition api.h:21
Helper class to embody a session handle in all protocol versions.
size_t remove(const Session_Handle &) override
std::optional< Session_Handle > establish(const Session &session, const std::optional< Session_ID > &session_id=std::nullopt, bool tls12_no_ticket=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).
BOTAN_FUTURE_EXPLICIT Session_Manager(const std::shared_ptr< RandomNumberGenerator > &rng)