mirror of
https://github.com/pyrogram/pyrogram
synced 2025-09-01 14:55:12 +00:00
Fix nonce checks
This commit is contained in:
@@ -42,7 +42,7 @@ class TCPAbridgedO(TCP):
|
|||||||
while True:
|
while True:
|
||||||
nonce = bytearray(os.urandom(64))
|
nonce = bytearray(os.urandom(64))
|
||||||
|
|
||||||
if nonce[0] != b"\xef" and nonce[:4] not in self.RESERVED and nonce[4:4] != b"\x00" * 4:
|
if nonce[0] != b"\xef" and nonce[:4] not in self.RESERVED and nonce[4:8] != b"\x00" * 4:
|
||||||
nonce[56] = nonce[57] = nonce[58] = nonce[59] = 0xef
|
nonce[56] = nonce[57] = nonce[58] = nonce[59] = 0xef
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ class TCPIntermediateO(TCP):
|
|||||||
while True:
|
while True:
|
||||||
nonce = bytearray(os.urandom(64))
|
nonce = bytearray(os.urandom(64))
|
||||||
|
|
||||||
if nonce[0] != b"\xef" and nonce[:4] not in self.RESERVED and nonce[4:4] != b"\x00" * 4:
|
if nonce[0] != b"\xef" and nonce[:4] not in self.RESERVED and nonce[4:8] != b"\x00" * 4:
|
||||||
nonce[56] = nonce[57] = nonce[58] = nonce[59] = 0xee
|
nonce[56] = nonce[57] = nonce[58] = nonce[59] = 0xee
|
||||||
break
|
break
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user