|
|
@ -62,7 +62,7 @@ class tls_ticket_auth(plain.plain): |
|
|
|
self.send_buffer = b'' |
|
|
|
self.recv_buffer = b'' |
|
|
|
self.client_id = b'' |
|
|
|
self.max_time_dif = 0 # time dif (second) setting |
|
|
|
self.max_time_dif = 60 * 60 * 24 # time dif (second) setting |
|
|
|
self.tls_version = b'\x03\x03' |
|
|
|
|
|
|
|
def init_data(self): |
|
|
@ -215,14 +215,18 @@ class tls_ticket_auth(plain.plain): |
|
|
|
return self.server_decode(b'') |
|
|
|
|
|
|
|
#raise Exception("handshake data = %s" % (binascii.hexlify(buf))) |
|
|
|
self.handshake_status = 2 |
|
|
|
self.recv_buffer += buf |
|
|
|
buf = self.recv_buffer |
|
|
|
ogn_buf = buf |
|
|
|
if len(buf) < 3: |
|
|
|
return (b'', False, False) |
|
|
|
if not match_begin(buf, b'\x16\x03\x01'): |
|
|
|
return self.decode_error_return(ogn_buf) |
|
|
|
buf = buf[3:] |
|
|
|
if struct.unpack('>H', buf[:2])[0] != len(buf) - 2: |
|
|
|
logging.info("tls_auth wrong tls head size") |
|
|
|
return self.decode_error_return(ogn_buf) |
|
|
|
if struct.unpack('>H', buf[:2])[0] > len(buf) - 2: |
|
|
|
return (b'', False, False) |
|
|
|
|
|
|
|
self.handshake_status = 2 |
|
|
|
buf = buf[2:] |
|
|
|
if not match_begin(buf, b'\x01\x00'): #client hello |
|
|
|
logging.info("tls_auth not client hello message") |
|
|
|