8#include <botan/tls_messages.h>
22 throw Decoding_Error(
"Unknown version from server in hello verify request");
25 if(
static_cast<size_t>(buf[2]) + 3 != buf.size())
28 m_cookie.assign(buf.begin() + 3, buf.end());
32 std::string_view client_identity,
36 hmac->set_key(secret_key);
38 hmac->update_be(
static_cast<uint64_t
>(client_hello_bits.size()));
39 hmac->update(client_hello_bits);
40 hmac->update_be(
static_cast<uint64_t
>(client_identity.size()));
41 hmac->update(client_identity);
43 m_cookie.resize(hmac->output_length());
44 hmac->final(m_cookie.data());
56 std::vector<uint8_t> bits;
59 bits.push_back(
static_cast<uint8_t
>(m_cookie.size()));
static std::unique_ptr< MessageAuthenticationCode > create_or_throw(std::string_view algo_spec, std::string_view provider="")
Hello_Verify_Request(const std::vector< uint8_t > &buf)
std::vector< uint8_t > serialize() const override
uint8_t major_version() const
bool is_datagram_protocol() const
uint8_t minor_version() const