Browse Source

bump 2.9.5

update auth_aes128_md5 & auth_aes128_sha1
dev
破娃酱 8 years ago
parent
commit
b8afd216d6
  1. 3
      CHANGES
  2. 8
      shadowsocks/obfsplugin/auth.py
  3. 2
      shadowsocks/tcprelay.py
  4. 1
      shadowsocks/udprelay.py
  5. 2
      shadowsocks/version.py

3
CHANGES

@ -1,3 +1,6 @@
2.9.5 2016-10-13
- add auth_aes128_md5 and auth_aes128_sha1
2.9.4 2016-10-11 2.9.4 2016-10-11
- sync client version - sync client version

8
shadowsocks/obfsplugin/auth.py

@ -1395,8 +1395,8 @@ class auth_aes128_sha1(auth_base):
encryptor = encrypt.Encryptor(to_bytes(base64.b64encode(self.server_info.key)) + self.salt, 'aes-128-cbc', b'\x00' * 16) encryptor = encrypt.Encryptor(to_bytes(base64.b64encode(self.server_info.key)) + self.salt, 'aes-128-cbc', b'\x00' * 16)
data = uid + encryptor.encrypt(data)[16:] data = uid + encryptor.encrypt(data)[16:]
data += hmac.new(mac_key, data, self.hashfunc).digest()[:4] data += hmac.new(mac_key, data, self.hashfunc).digest()[:4]
check_head = os.urandom(3) check_head = os.urandom(1)
check_head += hmac.new(mac_key, check_head, self.hashfunc).digest()[:4] check_head += hmac.new(mac_key, check_head, self.hashfunc).digest()[:6]
data = check_head + data + os.urandom(rnd_len) + buf data = check_head + data + os.urandom(rnd_len) + buf
data += hmac.new(self.user_key, data, self.hashfunc).digest()[:4] data += hmac.new(self.user_key, data, self.hashfunc).digest()[:4]
return data return data
@ -1483,8 +1483,8 @@ class auth_aes128_sha1(auth_base):
if len(self.recv_buf) < 7: if len(self.recv_buf) < 7:
return (b'', False) return (b'', False)
mac_key = self.server_info.recv_iv + self.server_info.key mac_key = self.server_info.recv_iv + self.server_info.key
sha1data = hmac.new(mac_key, self.recv_buf[:3], self.hashfunc).digest()[:4] sha1data = hmac.new(mac_key, self.recv_buf[:1], self.hashfunc).digest()[:6]
if sha1data != self.recv_buf[3:7]: if sha1data != self.recv_buf[1:7]:
if self.method == self.no_compatible_method: if self.method == self.no_compatible_method:
if len(self.recv_buf) < 31 + self.extra_wait_size: if len(self.recv_buf) < 31 + self.extra_wait_size:
return (b'', False) return (b'', False)

2
shadowsocks/tcprelay.py

@ -129,6 +129,7 @@ class TCPRelayHandler(object):
server_info.obfs_param = config['obfs_param'] server_info.obfs_param = config['obfs_param']
server_info.iv = self._encryptor.cipher_iv server_info.iv = self._encryptor.cipher_iv
server_info.recv_iv = b'' server_info.recv_iv = b''
server_info.key_str = common.to_bytes(config['password'])
server_info.key = self._encryptor.cipher_key server_info.key = self._encryptor.cipher_key
server_info.head_len = 30 server_info.head_len = 30
server_info.tcp_mss = 1460 server_info.tcp_mss = 1460
@ -144,6 +145,7 @@ class TCPRelayHandler(object):
server_info.obfs_param = '' server_info.obfs_param = ''
server_info.iv = self._encryptor.cipher_iv server_info.iv = self._encryptor.cipher_iv
server_info.recv_iv = b'' server_info.recv_iv = b''
server_info.key_str = common.to_bytes(config['password'])
server_info.key = self._encryptor.cipher_key server_info.key = self._encryptor.cipher_key
server_info.head_len = 30 server_info.head_len = 30
server_info.tcp_mss = 1460 server_info.tcp_mss = 1460

1
shadowsocks/udprelay.py

@ -907,6 +907,7 @@ class UDPRelay(object):
server_info.obfs_param = '' server_info.obfs_param = ''
server_info.iv = b'' server_info.iv = b''
server_info.recv_iv = b'' server_info.recv_iv = b''
server_info.key_str = common.to_bytes(config['password'])
server_info.key = encrypt.encrypt_key(self._password, self._method) server_info.key = encrypt.encrypt_key(self._password, self._method)
server_info.head_len = 30 server_info.head_len = 30
server_info.tcp_mss = 1440 server_info.tcp_mss = 1440

2
shadowsocks/version.py

@ -16,5 +16,5 @@
# under the License. # under the License.
def version(): def version():
return '2.9.4 update 2016-10-11' return '2.9.5 2016-10-13'

Loading…
Cancel
Save