From 00f2b51fa94226cc0e00a3f7887f1646e1abd64f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 16 May 2019 10:10:27 +0200 Subject: [PATCH] store: Change the way device keys are loaded. --- pantalaimon/panctl.py | 2 ++ pantalaimon/store.py | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pantalaimon/panctl.py b/pantalaimon/panctl.py index b96ee2c..2d31388 100644 --- a/pantalaimon/panctl.py +++ b/pantalaimon/panctl.py @@ -366,6 +366,8 @@ class PanCtl: key = partition_key(device["ed25519"]) color = get_color(device["device_id"]) print_formatted_text(HTML( + f" - Display name: " + f"{device['device_display_name']}\n" f" - Device id: " f"<{color}>{device['device_id']}\n" f" - Device key: " diff --git a/pantalaimon/store.py b/pantalaimon/store.py index 7f7d778..338e91f 100644 --- a/pantalaimon/store.py +++ b/pantalaimon/store.py @@ -231,12 +231,15 @@ class PanStore: except IndexError: trust_state = TrustState.unset + keys = {k.key_type: k.key for k in d.keys} + device_store[d.user_id][d.device_id] = { "user_id": d.user_id, "device_id": d.device_id, - "ed25519": d.fp_key, - "curve25519": d.sender_key, - "trust_state": trust_state.name + "ed25519": keys["ed25519"], + "curve25519": keys["curve25519"], + "trust_state": trust_state.name, + "device_display_name": d.display_name } store[account.user_id] = device_store