OLD | NEW |
(Empty) | |
| 1 diff --git a/third_party/tlslite/tlslite/TLSConnection.py b/third_party/tlslite/
tlslite/TLSConnection.py |
| 2 index e882e2c..ffe43a1 100644 |
| 3 --- a/third_party/tlslite/tlslite/TLSConnection.py |
| 4 +++ b/third_party/tlslite/tlslite/TLSConnection.py |
| 5 @@ -1108,6 +1108,7 @@ class TLSConnection(TLSRecordLayer): |
| 6 else: |
| 7 break |
| 8 clientHello = result |
| 9 + self.client_hello_length = clientHello.client_hello_length |
| 10 |
| 11 #If client's version is too low, reject it |
| 12 if clientHello.client_version < settings.minVersion: |
| 13 diff --git a/third_party/tlslite/tlslite/messages.py b/third_party/tlslite/tlsli
te/messages.py |
| 14 index fa4d817..fc23f4c 100644 |
| 15 --- a/third_party/tlslite/tlslite/messages.py |
| 16 +++ b/third_party/tlslite/tlslite/messages.py |
| 17 @@ -131,6 +131,9 @@ class ClientHello(HandshakeMsg): |
| 18 self.compression_methods = [] # a list of 8-bit values |
| 19 self.srp_username = None # a string |
| 20 self.channel_id = False |
| 21 + # client_hello_length is the length of the ClientHello record - i.e. |
| 22 + # including the handshake type byte and 3 byte handshake length. |
| 23 + self.client_hello_length = 0 |
| 24 |
| 25 def create(self, version, random, session_id, cipher_suites, |
| 26 certificate_types=None, srp_username=None): |
| 27 @@ -159,6 +162,11 @@ class ClientHello(HandshakeMsg): |
| 28 |
| 29 #We're not doing a stopLengthCheck() for SSLv2, oh well.. |
| 30 else: |
| 31 + self.client_hello_length = len(p.bytes) - p.index |
| 32 + # Account for the handshake type byte which has already been |
| 33 + # removed. |
| 34 + self.client_hello_length += 1 |
| 35 + |
| 36 p.startLengthCheck(3) |
| 37 self.client_version = (p.get(1), p.get(1)) |
| 38 self.random = p.getFixBytes(32) |
OLD | NEW |