From 76fd4296a588abcb5501c2f9cb3836cae538f7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=B4=E5=A8=83=E9=85=B1?= Date: Sat, 25 Mar 2017 02:17:59 +0800 Subject: [PATCH] bump improve rand size --- CHANGES | 6 ++++++ shadowsocks/obfsplugin/auth.py | 2 +- shadowsocks/tcprelay.py | 1 + shadowsocks/udprelay.py | 1 + shadowsocks/version.py | 2 +- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 8c7bfc5..05bda56 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +3.1.1 2017-03-25 +- add "New session ticket" +- ignore bind 10.0.0.0/8 and 192.168.0.0/16 by default +- improve rand size under auth_aes128_* +- fix bugs + 3.1.0 2017-03-16 - add "glzjinmod" interface - rate limit diff --git a/shadowsocks/obfsplugin/auth.py b/shadowsocks/obfsplugin/auth.py index 83be824..ad2fbf8 100755 --- a/shadowsocks/obfsplugin/auth.py +++ b/shadowsocks/obfsplugin/auth.py @@ -1186,7 +1186,7 @@ class auth_aes128_sha1(auth_base): self.server_info.data.set_max_client(max_client) def rnd_data_len(self, buf_size, full_buf_size): - if buf_size > 1300 or self.last_rnd_len > 1300 or full_buf_size > 1492: + if buf_size > 1300 or self.last_rnd_len > 1300 or full_buf_size >= self.server_info.buffer_size: return 0 if buf_size > 1100: return common.ord(os.urandom(1)[0]) % 128 diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py index 7f0523a..7f01f71 100644 --- a/shadowsocks/tcprelay.py +++ b/shadowsocks/tcprelay.py @@ -184,6 +184,7 @@ class TCPRelayHandler(object): server_info.key = self._encryptor.cipher_key server_info.head_len = 30 server_info.tcp_mss = 1448 + server_info.buffer_size = BUF_SIZE self._protocol.set_server_info(server_info) self._redir_list = config.get('redirect', ["*#0.0.0.0:0"]) diff --git a/shadowsocks/udprelay.py b/shadowsocks/udprelay.py index 3dd7760..3d8df3b 100644 --- a/shadowsocks/udprelay.py +++ b/shadowsocks/udprelay.py @@ -928,6 +928,7 @@ class UDPRelay(object): server_info.key = encrypt.encrypt_key(self._password, self._method) server_info.head_len = 30 server_info.tcp_mss = 1440 + server_info.buffer_size = BUF_SIZE self._protocol.set_server_info(server_info) self._sockets = set() diff --git a/shadowsocks/version.py b/shadowsocks/version.py index 5ff56da..eed0e4e 100644 --- a/shadowsocks/version.py +++ b/shadowsocks/version.py @@ -16,5 +16,5 @@ # under the License. def version(): - return '3.1.0 2017-03-16' + return '3.1.1 2017-03-25'