Skip to content

Commit

Permalink
PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
mengskysama committed Jan 11, 2016
1 parent 7c8ecb8 commit 614eed2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions shadowsocks/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ def sha1_hmac(secret, data):
def onetimeauth_verify(_hash, data, key):
return _hash == sha1_hmac(key, data)[:ONETIMEAUTH_BYTES]


def onetimeauth_gen(data, key):
return sha1_hmac(key, data)[:ONETIMEAUTH_BYTES]


def compat_ord(s):
if type(s) == int:
return s
Expand Down
2 changes: 1 addition & 1 deletion shadowsocks/udprelay.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def _handle_server(self):
logging.warn('UDP one time auth header is too short')
return
_hash = data[-ONETIMEAUTH_BYTES:]
_data = data[header_length: -ONETIMEAUTH_BYTES]
_data = data[header_length: -ONETIMEAUTH_BYTES]
_key = self._encryptor.decipher_iv + self._encryptor.key
if onetimeauth_verify(_hash, _data, _key) is False:
logging.warn('UDP one time auth fail')
Expand Down

0 comments on commit 614eed2

Please sign in to comment.