From 8ee4cd513a92dac893266490ae9477b2810b839b Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Tue, 27 Oct 2015 19:13:38 +0800 Subject: [PATCH] a stupid bug --- shadowsocks/obfsplugin/verify_simple.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadowsocks/obfsplugin/verify_simple.py b/shadowsocks/obfsplugin/verify_simple.py index 22eb787..6b90a5a 100644 --- a/shadowsocks/obfsplugin/verify_simple.py +++ b/shadowsocks/obfsplugin/verify_simple.py @@ -422,7 +422,7 @@ class auth_simple(verify_base): def client_pre_encrypt(self, buf): ret = b'' if not self.has_sent_header: - datalen = max(len(buf), common.ord(os.urandom(1)[0]) % 32 + 4) + datalen = min(len(buf), common.ord(os.urandom(1)[0]) % 32 + 4) ret += self.pack_data(self.auth_data() + buf[:datalen]) buf = buf[datalen:] self.has_sent_header = True