diff --git a/telethon/crypto/authkey.py b/telethon/crypto/authkey.py index 8475ec17..37f65017 100644 --- a/telethon/crypto/authkey.py +++ b/telethon/crypto/authkey.py @@ -39,7 +39,7 @@ class AuthKey: with BinaryReader(sha1(self._key).digest()) as reader: self.aux_hash = reader.read_long(signed=False) reader.read(4) - self.key_id = reader.read_long(signed=False) + self.key_id = reader.read_long(signed=True) # TODO This doesn't really fit here, it's only used in authentication def calc_new_nonce_hash(self, new_nonce, number): diff --git a/telethon/network/mtprotostate.py b/telethon/network/mtprotostate.py index 49fb7478..0ceaa513 100644 --- a/telethon/network/mtprotostate.py +++ b/telethon/network/mtprotostate.py @@ -144,7 +144,7 @@ class MTProtoState: msg_key = msg_key_large[8:24] aes_key, aes_iv = self._calc_key(self.auth_key.key, msg_key, True) - key_id = struct.pack('