Skip to content

handshake: bind trust to peer pubkey, not node ID alone + panic-recover - #31

Merged
TeoSlayer merged 1 commit into
mainfrom
security/trust-key-binding
Jul 25, 2026
Merged

TeoSlayer merged 1 commit into
mainfrom
security/trust-key-binding

Conversation

@TeoSlayer

Copy link
Copy Markdown
Contributor

Trust key-binding (H4)
Trust records are now bound to the peer's public key, closing the node-ID-reuse trust-inheritance gap:

  • an accept/revoke whose stream identity doesn't match the record's bound key is refused;
  • a peer re-registering a known node ID with a different key is treated as a rebind, not the trusted incumbent;
  • reconciliation drops a stale key binding rather than adopting silently.

Panic-recover
recover() backstop around handleConnection; fuzz coverage over processMessage.

Tests
New zz_trust_key_binding_test.go, zz_attack_replay_trust_injection_test.go, zz_attack_replay_pubkey_panic_test.go, zz_fuzz_process_message_test.go; full package green under -race.

🤖 Generated with Claude Code

Trust is now keyed to the peer's public key: an accept/revoke whose stream
identity does not match the record's bound key is refused, a peer that
re-registers under a known node ID with a different key is treated as
rebound rather than inheriting the prior trust, and reconciliation drops a
stale binding. Adds a recover() backstop around handleConnection and fuzz
coverage over processMessage.

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

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@TeoSlayer
TeoSlayer merged commit e6ffda6 into main Jul 25, 2026
4 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.

2 participants