Disable key request dialogs with cross-signing
Cross-signing verification is meant to replace the old key share between devices flow. This disables it when the cross-signing lab is enabled. Fixes https://github.com/vector-im/riot-web/issues/11904
This commit is contained in:
parent
e88f062f01
commit
fb9962b08e
3 changed files with 18 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2017 Vector Creations Ltd
|
Copyright 2017 Vector Creations Ltd
|
||||||
|
Copyright 2020 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -17,6 +18,8 @@ limitations under the License.
|
||||||
import * as sdk from './index';
|
import * as sdk from './index';
|
||||||
import Modal from './Modal';
|
import Modal from './Modal';
|
||||||
|
|
||||||
|
// TODO: We can remove this once cross-signing is the only way.
|
||||||
|
// https://github.com/vector-im/riot-web/issues/11908
|
||||||
export default class KeyRequestHandler {
|
export default class KeyRequestHandler {
|
||||||
constructor(matrixClient) {
|
constructor(matrixClient) {
|
||||||
this._matrixClient = matrixClient;
|
this._matrixClient = matrixClient;
|
||||||
|
@ -30,6 +33,11 @@ export default class KeyRequestHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleKeyRequest(keyRequest) {
|
handleKeyRequest(keyRequest) {
|
||||||
|
// Ignore own device key requests if cross-signing lab enabled
|
||||||
|
if (SettingsStore.isFeatureEnabled("feature_cross_signing")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const userId = keyRequest.userId;
|
const userId = keyRequest.userId;
|
||||||
const deviceId = keyRequest.deviceId;
|
const deviceId = keyRequest.deviceId;
|
||||||
const requestId = keyRequest.requestId;
|
const requestId = keyRequest.requestId;
|
||||||
|
@ -60,6 +68,11 @@ export default class KeyRequestHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleKeyRequestCancellation(cancellation) {
|
handleKeyRequestCancellation(cancellation) {
|
||||||
|
// Ignore own device key requests if cross-signing lab enabled
|
||||||
|
if (SettingsStore.isFeatureEnabled("feature_cross_signing")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// see if we can find the request in the queue
|
// see if we can find the request in the queue
|
||||||
const userId = cancellation.userId;
|
const userId = cancellation.userId;
|
||||||
const deviceId = cancellation.deviceId;
|
const deviceId = cancellation.deviceId;
|
||||||
|
|
|
@ -1383,6 +1383,8 @@ export default createReactClass({
|
||||||
cli.on("Session.logged_out", () => dft.stop());
|
cli.on("Session.logged_out", () => dft.stop());
|
||||||
cli.on("Event.decrypted", (e, err) => dft.eventDecrypted(e, err));
|
cli.on("Event.decrypted", (e, err) => dft.eventDecrypted(e, err));
|
||||||
|
|
||||||
|
// TODO: We can remove this once cross-signing is the only way.
|
||||||
|
// https://github.com/vector-im/riot-web/issues/11908
|
||||||
const krh = new KeyRequestHandler(cli);
|
const krh = new KeyRequestHandler(cli);
|
||||||
cli.on("crypto.roomKeyRequest", (req) => {
|
cli.on("crypto.roomKeyRequest", (req) => {
|
||||||
krh.handleKeyRequest(req);
|
krh.handleKeyRequest(req);
|
||||||
|
|
|
@ -22,6 +22,9 @@ import * as sdk from '../../../index';
|
||||||
|
|
||||||
import { _t, _td } from '../../../languageHandler';
|
import { _t, _td } from '../../../languageHandler';
|
||||||
|
|
||||||
|
// TODO: We can remove this once cross-signing is the only way.
|
||||||
|
// https://github.com/vector-im/riot-web/issues/11908
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dialog which asks the user whether they want to share their keys with
|
* Dialog which asks the user whether they want to share their keys with
|
||||||
* an unverified device.
|
* an unverified device.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue