aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/c_kex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tls/c_kex.cpp')
-rw-r--r--src/tls/c_kex.cpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/tls/c_kex.cpp b/src/tls/c_kex.cpp
index f95f74931..3d79116ca 100644
--- a/src/tls/c_kex.cpp
+++ b/src/tls/c_kex.cpp
@@ -90,7 +90,13 @@ Client_Key_Exchange::Client_Key_Exchange(const MemoryRegion<byte>& contents,
if(using_version == SSL_V3 && (suite.kex_type() == TLS_ALGO_KEYEXCH_NOKEX))
include_length = false;
- deserialize(contents);
+ if(include_length)
+ {
+ TLS_Data_Reader reader(contents);
+ key_material = reader.get_range<byte>(2, 0, 65535);
+ }
+ else
+ key_material = contents;
}
/*
@@ -109,20 +115,6 @@ MemoryVector<byte> Client_Key_Exchange::serialize() const
}
/*
-* Deserialize a Client Key Exchange message
-*/
-void Client_Key_Exchange::deserialize(const MemoryRegion<byte>& buf)
- {
- if(include_length)
- {
- TLS_Data_Reader reader(buf);
- key_material = reader.get_range<byte>(2, 0, 65535);
- }
- else
- key_material = buf;
- }
-
-/*
* Return the pre_master_secret
*/
SecureVector<byte>