Repository navigation
Bridge protocol 1: prove the token with an HMAC challenge instead of sending it (T57) - #125
Merged
Merged
Conversation
…tead of sending it (T57) Each side contributes a fresh 32-byte nonce and proves the token with HMAC-SHA-256 over a context string, its role and both nonces. The token is never on the wire; proofs are compared in constant time; frames carry at most 1024 bytes and the whole handshake has 5 seconds until it is done. An old bridge meets a reject that names both versions. ADR 0039, spec/bridge-protocol.md with test vectors, bridge-protocol crate, net service listener, fake-game, fuzz target bridge_handshake.
This was referenced Oct 27, 2026
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.
Board task T57 (taken over from TideOPL). Bridge protocol version 1:
hellono longer carries the token.What changes on the wire
helloisversion: u16+ a 32-byte nonce. Newchallenge(0x0004: version, service nonce, service proof) andauth(0x0005: bridge proof). Thenwelcomeorreject.AnyPlay bridge v1, a role byte (1 bridge, 2 service) and both nonces. The bridge checks the service's proof before it sends its own. Constant-time compare. Test vectors in the spec, checked by both sides (same bytes).crates/bridge-protocol(auth module with SHA-256/HMAC, no new dependency, so no Cargo.lock change beyondfake-gameusingrand), net listener runs the handshake itself (the service only sees authenticated bridges),fake-gamedoes the real handshake, new fuzz targetbridge_handshake.Fork
The bridge change is anyplaynet/AnyPS5#31. Do not merge this before that PR's Windows build is green; the launcher's
network.refmust not move to a net service whose matching AnyPS5 build is not offered.Tested
Not built locally (no cargo on this PC today); CI is the first run. The auth primitives and vectors were cross-checked with Node's crypto and a g++ build of the C++ header.
Need help on this PR? Tag
@codesmith-botwith what you need.