Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Remove pre-0.22 legacy key read fallback (#2159)
Leendert de Borst3d463cc8d176
diff --git a/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts b/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.tsindex 52922cd12..18feb39e2 100644--- a/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts+++ b/apps/browser-extension/src/entrypoints/background/VaultMessageHandler.ts@@ -11,7 +11,6 @@ import type { EncryptionKeyDerivationParams } from '@/utils/dist/core/models/metimport { FieldKey, ItemTypes, VaultDataBucketCategory, createSystemField, type Item, type PasswordSettings } from '@/utils/dist/core/models/vault';import { VaultKeyAlgorithm, type VaultResponse, type ManifestRevision, type StatusResponseV2 } from '@/utils/dist/core/models/webapi';import { EncryptionUtility } from '@/utils/EncryptionUtility';-import { readLegacySessionEncryptionKey } from '@/utils/legacy/LegacyStorageKeyFallbacks';import { requiresLegacyAccountKeyMigration } from '@/utils/legacy/LegacyStorageModelMigration';import { LocalPreferencesService } from '@/utils/LocalPreferencesService';import { getManifestRevisions, manifestsRequiringPull, recordManifestRevisions, toManifestRevisionMap } from '@/utils/ManifestRevisions';@@ -707,11 +706,7 @@ export async function handleGeneratePassword(*/export async function handleGetEncryptionKey() : Promise<string | null> {- // Try the current key name first (since 0.22.0)- const encryptionKey = await storage.getItem(StorageKeys.ENCRYPTION_KEY) as string | null;-- // LEGACY: fall back to the pre-0.22.0 key name.- return encryptionKey ?? await readLegacySessionEncryptionKey();+ return await storage.getItem(StorageKeys.ENCRYPTION_KEY) as string | null;}/**diff --git a/apps/browser-extension/src/utils/SharingService.ts b/apps/browser-extension/src/utils/SharingService.tsindex 344d142d2..0c058172a 100644--- a/apps/browser-extension/src/utils/SharingService.ts+++ b/apps/browser-extension/src/utils/SharingService.ts@@ -5,7 +5,6 @@ import { StorageKeys } from '@/utils/constants/storageKeys';import { devWarn } from '@/utils/devLogger/DevLogger';import { VaultKeyAlgorithm, type CreateSharedManifestRequest, type CreateSharedManifestResponse, type DeleteSharedManifestInitiateResponse, type DeleteSharedManifestRequest, type GrantManifestAccessRequest, type GrantManifestAccessResponse, type GroupMemberInfo, type GroupOverviewResponse, type ManifestGrant, type ReceivedManifestInvitation, type VaultKeyAlgorithmValue } from '@/utils/dist/core/models/webapi';import { EncryptionUtility } from '@/utils/EncryptionUtility';-import { readLegacySessionEncryptionKey } from '@/utils/legacy/LegacyStorageKeyFallbacks';import { vaultCodecGenerateManifestSalt } from '@/utils/RustCore';import type { SqliteClient } from '@/utils/SqliteClient';import { VaultKeyService } from '@/utils/VaultKeyService';@@ -265,7 +264,7 @@ export class SharingService {* The session vault encryption key, or null while the vault is locked.*/private static async sessionEncryptionKey(): Promise<string | null> {- return ((await storage.getItem(StorageKeys.ENCRYPTION_KEY)) as string | null) ?? await readLegacySessionEncryptionKey();+ return (await storage.getItem(StorageKeys.ENCRYPTION_KEY)) as string | null;}/**diff --git a/apps/browser-extension/src/utils/constants/legacyStorageKeys.ts b/apps/browser-extension/src/utils/constants/legacyStorageKeys.tsindex 09bfd4344..3212a5ddf 100644--- a/apps/browser-extension/src/utils/constants/legacyStorageKeys.ts+++ b/apps/browser-extension/src/utils/constants/legacyStorageKeys.ts@@ -11,9 +11,6 @@import type { StorageKey } from '@/utils/constants/storageKeys';export const LegacyStorageKeys = {- /** Pre-v0.22 encryption key location; read as a fallback for `StorageKeys.ENCRYPTION_KEY`. */- DERIVED_KEY: 'session:derivedKey',-/** Pre-v0.26 Session locations migrated to local (see readLegacyStorageFallback) */SESSION_PUBLIC_EMAIL_DOMAINS: 'session:publicEmailDomains',SESSION_PRIVATE_EMAIL_DOMAINS: 'session:privateEmailDomains',diff --git a/apps/browser-extension/src/utils/legacy/LegacyStorageKeyFallbacks.ts b/apps/browser-extension/src/utils/legacy/LegacyStorageKeyFallbacks.tsindex 953ef2fe8..aa36cbe14 100644--- a/apps/browser-extension/src/utils/legacy/LegacyStorageKeyFallbacks.ts+++ b/apps/browser-extension/src/utils/legacy/LegacyStorageKeyFallbacks.ts@@ -44,11 +44,3 @@ export async function readLegacyStorageFallback<T>(key: StorageKey): Promise<T |return legacyValue;}--/**- * The session encryption key as stored before v0.22.0, when it lived under a different key name. Read only- * after {@link StorageKeys.ENCRYPTION_KEY} came up empty.- */-export async function readLegacySessionEncryptionKey(): Promise<string | null> {- return await storage.getItem(LegacyStorageKeys.DERIVED_KEY) as string | null;-}