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

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

Issue 342793003: Add tests for TLS fallback on connection reset and close. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wtc comments Created 6 years, 6 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 370dc9a726ac4e038ee07f36901aa04fce00c10b..23c2a2f4d972751a3e80c8fad3492bf4d927fea3 100644
--- a/third_party/tlslite/tlslite/tlsrecordlayer.py
+++ b/third_party/tlslite/tlslite/tlsrecordlayer.py
@@ -19,6 +19,7 @@ from .constants import *
from .utils.cryptomath import getRandomBytes
import socket
+import struct
import errno
import traceback
@@ -523,6 +524,13 @@ class TLSRecordLayer(object):
self._shutdown(False)
raise TLSLocalAlert(alert, errorStr)
+ def _abruptClose(self, reset=False):
+ if reset:
+ #Set an SO_LINGER timeout of 0 to send a TCP RST.
+ self.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
+ struct.pack('ii', 1, 0))
+ self._shutdown(False)
+
def _sendMsgs(self, msgs):
randomizeFirstBlock = True
for msg in msgs:
« 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