mirror of https://github.com/vector-im/riot-web
Merge pull request #4206 from matrix-org/jryans/xsign-robust-login
Test for cross-signing homeserver support during login, toastspull/21833/head
commit
d6d686622c
|
@ -99,9 +99,13 @@ export default class DeviceListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
async _recheck() {
|
async _recheck() {
|
||||||
if (!SettingsStore.isFeatureEnabled("feature_cross_signing")) return;
|
|
||||||
const cli = MatrixClientPeg.get();
|
const cli = MatrixClientPeg.get();
|
||||||
|
|
||||||
|
if (
|
||||||
|
!SettingsStore.isFeatureEnabled("feature_cross_signing") ||
|
||||||
|
!await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing")
|
||||||
|
) return;
|
||||||
|
|
||||||
if (!cli.isCryptoEnabled()) return;
|
if (!cli.isCryptoEnabled()) return;
|
||||||
if (!cli.getCrossSigningId()) {
|
if (!cli.getCrossSigningId()) {
|
||||||
if (this._dismissedThisDeviceToast) {
|
if (this._dismissedThisDeviceToast) {
|
||||||
|
|
|
@ -1911,7 +1911,10 @@ export default createReactClass({
|
||||||
// secret storage.
|
// secret storage.
|
||||||
SettingsStore.setFeatureEnabled("feature_cross_signing", true);
|
SettingsStore.setFeatureEnabled("feature_cross_signing", true);
|
||||||
this.setStateForNewView({ view: VIEWS.COMPLETE_SECURITY });
|
this.setStateForNewView({ view: VIEWS.COMPLETE_SECURITY });
|
||||||
} else if (SettingsStore.isFeatureEnabled("feature_cross_signing")) {
|
} else if (
|
||||||
|
SettingsStore.isFeatureEnabled("feature_cross_signing") &&
|
||||||
|
await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing")
|
||||||
|
) {
|
||||||
// This will only work if the feature is set to 'enable' in the config,
|
// This will only work if the feature is set to 'enable' in the config,
|
||||||
// since it's too early in the lifecycle for users to have turned the
|
// since it's too early in the lifecycle for users to have turned the
|
||||||
// labs flag on.
|
// labs flag on.
|
||||||
|
|
|
@ -59,9 +59,10 @@ export default class CompleteSecurity extends React.Component {
|
||||||
phase: PHASE_BUSY,
|
phase: PHASE_BUSY,
|
||||||
});
|
});
|
||||||
const cli = MatrixClientPeg.get();
|
const cli = MatrixClientPeg.get();
|
||||||
const backupInfo = await cli.getKeyBackupVersion();
|
|
||||||
this.setState({backupInfo});
|
|
||||||
try {
|
try {
|
||||||
|
const backupInfo = await cli.getKeyBackupVersion();
|
||||||
|
this.setState({backupInfo});
|
||||||
|
|
||||||
await accessSecretStorage(async () => {
|
await accessSecretStorage(async () => {
|
||||||
await cli.checkOwnCrossSigningTrust();
|
await cli.checkOwnCrossSigningTrust();
|
||||||
if (backupInfo) await cli.restoreKeyBackupWithSecretStorage(backupInfo);
|
if (backupInfo) await cli.restoreKeyBackupWithSecretStorage(backupInfo);
|
||||||
|
|
Loading…
Reference in New Issue