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