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

Unified Diff: third_party/tlslite/patches/alert_after_handshake.patch

Issue 994373004: Properly handle alerts from the peer in SSL_read. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix CrOS tests Created 5 years, 9 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/handshakesettings.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tlslite/patches/alert_after_handshake.patch
diff --git a/third_party/tlslite/patches/alert_after_handshake.patch b/third_party/tlslite/patches/alert_after_handshake.patch
new file mode 100644
index 0000000000000000000000000000000000000000..c0650b1d5226a261781b7f99f0c2a22ade06f624
--- /dev/null
+++ b/third_party/tlslite/patches/alert_after_handshake.patch
@@ -0,0 +1,46 @@
+diff --git a/third_party/tlslite/tlslite/handshakesettings.py b/third_party/tlslite/tlslite/handshakesettings.py
+index 2f11aaa..e752834 100644
+--- a/third_party/tlslite/tlslite/handshakesettings.py
++++ b/third_party/tlslite/tlslite/handshakesettings.py
+@@ -107,6 +107,10 @@ class HandshakeSettings(object):
+
+ @type useExperimentalTackExtension: bool
+ @ivar useExperimentalTackExtension: Whether to enabled TACK support.
++
++ @type alertAfterHandshake: bool
++ @ivar alertAfterHandshake: If true, the server will send a fatal
++ alert immediately after the handshake completes.
+
+ Note that TACK support is not standardized by IETF and uses a temporary
+ TLS Extension number, so should NOT be used in production software.
+@@ -124,6 +128,7 @@ class HandshakeSettings(object):
+ self.tlsIntolerant = None
+ self.tlsIntoleranceType = 'alert'
+ self.useExperimentalTackExtension = False
++ self.alertAfterHandshake = False
+
+ # Validates the min/max fields, and certificateTypes
+ # Filters out unsupported cipherNames and cipherImplementations
+@@ -140,6 +145,7 @@ class HandshakeSettings(object):
+ other.maxVersion = self.maxVersion
+ other.tlsIntolerant = self.tlsIntolerant
+ other.tlsIntoleranceType = self.tlsIntoleranceType
++ other.alertAfterHandshake = self.alertAfterHandshake
+
+ if not cipherfactory.tripleDESPresent:
+ other.cipherNames = [e for e in self.cipherNames if e != "3des"]
+diff --git a/third_party/tlslite/tlslite/tlsconnection.py b/third_party/tlslite/tlslite/tlsconnection.py
+index 0e13a78..eb850e9 100644
+--- a/third_party/tlslite/tlslite/tlsconnection.py
++++ b/third_party/tlslite/tlslite/tlsconnection.py
+@@ -1221,6 +1221,10 @@ class TLSConnection(TLSRecordLayer):
+ ocspResponse=ocspResponse)
+ for result in self._handshakeWrapperAsync(handshaker, checker):
+ yield result
++ if settings and settings.alertAfterHandshake:
++ for result in self._sendError(AlertDescription.internal_error,
++ "Spurious alert"):
++ yield result
+
+
+ def _handshakeServerAsyncHelper(self, verifierDB,
« no previous file with comments | « third_party/tlslite/README.chromium ('k') | third_party/tlslite/tlslite/handshakesettings.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698