Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: third_party/tlslite/patches/record_client_hello_length.patch

Issue 19557004: net: add a test to ensure that our TLS handshake doesn't get too large. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update ChromeFrame test exclusions. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/tlslite/README.chromium ('k') | third_party/tlslite/tlslite/TLSConnection.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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)
OLDNEW
« no previous file with comments | « third_party/tlslite/README.chromium ('k') | third_party/tlslite/tlslite/TLSConnection.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698