diff --git a/matrix/encryption.py b/matrix/encryption.py index 3733aca..9ff5112 100644 --- a/matrix/encryption.py +++ b/matrix/encryption.py @@ -181,8 +181,8 @@ def olm_info_command(server, args): if args.category == "private": device_msg = (" - Device ID: {}\n".format(server.device_id) if server.device_id else "") - id_key = partition_key(olm.account.identity_keys()["curve25519"]) - fp_key = partition_key(olm.account.identity_keys()["ed25519"]) + id_key = partition_key(olm.account.identity_keys["curve25519"]) + fp_key = partition_key(olm.account.identity_keys["ed25519"]) message = ("{prefix}matrix: Identity keys:\n" " - User: {user}\n" "{device_msg}" @@ -637,7 +637,7 @@ class Olm(): payload_dict = { "algorithm": "m.megolm.v1.aes-sha2", - "sender_key": self.account.identity_keys()["curve25519"], + "sender_key": self.account.identity_keys["curve25519"], "ciphertext": ciphertext, "session_id": session.id, "device_id": self.device_id @@ -676,7 +676,7 @@ class Olm(): "sender": own_id, "sender_device": self.device_id, "keys": { - "ed25519": self.account.identity_keys()["ed25519"] + "ed25519": self.account.identity_keys["ed25519"] } } @@ -712,7 +712,7 @@ class Olm(): olm_dict = { "algorithm": "m.olm.v1.curve25519-aes-sha2", - "sender_key": self.account.identity_keys()["curve25519"], + "sender_key": self.account.identity_keys["curve25519"], "ciphertext": { key.keys["curve25519"]: { "type": (0 if isinstance( diff --git a/matrix/events.py b/matrix/events.py index 56cea83..9b4330e 100644 --- a/matrix/events.py +++ b/matrix/events.py @@ -553,7 +553,7 @@ class MatrixSyncEvent(MatrixEvent): @staticmethod def _get_olm_device_event(server, parsed_dict): - device_key = server.olm.account.identity_keys()["curve25519"] + device_key = server.olm.account.identity_keys["curve25519"] if device_key not in parsed_dict["content"]["ciphertext"]: return None @@ -585,7 +585,7 @@ class MatrixSyncEvent(MatrixEvent): if (sender != decrypted_sender or server.user_id != decrypted_recepient or - olm.account.identity_keys()["ed25519"] != + olm.account.identity_keys["ed25519"] != decrypted_recepient_key): error_message = ("{prefix}matrix: Mismatch in decrypted Olm " "message").format(prefix=W.prefix("error"))