encryption: Switch to the new olm API.
This commit is contained in:
parent
5c6389fc47
commit
90a9e607b1
2 changed files with 7 additions and 7 deletions
|
@ -181,8 +181,8 @@ def olm_info_command(server, args):
|
||||||
if args.category == "private":
|
if args.category == "private":
|
||||||
device_msg = (" - Device ID: {}\n".format(server.device_id)
|
device_msg = (" - Device ID: {}\n".format(server.device_id)
|
||||||
if server.device_id else "")
|
if server.device_id else "")
|
||||||
id_key = partition_key(olm.account.identity_keys()["curve25519"])
|
id_key = partition_key(olm.account.identity_keys["curve25519"])
|
||||||
fp_key = partition_key(olm.account.identity_keys()["ed25519"])
|
fp_key = partition_key(olm.account.identity_keys["ed25519"])
|
||||||
message = ("{prefix}matrix: Identity keys:\n"
|
message = ("{prefix}matrix: Identity keys:\n"
|
||||||
" - User: {user}\n"
|
" - User: {user}\n"
|
||||||
"{device_msg}"
|
"{device_msg}"
|
||||||
|
@ -637,7 +637,7 @@ class Olm():
|
||||||
|
|
||||||
payload_dict = {
|
payload_dict = {
|
||||||
"algorithm": "m.megolm.v1.aes-sha2",
|
"algorithm": "m.megolm.v1.aes-sha2",
|
||||||
"sender_key": self.account.identity_keys()["curve25519"],
|
"sender_key": self.account.identity_keys["curve25519"],
|
||||||
"ciphertext": ciphertext,
|
"ciphertext": ciphertext,
|
||||||
"session_id": session.id,
|
"session_id": session.id,
|
||||||
"device_id": self.device_id
|
"device_id": self.device_id
|
||||||
|
@ -676,7 +676,7 @@ class Olm():
|
||||||
"sender": own_id,
|
"sender": own_id,
|
||||||
"sender_device": self.device_id,
|
"sender_device": self.device_id,
|
||||||
"keys": {
|
"keys": {
|
||||||
"ed25519": self.account.identity_keys()["ed25519"]
|
"ed25519": self.account.identity_keys["ed25519"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -712,7 +712,7 @@ class Olm():
|
||||||
|
|
||||||
olm_dict = {
|
olm_dict = {
|
||||||
"algorithm": "m.olm.v1.curve25519-aes-sha2",
|
"algorithm": "m.olm.v1.curve25519-aes-sha2",
|
||||||
"sender_key": self.account.identity_keys()["curve25519"],
|
"sender_key": self.account.identity_keys["curve25519"],
|
||||||
"ciphertext": {
|
"ciphertext": {
|
||||||
key.keys["curve25519"]: {
|
key.keys["curve25519"]: {
|
||||||
"type": (0 if isinstance(
|
"type": (0 if isinstance(
|
||||||
|
|
|
@ -553,7 +553,7 @@ class MatrixSyncEvent(MatrixEvent):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_olm_device_event(server, parsed_dict):
|
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"]:
|
if device_key not in parsed_dict["content"]["ciphertext"]:
|
||||||
return None
|
return None
|
||||||
|
@ -585,7 +585,7 @@ class MatrixSyncEvent(MatrixEvent):
|
||||||
|
|
||||||
if (sender != decrypted_sender or
|
if (sender != decrypted_sender or
|
||||||
server.user_id != decrypted_recepient or
|
server.user_id != decrypted_recepient or
|
||||||
olm.account.identity_keys()["ed25519"] !=
|
olm.account.identity_keys["ed25519"] !=
|
||||||
decrypted_recepient_key):
|
decrypted_recepient_key):
|
||||||
error_message = ("{prefix}matrix: Mismatch in decrypted Olm "
|
error_message = ("{prefix}matrix: Mismatch in decrypted Olm "
|
||||||
"message").format(prefix=W.prefix("error"))
|
"message").format(prefix=W.prefix("error"))
|
||||||
|
|
Loading…
Reference in a new issue