/src/botan/build/include/botan/internal/tls_server_impl.h
Line | Count | Source |
1 | | /* |
2 | | * TLS Server |
3 | | * (C) 2004-2011 Jack Lloyd |
4 | | * 2016 Matthias Gierlings |
5 | | * 2021 Elektrobit Automotive GmbH |
6 | | * |
7 | | * Botan is released under the Simplified BSD License (see license.txt) |
8 | | */ |
9 | | |
10 | | #ifndef BOTAN_TLS_SERVER_IMPL_H_ |
11 | | #define BOTAN_TLS_SERVER_IMPL_H_ |
12 | | |
13 | | #include <botan/tls_magic.h> |
14 | | #include <vector> |
15 | | #include <memory> |
16 | | #include <string> |
17 | | |
18 | | namespace Botan { |
19 | | |
20 | | namespace TLS { |
21 | | |
22 | | class Handshake_State; |
23 | | class Handshake_IO; |
24 | | class Channel_Impl; |
25 | | |
26 | | /** |
27 | | * Interface of pimpl for Server |
28 | | */ |
29 | | class Server_Impl |
30 | | { |
31 | | public: |
32 | 4.53k | virtual ~Server_Impl() = default; |
33 | | |
34 | 4.53k | explicit Server_Impl(Channel_Impl& impl) : m_impl{impl} {} |
35 | | |
36 | 4.53k | Channel_Impl& channel() { return m_impl; } |
37 | | |
38 | | /** |
39 | | * Return the protocol notification set by the client (using the |
40 | | * ALPN extension) for this connection, if any. This value is not |
41 | | * tied to the session and a later renegotiation of the same |
42 | | * session can choose a new protocol. |
43 | | */ |
44 | | virtual std::string next_protocol() const = 0; |
45 | | |
46 | | /** |
47 | | * Return the protocol notification set by the client (using the |
48 | | * ALPN extension) for this connection, if any. This value is not |
49 | | * tied to the session and a later renegotiation of the same |
50 | | * session can choose a new protocol. |
51 | | */ |
52 | | virtual std::string application_protocol() const = 0; |
53 | | |
54 | | virtual void initiate_handshake(Handshake_State& state, |
55 | | bool force_full_renegotiation) = 0; |
56 | | |
57 | | virtual void process_handshake_msg(const Handshake_State* active_state, |
58 | | Handshake_State& pending_state, |
59 | | Handshake_Type type, |
60 | | const std::vector<uint8_t>& contents, |
61 | | bool epoch0_restart) = 0; |
62 | | |
63 | | virtual std::unique_ptr<Handshake_State> new_handshake_state(std::unique_ptr<Handshake_IO> io) = 0; |
64 | | |
65 | | private: |
66 | | Channel_Impl& m_impl; |
67 | | }; |
68 | | } |
69 | | } |
70 | | |
71 | | #endif |