fix(desktop): fall back to old keychain when DPK unavailable (unsigned builds) - #1266
Merged
Merged
Conversation
…d builds) Unsigned/dev builds (tauri dev, hermit/cargo run) lack the hardened-runtime entitlement required by kSecUseDataProtectionKeychain. macOS returns errSecMissingEntitlement (-34018) and the app panics in the setup hook. Treat -34018 as "DPK unavailable" across all four SecretStore methods (probe/load/store/delete): when DPK returns that error, transparently retry via the legacy keyring crate path. Release builds (properly signed) continue using DPK with zero prompts. Dev builds fall back to old-keychain behavior (prompts once per key per session) without panicking. Windows/Linux paths are unchanged. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96
added a commit
that referenced
this pull request
Jun 25, 2026
Buzz stored each secret as a separate keychain item — the identity key plus one entry per managed agent (6 agents = 7 items total). On dev builds (old keychain, null ACL) every read and write triggers a prompt: 15-20+ on first launch. On release builds (DPK) the first launch prompts once per key (7 total). Goose solved this identically: one entry, all secrets as a JSON map, one prompt total. Switch SecretStore to the same pattern. A single blob entry (service = the store's service name, username = "secrets") holds all keys as a JSON map. The map is cached in-memory after the first read, so subsequent probe/load/store/delete calls within the same process never touch the keychain again. One prompt on first launch, zero after. Migration: on first launch after upgrade the blob doesn't exist yet. load() falls back to reading the old per-key DPK entry (macOS) or legacy keyring entry (all platforms), writes it into the new blob, and deletes the old item — one-time per key, transparent to callers. The is_dpk_unavailable (-34018) fallback from #1266 is incorporated here: unsigned dev builds fall back to the legacy keyring crate for the single blob entry. The probe/load/store/delete semantics seen by callers (IdentityKeyStore, KeyStore) are unchanged. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96
added a commit
that referenced
this pull request
Jun 25, 2026
Buzz stored each secret as a separate keychain item — the identity key plus one entry per managed agent (6 agents = 7 items total). On dev builds (old keychain, null ACL) every read and write triggers a prompt: 15-20+ on first launch. On release builds (DPK) the first launch prompts once per key (7 total). Goose solved this identically: one entry, all secrets as a JSON map, one prompt total. Switch SecretStore to the same pattern. A single blob entry (service = the store's service name, username = "secrets") holds all keys as a JSON map. The map is cached in-memory after the first read, so subsequent probe/load/store/delete calls within the same process never touch the keychain again. One prompt on first launch, zero after. Migration: on first launch after upgrade the blob doesn't exist yet. load() falls back to reading the old per-key DPK entry (macOS) or legacy keyring entry (all platforms), writes it into the new blob, and deletes the old item — one-time per key, transparent to callers. The is_dpk_unavailable (-34018) fallback from #1266 is incorporated here: unsigned dev builds fall back to the legacy keyring crate for the single blob entry. The probe/load/store/delete semantics seen by callers (IdentityKeyStore, KeyStore) are unchanged. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
BradGroux
pushed a commit
to BradGroux/buzz
that referenced
this pull request
Aug 23, 2026
…d builds) (block#1266) Signed-off-by: Will Pfleger <pfleger.will@gmail.com> Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
This was referenced Sep 5, 2026
asiazhang
added a commit
to asiazhang/ledger
that referenced
this pull request
Sep 5, 2026
* feat(encryption): 开发态回退——dev/未签名构建降级无门钥匙串缓存,自动解锁立即可用(#662) - 运行形态判别收口纯函数 uses_biometry_gate(发布带门 / 开发无门), RememberMode(biometry | dev-fallback)经 RememberPassphraseSupport.mode 暴露前端,序列化形态(kebab-case)有单测钉死 - 开发态 store 不设 access control,条目落传统钥匙串无门(与发布同 service/account,先删后建、不留混合条目);发布构建生物门路径零变化 - 实证偏离 ticket 步骤 1/2 字面手段:macOS 26.6.2 (Tahoe, arm64) 探针证实 无门条目写数据保护钥匙串同样 -34018(先例 block/buzz#1266),故不启用 OSX_10_15/use_protected_keychain,偏差记录于模块注释/Cargo 注释/冒烟清单 - -34018 提为专属码化错误 encryption.remember-entitlement-restricted (store/load 双路径),双语模板同步,不再误报「生物认证未启用」 - 设置页开发回退形态显示本地化提示(经 i18n),Vitest 正反用例覆盖 - 冒烟清单新增第 9 节(发布构建受限)与第 10 节(无门回退);词汇表 「自动解锁」运行形态边界更新;CHANGELOG Unreleased 记录 * docs(verification): 冒烟清单第 10 节按跨 cdhash 实测细化批准交互语义(#662)
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.
Problem
Unsigned and dev builds (
tauri dev, hermit/cargo run) lack the hardened-runtime entitlement required bykSecUseDataProtectionKeychain. macOS returnserrSecMissingEntitlement(-34018), which propagated up throughstore()→load_or_create_identity→ setup hook → panic.This was introduced in #1264, which switched the macOS keychain backend to Data Protection Keychain. Release builds (properly signed with hardened runtime) work correctly. Dev builds do not.
Fix
Add
is_dpk_unavailable(e: &SFError) -> boolthat checkse.code() == -34018. All four macOSSecretStoremethods (probe,load,store,delete) now have a fallback arm: when DPK returns -34018, they transparently retry via the legacykeyringcrate path — the same path used on Windows and Linux.Behavior after this fix
tauri dev/ hermit)Files changed
desktop/src-tauri/src/secret_store.rsonly