diff --git a/src/components/views/settings/CrossSigningPanel.js b/src/components/views/settings/CrossSigningPanel.js index 2217a0f2ee..cb04d2a018 100644 --- a/src/components/views/settings/CrossSigningPanel.js +++ b/src/components/views/settings/CrossSigningPanel.js @@ -81,7 +81,9 @@ export default class CrossSigningPanel extends React.PureComponent { const crossSigningPrivateKeysInStorage = await crossSigning.isStoredInSecretStorage(secretStorage); const selfSigningPrivateKeyCached = !!(pkCache && await pkCache.getCrossSigningKeyCache("self_signing")); const userSigningPrivateKeyCached = !!(pkCache && await pkCache.getCrossSigningKeyCache("user_signing")); - const sessionBackupKeyCached = !!(await cli._crypto.getSessionBackupPrivateKey()); + const sessionBackupKeyFromCache = await cli._crypto.getSessionBackupPrivateKey(); + const sessionBackupKeyCached = !!(sessionBackupKeyFromCache); + const sessionBackupKeyWellFormed = sessionBackupKeyFromCache instanceof Uint8Array; const secretStorageKeyInAccount = await secretStorage.hasKey(); const homeserverSupportsCrossSigning = await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing"); @@ -94,6 +96,7 @@ export default class CrossSigningPanel extends React.PureComponent { selfSigningPrivateKeyCached, userSigningPrivateKeyCached, sessionBackupKeyCached, + sessionBackupKeyWellFormed, secretStorageKeyInAccount, homeserverSupportsCrossSigning, crossSigningReady, @@ -143,6 +146,7 @@ export default class CrossSigningPanel extends React.PureComponent { selfSigningPrivateKeyCached, userSigningPrivateKeyCached, sessionBackupKeyCached, + sessionBackupKeyWellFormed, secretStorageKeyInAccount, homeserverSupportsCrossSigning, crossSigningReady, @@ -208,6 +212,16 @@ export default class CrossSigningPanel extends React.PureComponent { ); } + let sessionBackupKeyWellFormedText = ""; + if (sessionBackupKeyCached) { + sessionBackupKeyWellFormedText = ", "; + if (sessionBackupKeyWellFormed) { + sessionBackupKeyWellFormedText += _t("well formed"); + } else { + sessionBackupKeyWellFormedText += _t("unexpected type"); + } + } + return (