aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/msg_client_hello.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-06-18 08:40:36 -0400
committerJack Lloyd <[email protected]>2019-06-18 19:25:57 -0400
commitc43acdfa8c29d78deadd01baac597e1cb6804c6a (patch)
treed865616dd053f0a4ac8bf5f974b108275748eb32 /src/lib/tls/msg_client_hello.cpp
parentefcec12b00aa69eed577c50c9241bc3838b3001a (diff)
Add support for HelloVerifyRequest on server side
Closes GH #1833
Diffstat (limited to 'src/lib/tls/msg_client_hello.cpp')
-rw-r--r--src/lib/tls/msg_client_hello.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/tls/msg_client_hello.cpp b/src/lib/tls/msg_client_hello.cpp
index a3e1206df..149f3f0d4 100644
--- a/src/lib/tls/msg_client_hello.cpp
+++ b/src/lib/tls/msg_client_hello.cpp
@@ -259,6 +259,25 @@ std::vector<uint8_t> Client_Hello::serialize() const
return buf;
}
+std::vector<uint8_t> Client_Hello::cookie_input_data() const
+ {
+ std::vector<uint8_t> buf;
+
+ buf.push_back(m_version.major_version());
+ buf.push_back(m_version.minor_version());
+ buf += m_random;
+
+ append_tls_length_value(buf, m_session_id, 1);
+
+ append_tls_length_value(buf, m_suites, 2);
+ append_tls_length_value(buf, m_comp_methods, 1);
+
+ // Here we don't serialize the extensions since the client extensions
+ // may contain values we don't know how to serialize back.
+
+ return buf;
+ }
+
/*
* Read a counterparty client hello
*/