Botan 3.6.1
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&,
28 const std::optional<Session_ID>& = std::nullopt,
29 bool = false) override {
30 return std::nullopt;
31 }
32
33 void store(const Session&, const Session_Handle&) override {}
34
35 size_t remove(const Session_Handle&) override { return 0; }
36
37 size_t remove_all() override { return 0; }
38
39 protected:
40 std::optional<Session> retrieve_one(const Session_Handle&) override { return std::nullopt; }
41
42 std::vector<Session_with_Handle> find_some(const Server_Information&, const size_t) override { return {}; }
43};
44
45} // namespace Botan::TLS
46
47#endif
Helper class to embody a session handle in all protocol versions.
Definition tls_session.h:64
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 &, const 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.
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
Definition compiler.h:31