From 6c34c4116fe694b597e6fdee78f6a1546d55473c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=B4=E5=A8=83=E9=85=B1?= Date: Mon, 22 Aug 2016 19:10:50 +0800 Subject: [PATCH] fix verify_sha1 response --- shadowsocks/obfsplugin/verify.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shadowsocks/obfsplugin/verify.py b/shadowsocks/obfsplugin/verify.py index e4d24ef..71e01cc 100644 --- a/shadowsocks/obfsplugin/verify.py +++ b/shadowsocks/obfsplugin/verify.py @@ -316,9 +316,9 @@ class verify_sha1(verify_base): else: self.raw_trans = True return (self.recv_buf, False) - head_size = self.get_head_size(self.recv_buf, 30) + head_size = self.get_head_size(self.recv_buf, 65536) if len(self.recv_buf) < head_size + 10: - return (b'', False) + return (b'E', False) sha1data = hmac.new(self.server_info.recv_iv + self.server_info.key, self.recv_buf[:head_size], hashlib.sha1).digest()[:10] if sha1data != self.recv_buf[head_size:head_size + 10]: logging.error('server_post_decrype data uncorrect auth HMAC-SHA1')