14#ifndef BOTAN_TLS_EXTENSIONS_13_H_
15#define BOTAN_TLS_EXTENSIONS_13_H_
17#include <botan/pkix_types.h>
18#include <botan/tls_extensions.h>
19#include <botan/tls_external_psk.h>
20#include <botan/tls_session.h>
50 bool empty()
const override {
return m_cookie.empty(); }
52 const std::vector<uint8_t>&
get_cookie()
const {
return m_cookie; }
54 explicit Cookie(
const std::vector<uint8_t>& cookie);
59 std::vector<uint8_t> m_cookie;
73 bool empty()
const override {
return m_modes.empty(); }
75 const std::vector<PSK_Key_Exchange_Mode>&
modes()
const {
return m_modes; }
82 std::vector<PSK_Key_Exchange_Mode> m_modes;
96 bool empty()
const override {
return m_distinguished_names.empty(); }
104 std::vector<X509_DN> m_distinguished_names;
129 std::pair<std::optional<std::string>, std::unique_ptr<Cipher_State>> take_selected_psk_info(
137 std::unique_ptr<PSK> select_offered_psk(std::string_view host,
155 std::variant<Session, ExternalPSK> take_session_to_resume_or_psk();
157 bool empty()
const override;
173 PSK(std::optional<Session_with_Handle>& session_to_resume, std::vector<ExternalPSK> psks,
Callbacks& callbacks);
178 bool validate_binder(
const PSK& server_psk,
const std::vector<uint8_t>& binder)
const;
191 PSK(
Session session_to_resume, uint16_t psk_index);
204 std::unique_ptr<PSK_Internal> m_impl;
218 bool empty()
const override;
228 static std::unique_ptr<Key_Share> create_as_encapsulation(
Group_Params selected_group,
252 void retry_offer(
const Key_Share& retry_request_keyshare,
253 const std::vector<Named_Group>& supported_groups,
260 std::vector<Named_Group> offered_groups()
const;
297 class Key_Share_Impl;
298 std::unique_ptr<Key_Share_Impl> m_impl;
312 bool empty()
const override;
327 std::optional<uint32_t> m_max_early_data_size;
#define BOTAN_UNSTABLE_API
static Extension_Code static_type()
Certificate_Authorities(TLS_Data_Reader &reader, uint16_t extension_size)
Extension_Code type() const override
bool empty() const override
const std::vector< X509_DN > & distinguished_names() const
bool empty() const override
const std::vector< uint8_t > & get_cookie() const
Cookie(const std::vector< uint8_t > &cookie)
static Extension_Code static_type()
Extension_Code type() const override
std::optional< uint32_t > max_early_data_size() const
EarlyDataIndication(std::optional< uint32_t > max_early_data_size=std::nullopt)
Extension_Code type() const override
static Extension_Code static_type()
EarlyDataIndication(TLS_Data_Reader &reader, uint16_t extension_size, Handshake_Type message_type)
Named_Group selected_group() const
static Extension_Code static_type()
Key_Share(TLS_Data_Reader &reader, uint16_t extension_size, Handshake_Type message_type)
Extension_Code type() const override
Extension_Code type() const override
static Extension_Code static_type()
const std::vector< PSK_Key_Exchange_Mode > & modes() const
PSK_Key_Exchange_Modes(std::vector< PSK_Key_Exchange_Mode > modes)
bool empty() const override
Extension_Code type() const override
bool validate_binder(const PSK &server_psk, const std::vector< uint8_t > &binder) const
void calculate_binders(const Transcript_Hash_State &truncated_transcript_hash)
static Extension_Code static_type()
PSK(TLS_Data_Reader &reader, uint16_t extension_size, Handshake_Type message_type)
std::vector< T, secure_allocator< T > > secure_vector