Repository navigation
Conversation
Mark7888
force-pushed
the
claude/magical-hamilton-q9sjfe-impl
branch
from
November 13, 2026 13:53
391f363 to
864cf3c
Compare
Mark7888
force-pushed
the
claude/magical-hamilton-q9sjfe
branch
from
November 13, 2026 22:24
485eb3c to
120f171
Compare
Mark7888
force-pushed
the
claude/magical-hamilton-q9sjfe-impl
branch
2 times, most recently
from
November 13, 2026 23:15
0365e9e to
db2d941
Compare
The remaining devices now check a new epoch's key against its store link (spec/crypto.md §7.1), so a rekey without one would strand them, store items or not. The store refuses it with ErrStoreLinkRequired and the relay answers CLIENT_OUTDATED, as it already did for a group with items: only a client older than the store sends none. The check moves to the end of the rekey script's validation, so a rekey that is wrong in another way is still told so first. The script no longer reads the store index, which existed only for the old rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01883ho3VieWfSCRWEa5iBK9
Devices now check every new epoch's key against the store links (spec/crypto.md §7.1), and a group's store is off until the admin turns it on, so refusing the links with STORE_DISABLED would have made every rekey of such a group fail the check. The links are opaque to the relay and the store switch has nothing to do with them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01883ho3VieWfSCRWEa5iBK9
Two ways a relay could get a group key without the user doing anything are closed here. - Pairing: a join notice no longer wraps the group key. It becomes a JoinRequest, delivered to Handlers.OnJoinRequest and Invitation.Request, and only JoinRequest.Confirm wraps; Reject ends the invitation with ErrJoinRejected. A notice counts only for a token this client minted, still open and not yet claimed (SPEC §3.2). - Rekey: a delivered key for a newer epoch is installed only when the store links chain it back to the key this device holds (spec/crypto.md §7.1). Missing links, a relay that refuses them, or a chain ending anywhere else refuse the key with ErrUnverifiedKey and Handlers.OnKeyRefused. The check makes a request, so it runs off the read loop, one key at a time. - Device.Fingerprint and Client.Fingerprint, for the dialogs that show them. A hostile-relay harness in the internal tests pushes forged keys and made-up join notices. The interop Go peer confirms the join it awaits and reports the fingerprint it agreed to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01883ho3VieWfSCRWEa5iBK9
The Go client now holds a join until the user confirms it; this is the desktop's half. - Service: join requests are held as plans with an id, listed in the status, and answered with ConfirmJoin or RejectJoin, the only way a device is admitted through an invitation. A key the client refused is kept as a note until a key is installed. This device's fingerprint is in the status and every roster device carries its own. - Joining waits up to the token's five minutes rather than one request's thirty seconds: the other device's user confirms first. - UI: a dialog at the top of the app asks to add or turn down a device, with its fingerprint, whichever tab is open. The join panel shows this device's fingerprint and says what it is waiting for. Devices, the revoke dialog and Settings show fingerprints, and a refused key shows as a notice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01883ho3VieWfSCRWEa5iBK9
The same two fixes as the Go client, for the Android app's core. - Pairing: a join notice becomes a JoinRequest, delivered to onJoinRequest and Invitation.request; only its confirm wraps the key, and reject rejects Invitation.joined with 'join-rejected'. A notice counts only for a token this client minted, still open and not yet claimed. A joiner now waits up to the token's five minutes. - Rekey: a delivered key for a newer epoch is installed only when the store links chain it back to the key this device holds (chainsBack, spec/crypto.md §7.1); otherwise onKeyRefused gets an 'unverified-key' error. Keys are checked one at a time. The fake relay serves store links and can push forged keys and made-up join notices; the interop tests confirm the join on both sides and check the fingerprint the Go peer agreed to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01883ho3VieWfSCRWEa5iBK9
- A sheet above every tab asks to add or turn down a device that used this phone's invitation, with its fingerprint. It cannot be dismissed without an answer, and goes away when the code expires. - The setup screen shows this phone's fingerprint for the other device to compare, and says it is waiting while that device confirms. - Devices and the remove sheet show each device's fingerprint, Settings shows this device's, and the Sync screen says when the relay offered a key this phone could not verify. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01883ho3VieWfSCRWEa5iBK9
- Add a device: the member is asked to check the new device's fingerprint before it gets the key, with a screenshot of the dialog. - Devices: every device shows its fingerprint, the revoke dialog lists them, and each remaining device checks the new key. - Settings: this device's fingerprint. - Troubleshooting: what a refused key means and how to recover. - Security: adding a device, the key check, and what a hostile relay can still do. - Retake the desktop Devices, revoke, pairing code and Settings screenshots, from the built UI against a mocked local API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01883ho3VieWfSCRWEa5iBK9
An inviter dropped a join whose invitation had expired by the relay's reported time, read on its own clock: a device whose clock runs ahead of the relay's would ignore every join. Master's new demo relay, with its injected clock, showed it in the TypeScript client, which was fixed in its own commit; this is the same fix here. - An invitation stays open for five minutes on this device's clock, the relay's token lifetime. JoinRequest.ExpiresAt is that time too, so the desktop drops a stale request by its own clock. - Confirm refuses once its invitation has ended, as when this device switched or left its group after the request was shown: the key on hand may not be the group it was for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01883ho3VieWfSCRWEa5iBK9
Mark7888
force-pushed
the
claude/magical-hamilton-q9sjfe-impl
branch
from
November 13, 2026 23:19
db2d941 to
4634d7f
Compare
This branch has not been deployed
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.
Phase 1 of
docs/internal/plans/relay-trust-hardening.md: the implementation. It's stacked on #54, the spec change, and targets that branch. Retarget it tomasteronce #54 merges. No proto changes.What it fixes
A modified relay could get a group's key without the user doing anything:
Changes, one commit per area
CLIENT_OUTDATED; only clients older than v1.2.0 send none.JoinRequest(viaHandlers.OnJoinRequestandInvitation.Request), and onlyConfirmwraps the key.chainsBacksucceeds: the store links must lead from it to the key the device holds (spec/crypto.md §7.1). Missing links, a refusal, or a chain ending anywhere else givesErrUnverifiedKeyandOnKeyRefused.ConfirmJoinandRejectJoinare the only way in, with new endpoints under/api/pairing/join-requests/.epochs.ts,JoinRequest,onKeyRefused).Changes from the rebase onto master
resetGroupState) and Android (resetScreens).src/core/demo/relay.ts, which replaced the test fake relay) serves store links with or without a store and carries the hostile-relay test hooks.Tests
chainsBackin Go and TypeScript.npm run interoppairs the TypeScript and Go clients through the new confirmation, checks the fingerprint the Go peer agreed to, and verifies each other's rekeys against a real relay and Redis.Checks run locally after the rebase, all passing:
go test -race ./...inserver,pkg/tppclientanddesktop; golangci-lint v2.6.2;make fmt-check.npm run build.npm test(479 tests),lint,typecheckandinterop.npm run build.The Android app was not run on a device; its screens are checked only by type checks and lint.
Compatibility
The plan's §3.5 has the full table.
🤖 Generated with Claude Code
https://claude.ai/code/session_01883ho3VieWfSCRWEa5iBK9