Skip to content

security: verify registration proof-of-possession (PPA-003 server side)#101

Merged
matthew-pilot merged 1 commit into
mainfrom
security/registration-signature-auth
Jul 24, 2026
Merged

security: verify registration proof-of-possession (PPA-003 server side)#101
matthew-pilot merged 1 commit into
mainfrom
security/registration-signature-auth

Conversation

@TeoSlayer

Copy link
Copy Markdown
Contributor

Completes the server half of PPA-003. The client-signing half is pilot-protocol/common#37; the daemon already signs register:<listen_addr>:<public_key> with the same ed25519 identity it uses for heartbeat/deregister.

HandleRegister now verifies the optional signature field over register:<listen_addr>:<public_key> against the submitted public_key, using the same crypto.Verify primitive as the existing signed operations. The verify runs lock-free (before HandleReRegister takes s.mu), per the file's lock-ordering rule.

Backward-compatible by default (verify-if-present):

  • unsigned registrations from old agents are still accepted;
  • a present-but-invalid signature is rejected — catches tampering / forged re-registration endpoint-repoints even in the default mode;
  • new -strict-registration-auth / RENDEZVOUS_STRICT_REGISTRATION_AUTH requires a valid signature (opt-in; enable only once the fleet signs). Mirrors the existing default-off -strict-directory-auth (WS2) wiring exactly.

End-to-end compatibility verified: daemon signer is base64(ed25519.Sign(identity, challenge)) (web4 daemon.go:2260); this verify is ed25519.Verify(pub, "register:<addr>:<pubkey>", sig) — identical challenge + primitive.

Tests: TestHandleRegisterSignatureVerification — 7 cases (unsigned-allowed-by-default, unsigned-rejected-when-strict, valid-accepted both modes, wrong-key-rejected both modes, malformed-rejected). Full go test -race ./... green (20 pkgs), no regressions.

Deploy note: ship with the flag off, let the signing client roll out fleet-wide, then flip -strict-registration-auth for the airtight guarantee.

🤖 Generated with Claude Code

…server side)

Completes the server half of PPA-003 (client signing lands in common#37).
HandleRegister now verifies the optional `signature` field over
"register:<listen_addr>:<public_key>" against the submitted public_key,
using the same ed25519 primitive as heartbeat/deregister/resolve.

Backward-compatible by default (verify-if-present):
- unsigned registrations from old agents are still accepted;
- a present-but-invalid signature is rejected (catches tampering / forged
  re-registration endpoint-repoints);
- the new -strict-registration-auth flag / RENDEZVOUS_STRICT_REGISTRATION_AUTH
  requires a valid signature (opt-in; enable only once the fleet signs).

Mirrors the existing default-off StrictDirectoryAuth (WS2) wiring.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@matthew-pilot
matthew-pilot merged commit c23cd0f into main Jul 24, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants