aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/msg_server_hello.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-12-11 15:28:38 -0500
committerJack Lloyd <[email protected]>2016-12-18 16:48:24 -0500
commitf3cb3edb512bdcab498d825886c3366c341b3f78 (patch)
tree645c73ec295a5a34f25d99903b6d9fa9751e86d3 /src/lib/tls/msg_server_hello.cpp
parentc1dd21253c1f3188ff45d3ad47698efd08235ae8 (diff)
Convert to using standard uintN_t integer types
Renames a couple of functions for somewhat better name consistency, eg make_u32bit becomes make_uint32. The old typedefs remain for now since probably lots of application code uses them.
Diffstat (limited to 'src/lib/tls/msg_server_hello.cpp')
-rw-r--r--src/lib/tls/msg_server_hello.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/tls/msg_server_hello.cpp b/src/lib/tls/msg_server_hello.cpp
index 37e521403..9d84a29e0 100644
--- a/src/lib/tls/msg_server_hello.cpp
+++ b/src/lib/tls/msg_server_hello.cpp
@@ -22,7 +22,7 @@ Server_Hello::Server_Hello(Handshake_IO& io,
Handshake_Hash& hash,
const Policy& policy,
RandomNumberGenerator& rng,
- const std::vector<byte>& reneg_info,
+ const std::vector<uint8_t>& reneg_info,
const Client_Hello& client_hello,
const Server_Hello::Settings& server_settings,
const std::string next_protocol) :
@@ -62,12 +62,12 @@ Server_Hello::Server_Hello(Handshake_IO& io,
if(m_version.is_datagram_protocol())
{
- const std::vector<u16bit> server_srtp = policy.srtp_profiles();
- const std::vector<u16bit> client_srtp = client_hello.srtp_profiles();
+ const std::vector<uint16_t> server_srtp = policy.srtp_profiles();
+ const std::vector<uint16_t> client_srtp = client_hello.srtp_profiles();
if(!server_srtp.empty() && !client_srtp.empty())
{
- u16bit shared = 0;
+ uint16_t shared = 0;
// always using server preferences for now
for(auto s_srtp : server_srtp)
for(auto c_srtp : client_srtp)
@@ -89,7 +89,7 @@ Server_Hello::Server_Hello(Handshake_IO& io,
Handshake_Hash& hash,
const Policy& policy,
RandomNumberGenerator& rng,
- const std::vector<byte>& reneg_info,
+ const std::vector<uint8_t>& reneg_info,
const Client_Hello& client_hello,
Session& resumed_session,
bool offer_session_ticket,
@@ -139,23 +139,23 @@ Server_Hello::Server_Hello(Handshake_IO& io,
/*
* Deserialize a Server Hello message
*/
-Server_Hello::Server_Hello(const std::vector<byte>& buf)
+Server_Hello::Server_Hello(const std::vector<uint8_t>& buf)
{
if(buf.size() < 38)
throw Decoding_Error("Server_Hello: Packet corrupted");
TLS_Data_Reader reader("ServerHello", buf);
- const byte major_version = reader.get_byte();
- const byte minor_version = reader.get_byte();
+ const uint8_t major_version = reader.get_byte();
+ const uint8_t minor_version = reader.get_byte();
m_version = Protocol_Version(major_version, minor_version);
- m_random = reader.get_fixed<byte>(32);
+ m_random = reader.get_fixed<uint8_t>(32);
- m_session_id = reader.get_range<byte>(1, 0, 32);
+ m_session_id = reader.get_range<uint8_t>(1, 0, 32);
- m_ciphersuite = reader.get_u16bit();
+ m_ciphersuite = reader.get_uint16_t();
m_comp_method = reader.get_byte();
@@ -165,9 +165,9 @@ Server_Hello::Server_Hello(const std::vector<byte>& buf)
/*
* Serialize a Server Hello message
*/
-std::vector<byte> Server_Hello::serialize() const
+std::vector<uint8_t> Server_Hello::serialize() const
{
- std::vector<byte> buf;
+ std::vector<uint8_t> buf;
buf.push_back(m_version.major_version());
buf.push_back(m_version.minor_version());
@@ -197,7 +197,7 @@ Server_Hello_Done::Server_Hello_Done(Handshake_IO& io,
/*
* Deserialize a Server Hello Done message
*/
-Server_Hello_Done::Server_Hello_Done(const std::vector<byte>& buf)
+Server_Hello_Done::Server_Hello_Done(const std::vector<uint8_t>& buf)
{
if(buf.size())
throw Decoding_Error("Server_Hello_Done: Must be empty, and is not");
@@ -206,9 +206,9 @@ Server_Hello_Done::Server_Hello_Done(const std::vector<byte>& buf)
/*
* Serialize a Server Hello Done message
*/
-std::vector<byte> Server_Hello_Done::serialize() const
+std::vector<uint8_t> Server_Hello_Done::serialize() const
{
- return std::vector<byte>();
+ return std::vector<uint8_t>();
}
}