Index: third_party/tlslite/tlslite/messages.py |
diff --git a/third_party/tlslite/tlslite/messages.py b/third_party/tlslite/tlslite/messages.py |
index fa4d8174c1aeb81f0ddd00af614e568dde22b450..fc23f4cdf74582a9be0d07bbb5db9c3fffff6d98 100644 |
--- a/third_party/tlslite/tlslite/messages.py |
+++ b/third_party/tlslite/tlslite/messages.py |
@@ -131,6 +131,9 @@ class ClientHello(HandshakeMsg): |
self.compression_methods = [] # a list of 8-bit values |
self.srp_username = None # a string |
self.channel_id = False |
+ # client_hello_length is the length of the ClientHello record - i.e. |
+ # including the handshake type byte and 3 byte handshake length. |
+ self.client_hello_length = 0 |
def create(self, version, random, session_id, cipher_suites, |
certificate_types=None, srp_username=None): |
@@ -159,6 +162,11 @@ class ClientHello(HandshakeMsg): |
#We're not doing a stopLengthCheck() for SSLv2, oh well.. |
else: |
+ self.client_hello_length = len(p.bytes) - p.index |
+ # Account for the handshake type byte which has already been |
+ # removed. |
+ self.client_hello_length += 1 |
+ |
p.startLengthCheck(3) |
self.client_version = (p.get(1), p.get(1)) |
self.random = p.getFixBytes(32) |