|
Botan
1.11.15
|
#include <tls_messages.h>
Public Member Functions | |
| std::vector< byte > | cookie () const |
| Hello_Verify_Request (const std::vector< byte > &buf) | |
| Hello_Verify_Request (const std::vector< byte > &client_hello_bits, const std::string &client_identity, const SymmetricKey &secret_key) | |
| std::vector< byte > | serialize () const override |
| Handshake_Type | type () const override |
DTLS Hello Verify Request
Definition at line 39 of file tls_messages.h.
| Botan::TLS::Hello_Verify_Request::Hello_Verify_Request | ( | const std::vector< byte > & | buf | ) |
Definition at line 16 of file msg_hello_verify.cpp.
References Botan::TLS::Protocol_Version::DTLS_V10, and Botan::TLS::Protocol_Version::DTLS_V12.
{
if(buf.size() < 3)
throw Decoding_Error("Hello verify request too small");
Protocol_Version version(buf[0], buf[1]);
if(version != Protocol_Version::DTLS_V10 &&
version != Protocol_Version::DTLS_V12)
{
throw Decoding_Error("Unknown version from server in hello verify request");
}
if(static_cast<size_t>(buf[2]) + 3 != buf.size())
throw Decoding_Error("Bad length in hello verify request");
m_cookie.assign(&buf[3], &buf[buf.size()]);
}
| Botan::TLS::Hello_Verify_Request::Hello_Verify_Request | ( | const std::vector< byte > & | client_hello_bits, |
| const std::string & | client_identity, | ||
| const SymmetricKey & | secret_key | ||
| ) |
Definition at line 35 of file msg_hello_verify.cpp.
References Botan::get_mac(), and Botan::unlock().
| std::vector<byte> Botan::TLS::Hello_Verify_Request::cookie | ( | ) | const [inline] |
Definition at line 45 of file tls_messages.h.
Referenced by Botan::TLS::Client_Hello::update_hello_cookie().
{ return m_cookie; }
| std::vector< byte > Botan::TLS::Hello_Verify_Request::serialize | ( | ) | const [override, virtual] |
Implements Botan::TLS::Handshake_Message.
Definition at line 50 of file msg_hello_verify.cpp.
References Botan::TLS::Protocol_Version::DTLS_V10, Botan::TLS::Protocol_Version::major_version(), and Botan::TLS::Protocol_Version::minor_version().
{
/* DTLS 1.2 server implementations SHOULD use DTLS version 1.0
regardless of the version of TLS that is expected to be
negotiated (RFC 6347, section 4.2.1)
*/
Protocol_Version format_version(Protocol_Version::DTLS_V10);
std::vector<byte> bits;
bits.push_back(format_version.major_version());
bits.push_back(format_version.minor_version());
bits.push_back(static_cast<byte>(m_cookie.size()));
bits += m_cookie;
return bits;
}
| Handshake_Type Botan::TLS::Hello_Verify_Request::type | ( | ) | const [inline, override, virtual] |
Implements Botan::TLS::Handshake_Message.
Definition at line 43 of file tls_messages.h.
References Botan::TLS::HELLO_VERIFY_REQUEST.
{ return HELLO_VERIFY_REQUEST; }
1.7.6.1