From 614eed2bf0c8bf1c8e8e0c506331e8dd98be826b Mon Sep 17 00:00:00 2001 From: jsy Date: Mon, 11 Jan 2016 23:27:21 +0800 Subject: [PATCH] PEP8 --- shadowsocks/common.py | 2 ++ shadowsocks/udprelay.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/shadowsocks/common.py b/shadowsocks/common.py index 9dd5f7c..ee14995 100644 --- a/shadowsocks/common.py +++ b/shadowsocks/common.py @@ -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 diff --git a/shadowsocks/udprelay.py b/shadowsocks/udprelay.py index cbfaa31..6d29f63 100644 --- a/shadowsocks/udprelay.py +++ b/shadowsocks/udprelay.py @@ -184,7 +184,7 @@ class UDPRelay(object): 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')