From c39cc06908e2e918959c5f2cc5dddc8a67463ffb Mon Sep 17 00:00:00 2001 From: "Dmitry D. Chernov" Date: Mon, 11 Feb 2019 05:47:09 +1000 Subject: [PATCH] Fix incorrect check for reserved data prefix in ConnectionTcpObfuscated --- telethon/network/connection/tcpobfuscated.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/network/connection/tcpobfuscated.py b/telethon/network/connection/tcpobfuscated.py index e3a00d89..adac2d67 100644 --- a/telethon/network/connection/tcpobfuscated.py +++ b/telethon/network/connection/tcpobfuscated.py @@ -28,7 +28,7 @@ class ConnectionTcpObfuscated(ConnectionTcpAbridged): keywords = (b'PVrG', b'GET ', b'POST', b'\xee\xee\xee\xee') while True: random = os.urandom(64) - if (random[0] != b'\xef' and + if (random[0] != 0xef and random[:4] not in keywords and random[4:4] != b'\0\0\0\0'): break