Merge pull request #4407 from matrix-org/bwindels/checkifxsignisdisabledforlegacyverif

Fix: dont try to enable 4S if cross-signing is disabled
pull/21833/head
Bruno Windels 2020-04-14 16:12:16 +00:00 committed by GitHub
commit 69e680da3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 6 deletions

View File

@ -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",