From 4c1956a3c21a2acf53c8924d9affd1e4f25f9712 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 6 Aug 2020 15:25:33 +0100 Subject: [PATCH] Show master key cache status in Settings --- src/components/views/settings/CrossSigningPanel.js | 8 ++++++++ src/i18n/strings/en_EN.json | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/views/settings/CrossSigningPanel.js b/src/components/views/settings/CrossSigningPanel.js index aa512d4365..1c6baee9af 100644 --- a/src/components/views/settings/CrossSigningPanel.js +++ b/src/components/views/settings/CrossSigningPanel.js @@ -32,6 +32,7 @@ export default class CrossSigningPanel extends React.PureComponent { error: null, crossSigningPublicKeysOnDevice: false, crossSigningPrivateKeysInStorage: false, + masterPrivateKeyCached: false, selfSigningPrivateKeyCached: false, userSigningPrivateKeyCached: false, sessionBackupKeyCached: false, @@ -78,6 +79,7 @@ export default class CrossSigningPanel extends React.PureComponent { const secretStorage = cli._crypto._secretStorage; const crossSigningPublicKeysOnDevice = crossSigning.getId(); const crossSigningPrivateKeysInStorage = await crossSigning.isStoredInSecretStorage(secretStorage); + const masterPrivateKeyCached = !!(pkCache && await pkCache.getCrossSigningKeyCache("master")); const selfSigningPrivateKeyCached = !!(pkCache && await pkCache.getCrossSigningKeyCache("self_signing")); const userSigningPrivateKeyCached = !!(pkCache && await pkCache.getCrossSigningKeyCache("user_signing")); const sessionBackupKeyFromCache = await cli._crypto.getSessionBackupPrivateKey(); @@ -91,6 +93,7 @@ export default class CrossSigningPanel extends React.PureComponent { this.setState({ crossSigningPublicKeysOnDevice, crossSigningPrivateKeysInStorage, + masterPrivateKeyCached, selfSigningPrivateKeyCached, userSigningPrivateKeyCached, sessionBackupKeyCached, @@ -140,6 +143,7 @@ export default class CrossSigningPanel extends React.PureComponent { error, crossSigningPublicKeysOnDevice, crossSigningPrivateKeysInStorage, + masterPrivateKeyCached, selfSigningPrivateKeyCached, userSigningPrivateKeyCached, sessionBackupKeyCached, @@ -235,6 +239,10 @@ export default class CrossSigningPanel extends React.PureComponent { {_t("Cross-signing private keys:")} {crossSigningPrivateKeysInStorage ? _t("in secret storage") : _t("not found")} + + {_t("Master private key:")} + {masterPrivateKeyCached ? _t("cached locally") : _t("not found locally")} + {_t("Self signing private key:")} {selfSigningPrivateKeyCached ? _t("cached locally") : _t("not found locally")} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 82a8f960ab..d25e136747 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -653,9 +653,10 @@ "not found": "not found", "Cross-signing private keys:": "Cross-signing private keys:", "in secret storage": "in secret storage", - "Self signing private key:": "Self signing private key:", + "Master private key:": "Master private key:", "cached locally": "cached locally", "not found locally": "not found locally", + "Self signing private key:": "Self signing private key:", "User signing private key:": "User signing private key:", "Session backup key:": "Session backup key:", "Secret storage public key:": "Secret storage public key:",