Repository navigation
fix: correlate base answers and bind peer identity in sm and peer - #123
Merged
Merged
Conversation
Part 1 of the protocol contract decided in #108. sm.StateMachine, sm.Client and peer.Manager differed in how strictly they matched base answers to their requests and in which peer they accepted watchdog and disconnect requests from. - CEA: the CER is tracked per connection generation with its Hop-by-Hop and End-to-End identifiers. A CEA that does not match, malformed or not, is discarded with a Warn record and a notification, and the handshake keeps waiting until its original deadline; the Manager no longer fails the connection on an identifier mismatch, and the Client learns the peer's identity from the matching CEA (RFC 6733 §§3, 5.3, 6.2.1). - DPA: an answer completes a disconnect only if a DPR is pending on that generation and the command, both identifiers and the bound peer host match, checked before its Result-Code is read (§§5.4.2, 6.2.1). - StateMachine no longer answers DWR or DPR from a host other than the admitted peer, and such a DPR does not start Closing, as in the Manager (§6.3). - DWA: StateMachine validates a successful DWA as the Manager does (single identities and Result-Code, bound host and realm). Received traffic resets Tw, but an invalid, rejected or mismatched DWA neither clears the pending probe nor restores health (RFC 3539 §3.4.1, Appendix A). Refs #108
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Part 1 of the protocol contract decided in #108. sm.StateMachine,
sm.Client and peer.Manager differed in how strictly they matched base
answers to their requests and in which peer they accepted watchdog and
disconnect requests from.
and End-to-End identifiers. A CEA that does not match, malformed or
not, is discarded with a Warn record and a notification, and the
handshake keeps waiting until its original deadline; the Manager no
longer fails the connection on an identifier mismatch, and the Client
learns the peer's identity from the matching CEA (RFC 6733 §§3, 5.3,
6.2.1).
generation and the command, both identifiers and the bound peer host
match, checked before its Result-Code is read (§§5.4.2, 6.2.1).
admitted peer, and such a DPR does not start Closing, as in the
Manager (§6.3).
(single identities and Result-Code, bound host and realm). Received
traffic resets Tw, but an invalid, rejected or mismatched DWA neither
clears the pending probe nor restores health (RFC 3539 §3.4.1,
Appendix A).
Refs #108
Validation
make checkpasses locally for all modules: format, test (Go 1.27.2 and1.26.9), race, vet, lint, vuln, windows, secrets and codeql.
identifier and host mismatches, a malformed uncorrelated CEA followed by the
right one or by nothing, duplicate and stale answers, wrong-host DWR and DPR,
and invalid, rejected or mismatched DWAs while SUSPECT. Captures show the
wrong-host requests answered on main and unanswered here.
missing log record; both are fixed with their own tests, and mutating any
row fails a named test.
Summary by cubic
Correlates base protocol answers in
smandpeerso a peer cannot consume a pending request with an unrelated or malformed answer, and binds watchdog and disconnect requests to the admitted peer identity.Clientnow learns the peer identity from the matching CEA.StateMachinemirrors theManagerin rejecting DWR and DPR from a non-admitted host; such DPR also no longer enters Closing (RFC 6733 §6.3).StateMachinevalidates successful DWAs like theManager(single Result-Code and identities bound to the peer), and while received traffic still resets Tw, an invalid, rejected, or mismatched DWA neither clears the pending probe nor restores health (RFC 3539 §3.4.1, Appendix A).Refs #108.
Written for commit 82ddcc3. Summary will update on new commits.