From ddcd3fb8065368838015cb94440d0c2abc1b72f9 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 3 Jun 2020 14:31:34 +0100 Subject: [PATCH] Fix the 'complete security' screen https://github.com/matrix-org/matrix-react-sdk/pull/4655 removed the check for cross-signing account data where the cross-signing labs flag was enabled if you had an existing cross-signing setup. This also sent the user to the 'complete security' view rather than the 'E2E Setup' view though, which meant new logins should always see the E2E setup screen (ie. be prompted to upgrade encryption). NB. We need to change this check for SSSS keys in account data (https://github.com/vector-im/riot-web/issues/13894) but we should put this back the way it was in the meantime. Regressed in https://github.com/matrix-org/matrix-react-sdk/pull/4655 --- src/components/structures/MatrixChat.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index b32bdff603..a5dc671e6e 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1900,7 +1900,12 @@ export default class MatrixChat extends React.PureComponent { return setLoggedInPromise; } - if (await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing")) { + // Test for the master cross-signing key in SSSS as a quick proxy for + // whether cross-signing has been set up on the account. + const masterKeyInStorage = !!cli.getAccountData("m.cross_signing.master"); + if (masterKeyInStorage) { + this.setStateForNewView({ view: Views.COMPLETE_SECURITY }); + } else if (await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing")) { this.setStateForNewView({ view: Views.E2E_SETUP }); } else { this.onLoggedIn();