diff --git a/src/SecurityManager.ts b/src/SecurityManager.ts index bcb899f8c91..c5958a6f48e 100644 --- a/src/SecurityManager.ts +++ b/src/SecurityManager.ts @@ -25,7 +25,6 @@ import { MatrixClientPeg } from "./MatrixClientPeg"; import { _t } from "./languageHandler"; import { isSecureBackupRequired } from "./utils/WellKnownUtils"; import AccessSecretStorageDialog, { KeyParams } from "./components/views/dialogs/security/AccessSecretStorageDialog"; -import RestoreKeyBackupDialog from "./components/views/dialogs/security/RestoreKeyBackupDialog"; import SettingsStore from "./settings/SettingsStore"; import { ModuleRunner } from "./modules/ModuleRunner"; import QuestionDialog from "./components/views/dialogs/QuestionDialog"; @@ -274,26 +273,6 @@ export const crossSigningCallbacks: ICryptoCallbacks = { getDehydrationKey, }; -export async function promptForBackupPassphrase(): Promise { - let key!: Uint8Array; - - const { finished } = Modal.createDialog( - RestoreKeyBackupDialog, - { - showSummary: false, - keyCallback: (k: Uint8Array) => (key = k), - }, - undefined, - /* priority = */ false, - /* static = */ true, - ); - - const success = await finished; - if (!success) throw new Error("Key backup prompt cancelled"); - - return key; -} - /** * Carry out an operation that may require multiple accesses to secret storage, caching the key. * @@ -389,9 +368,7 @@ async function doAccessSecretStorage(func: () => Promise, forceReset: bool } }, }); - await crypto.bootstrapSecretStorage({ - getKeyBackupPassphrase: promptForBackupPassphrase, - }); + await crypto.bootstrapSecretStorage({}); const keyId = Object.keys(secretStorageKeys)[0]; if (keyId && SettingsStore.getValue("feature_dehydration")) { diff --git a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx index 0316c43994d..97469177d9e 100644 --- a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx +++ b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx @@ -26,7 +26,6 @@ import { BackupTrustInfo, GeneratedSecretStorageKey, KeyBackupInfo } from "matri import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import { _t, _td } from "../../../../languageHandler"; import Modal from "../../../../Modal"; -import { promptForBackupPassphrase } from "../../../../SecurityManager"; import { copyNode } from "../../../../utils/strings"; import { SSOAuthEntry } from "../../../../components/views/auth/InteractiveAuthEntryComponents"; import PassphraseField from "../../../../components/views/auth/PassphraseField"; @@ -123,7 +122,6 @@ export default class CreateSecretStorageDialog extends React.PureComponent(); private passphraseField = createRef(); @@ -384,15 +382,6 @@ export default class CreateSecretStorageDialog extends React.PureComponent this.recoveryKey!, keyBackupInfo: this.state.backupInfo!, setupNewKeyBackup: !this.state.backupInfo, - getKeyBackupPassphrase: async (): Promise => { - // We may already have the backup key if we earlier went - // through the restore backup path, so pass it along - // rather than prompting again. - if (this.backupKey) { - return this.backupKey; - } - return promptForBackupPassphrase(); - }, }); } await initialiseDehydration(true); @@ -424,11 +413,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent => { - // It's possible we'll need the backup key later on for bootstrapping, - // so let's stash it here, rather than prompting for it twice. - const keyCallback = (k: Uint8Array): void => { - this.backupKey = k; - }; + const keyCallback = (k: Uint8Array): void => {}; const { finished } = Modal.createDialog( RestoreKeyBackupDialog,