Repository navigation
fix(sync): ledger MAC follow-ups from the #332 review (M-1, M-2) - #334
Merged
ahmet-cetinkaya merged 1 commit intoOct 29, 2026
Merged
ahmet-cetinkaya merged 1 commit into
ahmet-cetinkaya merged 1 commit into
Conversation
… cannot be checked without the key file stay on disk (#332 follow-ups M-1, M-2)
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.
What
Efe's three MINORs from the #332 review.
_decodeLedgerdecoded each record's MAC unguarded, so a non-base64 or non-stringmacmade the whole ledger unreadable (origins, epoch counter and HLC high-waters treated as missing). Each record is now decoded inside a guard and a malformed one is skipped, as the code comment always said.unverifiedRevocations) and written back unchanged, so a later load with the key still sees it.persistRevocationsandclearRevocationsalso clear it.sync-ledger-mac.mdand the F5 design note now record the actual design: nogroupIdsalt, with the reason (pairing persists records before the key file knows the group id; the record's own signature binds the group; group exit clears records).Tests
file_sync_key_store_test.dart: malformed MAC ('!!!not-base64!!!',12345,'AAA') skips only that record and keeps the origin; key file removed -> ledger written -> key restored -> record verifies again.dart analyzeclean; appsync+persistence/sync225 pass. No soak (store code only, engine untouched).