From fb2bde94faec98e647e87445e3590215b477350f Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 3 Sep 2020 14:50:49 +0100 Subject: [PATCH] Rename CrossSigningManager to SecurityManager The file encompasses bits of cross-signing and also secret storage / secure backup. --- src/DeviceListener.ts | 2 +- src/MatrixClientPeg.ts | 2 +- src/{CrossSigningManager.js => SecurityManager.js} | 4 ++-- .../views/dialogs/keybackup/CreateKeyBackupDialog.js | 2 +- .../views/dialogs/secretstorage/CreateSecretStorageDialog.js | 2 +- .../views/dialogs/keybackup/RestoreKeyBackupDialog.js | 2 +- src/components/views/settings/CrossSigningPanel.js | 2 +- src/stores/SetupEncryptionStore.js | 2 +- src/toasts/SetupEncryptionToast.ts | 2 +- src/verification.js | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) rename src/{CrossSigningManager.js => SecurityManager.js} (98%) diff --git a/src/DeviceListener.ts b/src/DeviceListener.ts index 156d8db61b..aa0508924d 100644 --- a/src/DeviceListener.ts +++ b/src/DeviceListener.ts @@ -30,7 +30,7 @@ import { showToast as showUnverifiedSessionsToast, } from "./toasts/UnverifiedSessionToast"; import { privateShouldBeEncrypted } from "./createRoom"; -import { isSecretStorageBeingAccessed, accessSecretStorage } from "./CrossSigningManager"; +import { isSecretStorageBeingAccessed, accessSecretStorage } from "./SecurityManager"; import { isSecureBackupRequired } from './utils/WellKnownUtils'; import { isLoggedIn } from './components/structures/MatrixChat'; diff --git a/src/MatrixClientPeg.ts b/src/MatrixClientPeg.ts index be16f5fe10..9589130e7f 100644 --- a/src/MatrixClientPeg.ts +++ b/src/MatrixClientPeg.ts @@ -31,7 +31,7 @@ import {verificationMethods} from 'matrix-js-sdk/src/crypto'; import MatrixClientBackedSettingsHandler from "./settings/handlers/MatrixClientBackedSettingsHandler"; import * as StorageManager from './utils/StorageManager'; import IdentityAuthClient from './IdentityAuthClient'; -import { crossSigningCallbacks } from './CrossSigningManager'; +import { crossSigningCallbacks } from './SecurityManager'; import {SHOW_QR_CODE_METHOD} from "matrix-js-sdk/src/crypto/verification/QRCode"; export interface IMatrixClientCreds { diff --git a/src/CrossSigningManager.js b/src/SecurityManager.js similarity index 98% rename from src/CrossSigningManager.js rename to src/SecurityManager.js index 0353bfc5ae..891f43b705 100644 --- a/src/CrossSigningManager.js +++ b/src/SecurityManager.js @@ -1,5 +1,5 @@ /* -Copyright 2019 The Matrix.org Foundation C.I.C. +Copyright 2019, 2020 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -142,7 +142,7 @@ const onSecretRequested = async function({ return; } if (!deviceTrust || !deviceTrust.isVerified()) { - console.log(`CrossSigningManager: Ignoring request from untrusted device ${deviceId}`); + console.log(`Ignoring secret request from untrusted device ${deviceId}`); return; } if ( diff --git a/src/async-components/views/dialogs/keybackup/CreateKeyBackupDialog.js b/src/async-components/views/dialogs/keybackup/CreateKeyBackupDialog.js index c3aef9109a..ab39a094db 100644 --- a/src/async-components/views/dialogs/keybackup/CreateKeyBackupDialog.js +++ b/src/async-components/views/dialogs/keybackup/CreateKeyBackupDialog.js @@ -21,7 +21,7 @@ import * as sdk from '../../../../index'; import {MatrixClientPeg} from '../../../../MatrixClientPeg'; import PropTypes from 'prop-types'; import {_t, _td} from '../../../../languageHandler'; -import { accessSecretStorage } from '../../../../CrossSigningManager'; +import { accessSecretStorage } from '../../../../SecurityManager'; import AccessibleButton from "../../../../components/views/elements/AccessibleButton"; import {copyNode} from "../../../../utils/strings"; import PassphraseField from "../../../../components/views/auth/PassphraseField"; diff --git a/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js b/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js index 0a1a0b02b3..07ff3c9b76 100644 --- a/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js +++ b/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js @@ -22,7 +22,7 @@ import {MatrixClientPeg} from '../../../../MatrixClientPeg'; import FileSaver from 'file-saver'; import {_t, _td} from '../../../../languageHandler'; import Modal from '../../../../Modal'; -import { promptForBackupPassphrase } from '../../../../CrossSigningManager'; +import { promptForBackupPassphrase } from '../../../../SecurityManager'; import {copyNode} from "../../../../utils/strings"; import {SSOAuthEntry} from "../../../../components/views/auth/InteractiveAuthEntryComponents"; import PassphraseField from "../../../../components/views/auth/PassphraseField"; diff --git a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js index dd34dfbbf0..2362133460 100644 --- a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js +++ b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js @@ -21,7 +21,7 @@ import * as sdk from '../../../../index'; import {MatrixClientPeg} from '../../../../MatrixClientPeg'; import { MatrixClient } from 'matrix-js-sdk'; import { _t } from '../../../../languageHandler'; -import { accessSecretStorage } from '../../../../CrossSigningManager'; +import { accessSecretStorage } from '../../../../SecurityManager'; const RESTORE_TYPE_PASSPHRASE = 0; const RESTORE_TYPE_RECOVERYKEY = 1; diff --git a/src/components/views/settings/CrossSigningPanel.js b/src/components/views/settings/CrossSigningPanel.js index 2562fa141b..656fa15a95 100644 --- a/src/components/views/settings/CrossSigningPanel.js +++ b/src/components/views/settings/CrossSigningPanel.js @@ -19,7 +19,7 @@ import React from 'react'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; -import { accessSecretStorage } from '../../../CrossSigningManager'; +import { accessSecretStorage } from '../../../SecurityManager'; import Modal from '../../../Modal'; export default class CrossSigningPanel extends React.PureComponent { diff --git a/src/stores/SetupEncryptionStore.js b/src/stores/SetupEncryptionStore.js index ee3b9c9de5..981ce6eca9 100644 --- a/src/stores/SetupEncryptionStore.js +++ b/src/stores/SetupEncryptionStore.js @@ -16,7 +16,7 @@ limitations under the License. import EventEmitter from 'events'; import { MatrixClientPeg } from '../MatrixClientPeg'; -import { accessSecretStorage, AccessCancelledError } from '../CrossSigningManager'; +import { accessSecretStorage, AccessCancelledError } from '../SecurityManager'; import { PHASE_DONE as VERIF_PHASE_DONE } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest"; export const PHASE_INTRO = 0; diff --git a/src/toasts/SetupEncryptionToast.ts b/src/toasts/SetupEncryptionToast.ts index d35bbf1c88..9dbc4acafc 100644 --- a/src/toasts/SetupEncryptionToast.ts +++ b/src/toasts/SetupEncryptionToast.ts @@ -19,7 +19,7 @@ import * as sdk from "../index"; import { _t } from "../languageHandler"; import DeviceListener from "../DeviceListener"; import SetupEncryptionDialog from "../components/views/dialogs/SetupEncryptionDialog"; -import { accessSecretStorage } from "../CrossSigningManager"; +import { accessSecretStorage } from "../SecurityManager"; import ToastStore from "../stores/ToastStore"; import GenericToast from "../components/views/toasts/GenericToast"; diff --git a/src/verification.js b/src/verification.js index 36fb8b0e4f..819370f239 100644 --- a/src/verification.js +++ b/src/verification.js @@ -21,7 +21,7 @@ import * as sdk from './index'; import { _t } from './languageHandler'; import {RightPanelPhases} from "./stores/RightPanelStorePhases"; import {findDMForUser} from './createRoom'; -import {accessSecretStorage} from './CrossSigningManager'; +import {accessSecretStorage} from './SecurityManager'; import {verificationMethods} from 'matrix-js-sdk/src/crypto'; import {Action} from './dispatcher/actions';