This commit is contained in:
v3aqb 2016-05-15 01:27:21 +08:00
parent 9844ba9dc7
commit 677e6c4c56
2 changed files with 2 additions and 0 deletions

View file

@ -328,6 +328,7 @@ class TCPRelayHandler(object):
if self._is_local is False:
# spec https://shadowsocks.org/en/spec/one-time-auth.html
if self._ota_enable or addrtype & ADDRTYPE_AUTH:
self._ota_enable = True
if len(data) < header_length + ONETIMEAUTH_BYTES:
logging.warn('one time auth header is too short')
return None

View file

@ -184,6 +184,7 @@ class UDPRelay(object):
server_addr, server_port = dest_addr, dest_port
# spec https://shadowsocks.org/en/spec/one-time-auth.html
if self._one_time_auth_enable or addrtype & ADDRTYPE_AUTH:
self._one_time_auth_enable = True
if len(data) < header_length + ONETIMEAUTH_BYTES:
logging.warn('UDP one time auth header is too short')
return