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

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

Issue 2800853008: Add a dedicated error code for TLS 1.3 interference. (Closed)
Patch Set: mpearson comment Created 3 years, 8 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/messages.py ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tlslite/tlslite/tlsconnection.py
diff --git a/third_party/tlslite/tlslite/tlsconnection.py b/third_party/tlslite/tlslite/tlsconnection.py
index 8ba1c6e636ab41eae898fd050a7183e125367e60..2309d4fa8f3accafb6ea082746556d9b2e57a17b 100644
--- a/third_party/tlslite/tlslite/tlsconnection.py
+++ b/third_party/tlslite/tlslite/tlsconnection.py
@@ -1457,6 +1457,15 @@ class TLSConnection(TLSRecordLayer):
self._handshakeDone(resumed=False)
+ def _isIntolerant(self, settings, clientHello):
+ if settings.tlsIntolerant is None:
+ return False
+ clientVersion = clientHello.client_version
+ if clientHello.has_supported_versions:
+ clientVersion = (3, 4)
+ return clientVersion >= settings.tlsIntolerant
+
+
def _serverGetClientHello(self, settings, certChain, verifierDB,
sessionCache, anon, fallbackSCSV):
#Tentatively set version to most-desirable version, so if an error
@@ -1480,8 +1489,7 @@ class TLSConnection(TLSRecordLayer):
yield result
#If simulating TLS intolerance, reject certain TLS versions.
- elif (settings.tlsIntolerant is not None and
- clientHello.client_version >= settings.tlsIntolerant):
+ elif self._isIntolerant(settings, clientHello):
if settings.tlsIntoleranceType == "alert":
for result in self._sendError(\
AlertDescription.handshake_failure):
« no previous file with comments | « third_party/tlslite/tlslite/messages.py ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698