From 24fe125cb63090ef5e14aae1a1551d38d1a7a899 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 14 Apr 2020 17:53:33 +0200 Subject: [PATCH] dont try to enable 4S if cross-signing is disabled --- src/verification.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/verification.js b/src/verification.js index 3170eb8825..e00e5e05fa 100644 --- a/src/verification.js +++ b/src/verification.js @@ -61,15 +61,18 @@ function UntrustedDeviceDialog(props) { } export async function verifyDevice(user, device) { - if (!await enable4SIfNeeded()) { - return; + const cli = MatrixClientPeg.get(); + // if cross-signing is not explicitly disabled, check if it should be enabled first. + if (cli.getCryptoTrustCrossSignedDevices()) { + if (!await enable4SIfNeeded()) { + return; + } } Modal.createTrackedDialog("Verification warning", "unverified session", UntrustedDeviceDialog, { user, device, onFinished: async (action) => { if (action === "sas") { - const cli = MatrixClientPeg.get(); const verificationRequestPromise = cli.legacyDeviceVerification( user.userId, device.deviceId, @@ -95,10 +98,13 @@ export async function verifyDevice(user, device) { } export async function legacyVerifyUser(user) { - if (!await enable4SIfNeeded()) { - return; - } const cli = MatrixClientPeg.get(); + // if cross-signing is not explicitly disabled, check if it should be enabled first. + if (cli.getCryptoTrustCrossSignedDevices()) { + if (!await enable4SIfNeeded()) { + return; + } + } const verificationRequestPromise = cli.requestVerification(user.userId); dis.dispatch({ action: "set_right_panel_phase",