Skip to content

Commit 7e83902

Browse files
Rhinomcdclaudemaria-rcks
authored
fix(desktop): Vivaldi cookie import finds its Linux keyring key (#27148)
Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: maria-rcks <[email protected]>
1 parent 609dd0f commit 7e83902

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

‎apps/desktop/src/preview/BrowserImport/ChromiumKeys.test.ts‎

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
unwrapWindowsDpapiKey,
1818
} from "./ChromiumKeys.ts";
1919
import { LinuxBrowserSecretPath } from "./LinuxBrowserSecret.ts";
20+
import { BROWSER_IMPORT_SOURCES } from "./Sources.ts";
2021

2122
const { getPassword } = vi.hoisted(() => ({ getPassword: vi.fn<() => string | null>() }));
2223

@@ -146,12 +147,24 @@ describe("Linux Chromium secrets", () => {
146147
),
147148
);
148149

149-
it.effect("preserves trailing whitespace in the stored secret", () =>
150-
Effect.gen(function* () {
151-
const secret = yield* readLinuxSecret("chrome");
152-
expect(secret).toBe("linux-secret \t\n");
153-
}).pipe(Effect.provide(layerHelper({ stdout: "linux-secret \t\n" }))),
154-
);
150+
it.effect("derives Vivaldi's Linux key while preserving whitespace in the stored secret", () => {
151+
let captured: CapturedCommand | undefined;
152+
return Effect.gen(function* () {
153+
const source = BROWSER_IMPORT_SOURCES.find((source) => source.id === "vivaldi")!;
154+
const keys = yield* resolveChromiumKeys({
155+
platform: "linux",
156+
keychainService: source.keychainService,
157+
keychainAccount: source.keychainAccount,
158+
linuxSecretApplication: source.linuxSecretApplication,
159+
});
160+
expect(captured?.args).toEqual(["chrome"]);
161+
expect(keys.cbcV11?.toString("hex")).toBe("95aa769d6a5beca14d5d90ae655db112");
162+
}).pipe(
163+
Effect.provide(
164+
layerHelper({ stdout: "linux-secret \t\n", capture: (value) => (captured = value) }),
165+
),
166+
);
167+
});
155168

156169
it.effect("drains stdout and stderr concurrently", () =>
157170
Effect.gen(function* () {

‎apps/desktop/src/preview/BrowserImport/Sources.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ export const BROWSER_IMPORT_SOURCES: ReadonlyArray<BrowserImportSourceDefinition
109109
keychainAccount: "Vivaldi",
110110
macSegments: ["Vivaldi"],
111111
linuxSegments: ["vivaldi"],
112-
linuxSecretApplication: "vivaldi",
112+
// Vivaldi stores its Linux libsecret key under Chrome's application name.
113+
linuxSecretApplication: "chrome",
113114
}),
114115
chromiumSource({
115116
id: "opera",

0 commit comments

Comments
 (0)