mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Fix incorrect sending of DC id when connecting to MTProxy
This commit is contained in:
parent
4899788d92
commit
d25442345e
|
@ -36,5 +36,4 @@ class ConnectionTcpMTProxy(ConnectionTcpObfuscated):
|
|||
|
||||
def _compose_tail(self, data):
|
||||
dc_id_bytes = self._dc_id.to_bytes(2, "little", signed=True)
|
||||
tail_bytes = super()._compose_tail(data)
|
||||
return tail_bytes[:4] + dc_id_bytes + tail_bytes[6:]
|
||||
return super()._compose_tail(data[:60] + dc_id_bytes + data[62:])
|
||||
|
|
|
@ -38,7 +38,6 @@ class ConnectionTcpObfuscated(ConnectionTcpAbridged):
|
|||
break
|
||||
|
||||
random = bytearray(random)
|
||||
random[56] = random[57] = random[58] = random[59] = 0xef
|
||||
random_reversed = random[55:7:-1] # Reversed (8, len=48)
|
||||
|
||||
# Encryption has "continuous buffer" enabled
|
||||
|
@ -50,7 +49,9 @@ class ConnectionTcpObfuscated(ConnectionTcpAbridged):
|
|||
self._aes_encrypt = AESModeCTR(encrypt_key, encrypt_iv)
|
||||
self._aes_decrypt = AESModeCTR(decrypt_key, decrypt_iv)
|
||||
|
||||
random[56:60] = b'\xef\xef\xef\xef'
|
||||
random[56:64] = self._compose_tail(bytes(random))
|
||||
|
||||
self._writer.write(random)
|
||||
await self._writer.drain()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user