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(client_hello_bits.size());
42 hmac->update(client_hello_bits);
43 hmac->update_be(client_identity.size());
44 hmac->update(client_identity);
46 m_cookie =
unlock(hmac->final());
58 std::vector<uint8_t> bits;
61 bits.push_back(static_cast<uint8_t>(m_cookie.size()));
uint8_t minor_version() const
static std::unique_ptr< MessageAuthenticationCode > create(const std::string &algo_spec, const std::string &provider="")
std::vector< uint8_t > serialize() const override
uint8_t major_version() const
std::vector< T > unlock(const secure_vector< T > &in)
Hello_Verify_Request(const std::vector< uint8_t > &buf)