fix(desktop): always use legacy keyring for blob entry on macOS#1271
Merged
Conversation
DPK and the legacy keyring are separate OS stores — a blob written by a signed build (DPK) is invisible to dev builds (legacy keyring) and vice versa. A user who ran the signed v0.3.32 release (which migrated per-key entries into a DPK blob) then switched to `tauri dev` would get Ok(None) for every agent key because the dev build reads from the legacy keyring, which is empty. Fix by always using the legacy keyring crate for the blob on macOS. Both signed release and unsigned dev builds now share the same store. The legacy keyring is still the macOS Keychain — secure, just the older SecKeychain API rather than SecItem/DPK. The per-key DPK migration path in migrate_legacy_key is unchanged: it still reads old DPK entries on signed builds for the one-time upgrade from the #1264 per-key format. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
3acde94 to
69e4b49
Compare
…load cache-hit test Three more correctness fixes: 1. load_blob() now only populates the cache when it is still None, preventing a cold reader from overwriting a newer cache entry written by mutate_blob() between the two lock acquisitions. 2. DPK blob migration now uses mutate_blob() with entry().or_insert_with() so existing legacy values are preserved on conflict (legacy wins). 3. Adds a non-ignored load() cache-hit test that runs in CI without the OS keychain. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
69e4b49 to
a2043b1
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.
Problem
DPK and the legacy keyring are separate OS stores. A blob written by a signed build (DPK) is invisible to dev builds (legacy keyring) and vice versa. A user who ran the signed v0.3.32 release — which migrated per-key entries into a DPK blob via #1267 — then switched to
tauri devwould getOk(None)for every agent key, because the dev build reads from the legacy keyring (empty).Fix
Always use the legacy keyring crate for the blob on macOS. Both signed release and unsigned dev builds now share the same store. The legacy keyring is still the macOS Keychain — secure, just the older SecKeychain API rather than SecItem/DPK.
The per-key DPK migration path in
migrate_legacy_keyis unchanged: it still reads old DPK entries on signed builds for the one-time upgrade from the #1264 per-key format.Changes
read_blob_raw(macOS): delegates directly toread_blob_raw_keyringinstead of trying DPK firstwrite_blob_raw(macOS): delegates directly towrite_blob_raw_keyringinstead of trying DPK firstset_generic_password_optionsimportBehavior
tauri dev)Follows #1267.