From 398b6f38e47338d29c9e39d8b96a5ffb5ad7b520 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Wed, 9 Oct 2024 18:00:17 +0200 Subject: [PATCH] Remove feature_dehydration --- src/Lifecycle.ts | 12 ------------ src/SecurityManager.ts | 10 +--------- src/settings/Settings.tsx | 8 -------- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/Lifecycle.ts b/src/Lifecycle.ts index 682d11aba5..130c0b5315 100644 --- a/src/Lifecycle.ts +++ b/src/Lifecycle.ts @@ -799,18 +799,6 @@ async function doSetLoggedIn( PosthogAnalytics.instance.startListeningToSettingsChanges(client); } - if (credentials.freshLogin && SettingsStore.getValue("feature_dehydration")) { - // If we just logged in, try to rehydrate a device instead of using a - // new device. If it succeeds, we'll get a new device ID, so make sure - // we persist that ID to localStorage - const newDeviceId = await client.rehydrateDevice(); - if (newDeviceId) { - credentials.deviceId = newDeviceId; - } - - delete credentials.freshLogin; - } - if (localStorage) { try { await persistCredentials(credentials); diff --git a/src/SecurityManager.ts b/src/SecurityManager.ts index fb73e25389..510bf62200 100644 --- a/src/SecurityManager.ts +++ b/src/SecurityManager.ts @@ -16,7 +16,6 @@ import { MatrixClientPeg } from "./MatrixClientPeg"; import { _t } from "./languageHandler"; import { isSecureBackupRequired } from "./utils/WellKnownUtils"; import AccessSecretStorageDialog, { KeyParams } from "./components/views/dialogs/security/AccessSecretStorageDialog"; -import SettingsStore from "./settings/SettingsStore"; import { ModuleRunner } from "./modules/ModuleRunner"; import QuestionDialog from "./components/views/dialogs/QuestionDialog"; import InteractiveAuthDialog from "./components/views/dialogs/InteractiveAuthDialog"; @@ -278,14 +277,7 @@ async function doAccessSecretStorage(func: () => Promise, forceReset: bool await crypto.bootstrapSecretStorage({}); const keyId = Object.keys(secretStorageKeys)[0]; - if (keyId && SettingsStore.getValue("feature_dehydration")) { - let dehydrationKeyInfo = {}; - if (secretStorageKeyInfo[keyId] && secretStorageKeyInfo[keyId].passphrase) { - dehydrationKeyInfo = { passphrase: secretStorageKeyInfo[keyId].passphrase }; - } - logger.log("accessSecretStorage: Setting dehydration key"); - await cli.setDehydrationKey(secretStorageKeys[keyId], dehydrationKeyInfo, "Backup device"); - } else if (!keyId) { + if (!keyId) { logger.warn("accessSecretStorage: Not setting dehydration key: no SSSS key found"); } else { logger.log("accessSecretStorage: Not setting dehydration key: feature disabled"); diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 834a735d8d..4f788ee224 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -303,14 +303,6 @@ export const SETTINGS: { [setting: string]: ISetting } = { supportedLevelsAreOrdered: true, default: false, }, - "feature_dehydration": { - isFeature: true, - labsGroup: LabGroup.Encryption, - displayName: _td("labs|dehydration"), - supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG_PRIORITISED, - supportedLevelsAreOrdered: true, - default: false, - }, "feature_exclude_insecure_devices": { isFeature: true, labsGroup: LabGroup.Encryption,