Repository navigation
A keychain zone without its class key is an error, not a panic - #10
Open
gregakespret wants to merge 2 commits into
Open
gregakespret wants to merge 2 commits into
gregakespret wants to merge 2 commits into
Conversation
A TLK share that fails its signature check is skipped, which leaves its
zone with no class key. Saving the Find My service key into Manatee then
hit expect("Insert class key not found") in insert_keychain and took the
whole export task down. Return PushError::ZoneKeyMissing instead.
get_service_key checks for the same key before minting, so a save that
cannot succeed doesn't first make get_master_key upload a new master key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HW3tPgNjtZokBFXjYn8Qkn
rustfmt on the lines c9c30ab added; the rest of keychain.rs is untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HW3tPgNjtZokBFXjYn8Qkn
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.
When a keychain zone has no class key,
insert_keychainnow returnsPushError::ZoneKeyMissing(zone)instead of panicking withexpect("Insert class key not found"). A zone ends up keyless when we skip its TLK share because the share failed its signature check (or was never sent).KeychainClientState::get_class_keyis the lookup that returns the error.PCSPrivateKey::get_service_keychecks the service zone'sclassCkey before it goes down the mint path. If the key is missing, it stops beforeget_master_keycan upload a new master key for a service-key save that is bound to fail. If the zone does hold its key, behaviour is unchanged.Why ≥80%: seven prod exports (sessions a16401a1, 0864073b, 2b7c9efb, 993ad8d2, eb2172b0, 8683d33e, 7185a364, Oct 10–11) all show the same sequence:
FIND_MY_SERVICE.zoneis Manatee, so the save that panicked is the one now guarded.class_key_testscovers both cases: a zone without its key is an error, and other zones' keys don't stand in for it. A zone-blind lookup fails that test. All 12 lib tests pass.Not verified:
insert_keychainandget_service_keythemselves aren't exercised; that needs a live CloudKit session and an affected account.cargo build --release.Consumer: gregakespret/export-findmy, branch fix/missing-zone-key-no-panic. It maps the error to
trust_circle_signature.🤖 Generated with Claude Code
https://claude.ai/code/session_01HW3tPgNjtZokBFXjYn8Qkn