Repository navigation
fix(masterkey): resolve Linux v11 keys via Secret Service - #705
Merged
Merged
Conversation
moonD4rk
force-pushed
the
fix/linux-secret-service-lookup
branch
from
November 18, 2026 09:23
f683048 to
fd9f3b0
Compare
moonD4rk
force-pushed
the
fix/linux-secret-service-lookup
branch
from
November 19, 2026 02:41
9c3ea04 to
778a09e
Compare
moonD4rk
force-pushed
the
fix/linux-secret-service-lookup
branch
from
November 19, 2026 08:47
16cc7e9 to
12ea323
Compare
Enumerating a collection and matching the label exactly missed keys: a GNOME keyring listing stale item paths aborted the whole read, and KWallet labels entries "<X> Keys/<X> Safe Storage". Use SearchItems (live items only) and match the label by suffix.
A locked wallet now reports "locked" instead of "not found", every D-Bus call (label read, session close) is bounded by the timeout, and the lookup also searches by KWallet's user attribute so it no longer depends on the xdg:schema label. The label match is a tested pure func.
dbus.SessionBus spawned a dbus-daemon when no bus was found and ignored the lookup deadline; call errors also read as not found. The client is now a type with Close, and the lookup policy is tested against a fake.
moonD4rk
force-pushed
the
fix/linux-secret-service-lookup
branch
from
November 19, 2026 08:51
12ea323 to
d5892cc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Linux v11 master-key retrieval on GNOME and KDE. Refs #572, #161 (not fully resolved here — see note).
Stacked on #704 (base
feat/firefox-primary-password); GitHub retargets tomainas the stack merges.Problem
The Secret Service lookup enumerated a collection's items and matched the label exactly:
<X> Keys/<X> Safe Storage, so an exact match misses them.Fix
Rewrite
dbusRetrieveron godbus directly and drop thego-dbus-keyringdependency:SearchItemsby libsecret's schema (GNOME), KWallet's schema, and KWallet'suserattribute (the entry name), so the lookup does not depend on the schema label KWallet sets./-suffix, reading items one by one so a stale path is skipped.keyring or wallet is lockedinstead ofnot found.not found, and a host without a session bus gets an error instead of adbus-launched daemon left running.Validated on real desktops (seeded fake data, author's VM, wallet open)
ok.ok.The follow-ups (locked error,
userquery, bounded calls, private connection) are not yet re-run on the VM. In a Linux container against a real gnome-keyring, the final code and the previous head agree on found (libsecret and KWallet-style labels), not found, and locked; without a session bus the old code launched a dbus-daemon and reportednot found, the new one reports the missing bus.Follow-ups
#161's environment (Ubuntu 22.04 + kdewallet5) has no Secret Service at all, so it needs native KWallet over D-Bus (3b). Refs #572, #161 — kept open for that.
Test
go test ./...+ linuxmasterkeytests +golangci-lintclean;go mod tidykeptgo 1.20. The lookup policy has a table test against a fake Secret Service (KWallet labels, stale path, prompt-free unlock, wallet that stays locked, timeout); seven deliberate mutations of it each fail a case.