|
@ -338,6 +338,7 @@ class obfs_auth_data(object): |
|
|
def __init__(self): |
|
|
def __init__(self): |
|
|
self.sub_obfs = None |
|
|
self.sub_obfs = None |
|
|
self.client_id = {} |
|
|
self.client_id = {} |
|
|
|
|
|
self.startup_time = int(time.time() - 30) & 0xffffffff |
|
|
|
|
|
|
|
|
def update(self, client_id, connection_id): |
|
|
def update(self, client_id, connection_id): |
|
|
if client_id in self.client_id: |
|
|
if client_id in self.client_id: |
|
@ -491,7 +492,7 @@ class auth_simple(verify_base): |
|
|
client_id = struct.unpack('<I', out_buf[4:8])[0] |
|
|
client_id = struct.unpack('<I', out_buf[4:8])[0] |
|
|
connection_id = struct.unpack('<I', out_buf[8:12])[0] |
|
|
connection_id = struct.unpack('<I', out_buf[8:12])[0] |
|
|
time_dif = common.int32((int(time.time()) & 0xffffffff) - utc_time) |
|
|
time_dif = common.int32((int(time.time()) & 0xffffffff) - utc_time) |
|
|
if time_dif < 60 * -3 or time_dif > 60 * 3: |
|
|
if time_dif < 60 * -3 or time_dif > 60 * 3 or common.int32(utc_time - self.server_info.data.startup_time) < 0: |
|
|
self.raw_trans = True |
|
|
self.raw_trans = True |
|
|
self.recv_buf = b'' |
|
|
self.recv_buf = b'' |
|
|
logging.info('auth_simple: wrong timestamp, time_dif %d, data %s' % (time_dif, binascii.hexlify(out_buf),)) |
|
|
logging.info('auth_simple: wrong timestamp, time_dif %d, data %s' % (time_dif, binascii.hexlify(out_buf),)) |
|
|