From 27d2214337ab94644c7185e9bf32113bd192909c Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Wed, 20 Jan 2016 11:53:03 +0800 Subject: [PATCH] "auth_sha1_v2" add salt --- shadowsocks/obfsplugin/auth.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shadowsocks/obfsplugin/auth.py b/shadowsocks/obfsplugin/auth.py index 16bfc16..c6ae081 100644 --- a/shadowsocks/obfsplugin/auth.py +++ b/shadowsocks/obfsplugin/auth.py @@ -581,6 +581,7 @@ class auth_sha1_v2(verify_base): self.has_recv_header = False self.client_id = 0 self.connection_id = 0 + self.salt = b"auth_sha1_v2" def init_data(self): return obfs_auth_v2_data() @@ -618,7 +619,7 @@ class auth_sha1_v2(verify_base): return b'' data = self.rnd_data(len(buf)) + buf data = struct.pack('>H', len(data) + 16) + data - crc = binascii.crc32(self.server_info.key) & 0xFFFFFFFF + crc = binascii.crc32(self.salt + self.server_info.key) & 0xFFFFFFFF data = struct.pack('