avoid conflict with OTA
This commit is contained in:
parent
e513faae64
commit
19c84cac17
2 changed files with 5 additions and 5 deletions
|
@ -192,8 +192,8 @@ def parse_header(data):
|
||||||
dest_addr = None
|
dest_addr = None
|
||||||
dest_port = None
|
dest_port = None
|
||||||
header_length = 0
|
header_length = 0
|
||||||
connecttype = (addrtype & 0x10) and 1 or 0
|
connecttype = (addrtype & 0x8) and 1 or 0
|
||||||
addrtype &= ~0x10
|
addrtype &= ~0x8
|
||||||
if addrtype == ADDRTYPE_IPV4:
|
if addrtype == ADDRTYPE_IPV4:
|
||||||
if len(data) >= 7:
|
if len(data) >= 7:
|
||||||
dest_addr = socket.inet_ntoa(data[1:5])
|
dest_addr = socket.inet_ntoa(data[1:5])
|
||||||
|
|
|
@ -286,8 +286,8 @@ class verify_sha1(verify_base):
|
||||||
self.pack_id += 1
|
self.pack_id += 1
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def auth_pack_data(self, buf):
|
def pack_auth_data(self, buf):
|
||||||
data = buf
|
data = chr(ord(buf[0]) | 0x10) + buf[1:]
|
||||||
data += hmac.new(self.server_info.iv + self.server_info.key, buf, hashlib.sha1).digest()[:10]
|
data += hmac.new(self.server_info.iv + self.server_info.key, buf, hashlib.sha1).digest()[:10]
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ class verify_sha1(verify_base):
|
||||||
ret = b''
|
ret = b''
|
||||||
if not self.has_sent_header:
|
if not self.has_sent_header:
|
||||||
datalen = self.get_head_size(buf, 30)
|
datalen = self.get_head_size(buf, 30)
|
||||||
ret += self.auth_pack_data(buf[datalen:])
|
ret += self.pack_auth_data(buf[datalen:])
|
||||||
buf = buf[datalen:]
|
buf = buf[datalen:]
|
||||||
self.has_sent_header = True
|
self.has_sent_header = True
|
||||||
while len(buf) > self.unit_len:
|
while len(buf) > self.unit_len:
|
||||||
|
|
Loading…
Add table
Reference in a new issue