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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/tlslite/README.chromium ('k') | third_party/tlslite/tlslite/TLSConnection.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tlslite/patches/record_client_hello_length.patch
diff --git a/third_party/tlslite/patches/record_client_hello_length.patch b/third_party/tlslite/patches/record_client_hello_length.patch
new file mode 100644
index 0000000000000000000000000000000000000000..e7183a4ba03127912f00b4e9cc4d422e4a0c9e60
--- /dev/null
+++ b/third_party/tlslite/patches/record_client_hello_length.patch
@@ -0,0 +1,38 @@
+diff --git a/third_party/tlslite/tlslite/TLSConnection.py b/third_party/tlslite/tlslite/TLSConnection.py
+index e882e2c..ffe43a1 100644
+--- a/third_party/tlslite/tlslite/TLSConnection.py
++++ b/third_party/tlslite/tlslite/TLSConnection.py
+@@ -1108,6 +1108,7 @@ class TLSConnection(TLSRecordLayer):
+ else:
+ break
+ clientHello = result
++ self.client_hello_length = clientHello.client_hello_length
+
+ #If client's version is too low, reject it
+ if clientHello.client_version < settings.minVersion:
+diff --git a/third_party/tlslite/tlslite/messages.py b/third_party/tlslite/tlslite/messages.py
+index fa4d817..fc23f4c 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)
« 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