mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-21 21:39:46 +03:00
parent
74ec6391d9
commit
7a63c1ba58
|
@ -6,7 +6,7 @@ from .. import helpers as utils
|
|||
from ..crypto import AES
|
||||
from ..errors import (
|
||||
BadMessageError, InvalidChecksumError, BrokenAuthKeyError,
|
||||
rpc_message_to_error
|
||||
rpc_message_to_error, SecurityError
|
||||
)
|
||||
from ..extensions import BinaryReader
|
||||
from ..tl import TLMessage, MessageContainer, GzipPacked
|
||||
|
@ -158,6 +158,8 @@ class MtProtoSender:
|
|||
msg_key = reader.read(16)
|
||||
|
||||
key, iv = utils.calc_key(self.session.auth_key.key, msg_key, False)
|
||||
if reader.read(len(body) - reader.tell_position()) % 16 != 0:
|
||||
raise SecurityError('AES block size missmatch')
|
||||
plain_text = AES.decrypt_ige(
|
||||
reader.read(len(body) - reader.tell_position()), key, iv)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user