aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/c_kex.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-01-19 17:07:03 +0000
committerlloyd <[email protected]>2012-01-19 17:07:03 +0000
commit239241568d4d3ff14d2d1994e5829f3d548f2078 (patch)
treea21fe21d7c229f00ae06859dbe1768ead68e6d13 /src/tls/c_kex.cpp
parent30104a60568b392886c1d717a7ca006378552e4d (diff)
Remove Handshake_Message::deserialize which was an unnecessary hook.
Instead deserialize directly in the constructors that are passed the raw message data. This makes it easier to pass contextual information needed for decoding (eg, version numbers) where necessary.
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>