Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
Summary
Every Ed25519 key and signature must now hold points of order exactly L, as flow-sync #101 specifies, so all Flow implementations give one answer for one signature.
is_valid_signing_keyalso checks that the key is torsion free.verifyalready calls it first, so the check runs when a key enters the roster and again on every signature.verify_strictthen settlesR: it refuses small order, compares the canonical encoding, and with a torsion-free key its equation can only hold for anRof order L.VerifyingKey::to_edwardsreturns the point, andis_torsion_freeis its method.Cargo.tomlandCargo.lockare unchanged.apply_entry, so the check also runs on stored entries. A chain that holds such a key stops at that entry withroster-key, on every device, as the spec's design expects. Honest clients never write one.check_subject. A restore's signer, log objects, live messages and LAN hellos all use keys from the roster state, and all go throughverify. A pairing'sJoinkey becomes anaddentry thatapply_entrychecks before it is appended. No path was found that verifies with an unchecked key.Follows flow-sync #101.
Related issue
None.
Change type
Validation
Run on macOS arm64.
pnpm test: not run, no frontend file changedpnpm build: not run, no frontend file changedcargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check: exit 0cargo clippy --all-targets --all-featuresinsrc-tauri: exit 0, no warnings from this change; one existing warning atroster.rs:378on a line it doesn't touchcargo test --no-fail-fast --all-targets --all-featuresinsrc-tauri: 1286 passed, 0 failed, 9 ignoredBefore the change,
ed25519_strict_verificationfailed onmixed-order-key-both-equationsand the roster negatives failed onmixed-order-key.Checked by breaking the code on purpose, one change at a time, with
sync2_vectorsandsync2_roster:verifyskips the key checkverifyisn't strictRisk and compatibility
No format or database change.
verifytakes longer: in the unoptimized test build, the key check is about 160 µs of a 430 µs verification. The release build wasn't measured.Not run against Android or a server under this rule.
This file set overlaps other open PRs on
roster.json, the fixtures README and the changelog, so whichever lands later takes the fixtures again.No new secrets, private data, telemetry, or broad Tauri permissions were introduced.
User-facing documentation was updated where needed. (
spec/crypto.mdin flow-sync fix(dearrow): strip case-preservation markers from titles #101)Dependency and lockfile changes are intentional and limited to this PR. (none)
Breaking changes and upgrade steps are clearly documented. (none for honest clients)