From b513210778f74ac8a91c8f5419ac1326f4f94aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=B4=E5=A8=83=E9=85=B1?= Date: Fri, 23 Dec 2016 21:14:23 +0800 Subject: [PATCH] fix tls --- shadowsocks/obfsplugin/obfs_tls.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shadowsocks/obfsplugin/obfs_tls.py b/shadowsocks/obfsplugin/obfs_tls.py index a56fae6..7646f6e 100644 --- a/shadowsocks/obfsplugin/obfs_tls.py +++ b/shadowsocks/obfsplugin/obfs_tls.py @@ -197,6 +197,8 @@ class tls_ticket_auth(plain.plain): return (ret, True, False) if self.handshake_status == 3: + self.recv_buffer += buf + buf = self.recv_buffer verify = buf verify_len = 43 - 10 if len(buf) < 43: @@ -226,6 +228,7 @@ class tls_ticket_auth(plain.plain): if struct.unpack('>H', buf[:2])[0] > len(buf) - 2: return (b'', False, False) + self.recv_buffer = self.recv_buffer[struct.unpack('>H', buf[:2])[0] + 5:] self.handshake_status = 2 buf = buf[2:] if not match_begin(buf, b'\x01\x00'): #client hello