improve rand size
@ -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
@ -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
@ -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"])
@ -928,6 +928,7 @@ class UDPRelay(object):
server_info.key = encrypt.encrypt_key(self._password, self._method)
server_info.tcp_mss = 1440
self._sockets = set()
@ -16,5 +16,5 @@
# under the License.
def version():
return '3.1.0 2017-03-16'
return '3.1.1 2017-03-25'