Update mtproto_sender.py

Now, it's working for me
This commit is contained in:
Maxim Smirnov 2017-11-24 23:58:07 +03:00 committed by GitHub
parent 7a63c1ba58
commit b6e7f1f26d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,10 +158,11 @@ 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:
data = reader.read(len(body) - reader.tell_position())
if len(data) % 16 != 0:
raise SecurityError('AES block size missmatch')
plain_text = AES.decrypt_ige(
reader.read(len(body) - reader.tell_position()), key, iv)
data, key, iv)
with BinaryReader(plain_text) as plain_text_reader:
plain_text_reader.read_long() # remote_salt