Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix: dont try to enable 4S if cross-signing is disabled #4407

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/verification.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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",
Expand Down