store: Change the way device keys are loaded.

This commit is contained in:
Damir Jelić 2019-05-16 10:10:27 +02:00
parent a114b7b1a9
commit 00f2b51fa9
2 changed files with 8 additions and 3 deletions

View File

@ -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']}</{color}>\n"
f" - Device key: "

View File

@ -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