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

Unified Diff: third_party/tlslite/tlslite/tlsrecordlayer.py

Issue 1306553002: Implement extended master secret in tlslite (again) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/tlslite/tlsconnection.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tlslite/tlslite/tlsrecordlayer.py
diff --git a/third_party/tlslite/tlslite/tlsrecordlayer.py b/third_party/tlslite/tlslite/tlsrecordlayer.py
index c3bcd8c40ca64a12e426bc1f23ff3eff3d0305b4..d2320b8cd13f34864061202b0507b83e14dd363d 100644
--- a/third_party/tlslite/tlslite/tlsrecordlayer.py
+++ b/third_party/tlslite/tlslite/tlsrecordlayer.py
@@ -119,6 +119,7 @@ class TLSRecordLayer(object):
self._handshake_md5 = hashlib.md5()
self._handshake_sha = hashlib.sha1()
self._handshake_sha256 = hashlib.sha256()
+ self._ems_handshake_hash = b""
#TLS Protocol Version
self.version = (0,0) #read-only
@@ -814,6 +815,8 @@ class TLSRecordLayer(object):
self._handshake_md5.update(compat26Str(p.bytes))
self._handshake_sha.update(compat26Str(p.bytes))
self._handshake_sha256.update(compat26Str(p.bytes))
+ if subType == HandshakeType.client_key_exchange:
+ self._ems_handshake_hash = self._getHandshakeHash()
davidben 2015/08/20 15:31:46 Oh. That was the problem. Right. The dumb thing wh
#Parse based on handshake type
if subType == HandshakeType.client_hello:
@@ -1112,6 +1115,7 @@ class TLSRecordLayer(object):
self._handshake_md5 = hashlib.md5()
self._handshake_sha = hashlib.sha1()
self._handshake_sha256 = hashlib.sha256()
+ self._ems_handshake_hash = b""
self._handshakeBuffer = []
self.allegedSrpUsername = None
self._refCount = 1
@@ -1256,3 +1260,9 @@ class TLSRecordLayer(object):
return md5Bytes + shaBytes
+ def _getHandshakeHash(self):
+ if self.version in ((3,1), (3,2)):
+ return self._handshake_md5.digest() + \
+ self._handshake_sha.digest()
+ elif self.version == (3,3):
+ return self._handshake_sha256.digest()
« no previous file with comments | « third_party/tlslite/tlslite/tlsconnection.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698