pantalaimon: Rename accept_sas to confirm sas.

This commit is contained in:
Damir Jelić 2019-05-03 14:01:01 +02:00
parent 90ec4e2e96
commit 6dd47e7a53
4 changed files with 16 additions and 12 deletions

View File

@ -147,7 +147,7 @@ class PanClient(AsyncClient):
response = await self.to_device(message)
return message, response
async def accept_sas(self, message):
async def confirm_sas(self, message):
user_id = message.user_id
device_id = message.device_id

View File

@ -34,7 +34,7 @@ from pantalaimon.ui import (
DeviceUnverifyMessage,
ExportKeysMessage,
ImportKeysMessage,
DeviceAcceptSasMessage,
DeviceConfirmSasMessage,
InfoMessage
)
@ -141,7 +141,7 @@ class ProxyDaemon:
if isinstance(
message,
(DeviceVerifyMessage, DeviceUnverifyMessage,
DeviceAcceptSasMessage)
DeviceConfirmSasMessage)
):
client = self.pan_clients.get(message.pan_user, None)
@ -167,8 +167,8 @@ class ProxyDaemon:
await self._verify_device(client, device)
elif isinstance(message, DeviceUnverifyMessage):
await self._unverify_device(client, device)
elif isinstance(message, DeviceAcceptSasMessage):
await client.accept_sas(message)
elif isinstance(message, DeviceConfirmSasMessage):
await client.confirm_sas(message)
elif isinstance(message, ExportKeysMessage):
client = self.pan_clients.get(message.pan_user, None)

View File

@ -89,7 +89,8 @@ class PanCtl:
"list-users",
"export-keys",
"import-keys",
"accept-verification"
"accept-verification",
"confirm-verification"
]
def __attrs_post_init__(self):
@ -199,14 +200,14 @@ class PanCtl:
dbus_interface="org.pantalaimon.control"
)
def accept_sas(self, args):
def confirm_sas(self, args):
try:
pan_user, user, device = args
except ValueError:
print("Invalid arguments for command")
return
self.devices.accept_sas(
self.devices.confirm_sas(
pan_user,
user,
device,
@ -244,8 +245,11 @@ class PanCtl:
self.import_keys(args)
elif command == "accept-verification":
pass
elif command == "confirm-verification":
args = words[1:]
self.accept_sas(args)
self.confirm_sas(args)
else:
print(f"Unknown command {command}.")

View File

@ -70,7 +70,7 @@ class DeviceUnverifyMessage(_VerificationMessage):
@attr.s
class DeviceAcceptSasMessage(_VerificationMessage):
class DeviceConfirmSasMessage(_VerificationMessage):
pass
@ -135,8 +135,8 @@ class Devices(dbus.service.Object):
@dbus.service.method("org.pantalaimon.devices",
in_signature="sss")
def accept_sas(self, pan_user, user_id, device_id):
message = DeviceAcceptSasMessage(pan_user, user_id, device_id)
def confirm_sas(self, pan_user, user_id, device_id):
message = DeviceConfirmSasMessage(pan_user, user_id, device_id)
self.queue.put(message)
return