Repository navigation
Log each TLK share field's type and length when its signature fails - #14
Open
gregakespret wants to merge 1 commit into
Open
gregakespret wants to merge 1 commit into
gregakespret wants to merge 1 commit into
Conversation
The names-only warning shows that failing share records carry every known field twice and the extra field once. It cannot show which copy was signed, what CloudKit type the extra arrived as, or how many bytes we signed for it. The warning now lists every field in record order with its type, value slot and length, marks a copy a later field of the same name supersedes, and gives each extra's signed length. Values are never logged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JvDrSTtCSuxsh3iMaZ8sPX
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 TLK share fails its signature check, the warning now lists every record field in order, instead of names only:
Skipping TLK share for <service>: it failed its signature check (<error>); fields=<n> extras=<k> layout=[<name>:<CloudKit type>:<slot>/<len>[:<marker>], ...]Markers:
superseded: a later field with the same name replaces this one, so it is not signed.extra-signed/<n>: the bytes we signed for an extra field.extra-unsigned,extra-superseded,server,encrypted.The line never contains a value, only names, types and lengths.
Why. The names-only line shows the failing records carry each of the ten known fields twice and
tlkOwnershipProofonce.from_recordkeeps the last copy, so we sign the second copy's values plus the extra. The new line shows two things: whether the two copies differ in type or length, and what CloudKit type the extra arrives as.Next step: compare with the upstream project's candidate fix. That is an open pull request there that adds extra fields to
data_for_signing, and it is not on this branch. On these records, porting it probably would not help:from_record, so neither handles a repeated known field.server_*.parentKeyRefandwrappedKeyas known. The failing records use only the lowercase names.So if
tlkOwnershipProoflogs asBYTES_TYPE:bytes/<n>, the two implementations sign the same bytes, and the repeated copy is the lead. If it logs as anything else, port the encoding for that type.Tests. Three new tests in
tlkshare_signing_tests:cargo test --lib --no-default-features --features remote-anisette-v3 icloud::keychainpasses 15 of 15. I did not run the default-feature build.🤖 Generated with Claude Code
https://claude.ai/code/session_01JvDrSTtCSuxsh3iMaZ8sPX