Skip to content

Cover and document the client KEX role check - #1223

Merged
philljj merged 1 commit into
wolfSSL:masterfrom
ejohnstown:msgguard-kex-followup
Sep 3, 2026
Merged

Cover and document the client KEX role check#1223
philljj merged 1 commit into
wolfSSL:masterfrom
ejohnstown:msgguard-kex-followup

Conversation

@ejohnstown

Copy link
Copy Markdown
Contributor

Follow-up to #1222. Adds the client-side assertions that pin the new KEX
role check, and a comment recording what IsMessageAllowed() actually
answers.

  • TestClientOnlyKexMsgsBlocked asserts that 31 and 33, the ids a client
    does receive, stay allowed where the handshake expects them, so widening
    the role check into a 30-34 range fails the suite
  • the IsMessageAllowed() comment records that the side helpers implement
    the receive policy only, and that ids 30 to 49 are reallocated by each
    KEX method

Copilot AI lite review requested due to automatic review settings September 2, 2026 18:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Changes are low-risk (tests + documentation) and the new assertions better pin the intended client-side KEX role behavior.

Pull request overview

Follow-up to #1222 that tightens regression coverage for the client-side KEX role check and clarifies what IsMessageAllowed() is actually answering (receive policy) in src/internal.c.

Changes:

  • Extend TestClientOnlyKexMsgsBlocked to assert that client-expected KEX messages (e.g., 31 and 33) remain allowed in the correct handshake states, including during rekey.
  • Add explanatory documentation to IsMessageAllowed() about the unused state parameter and the per-KEX-method meaning of message IDs 30–49.
File summaries
File Description
tests/regress.c Strengthens client-side regression assertions around which KEX message IDs must be blocked vs. allowed in specific states.
src/internal.c Documents IsMessageAllowed() semantics (receive-only policy / unused state) and contextualizes KEX message ID allocation.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/internal.c Outdated
TestClientOnlyKexMsgsBlocked now asserts that 31 and 33, the ids a
client does receive, stay allowed where the handshake expects them, so
widening the role check into a 30-34 range fails the suite. The
IsMessageAllowed() comment records the receive-only policy and the
per-KEX-method id namespace.

- assert id 33 is allowed once expectMsgId is MSGID_KEXDH_GEX_REPLY
- assert expectMsgId starts at MSGID_NONE, so the role check is what
  rejects the blocked ids
- recheck all three blocked ids during a rekey on an established session

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #1223

Scan targets checked: wolfssh-bugs, wolfssh-src

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

@philljj
philljj merged commit b13704a into wolfSSL:master Sep 3, 2026
166 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.

5 participants