Skip to content

Negotiate the SPDM version before GET_PUBK - #39

Merged
dgarske merged 1 commit into
wolfSSL:mainfrom
aidangarske:fix-known-bugs
Nov 6, 2026
Merged

dgarske merged 1 commit into
wolfSSL:mainfrom
aidangarske:fix-known-bugs

Conversation

@aidangarske

@aidangarske aidangarske commented Nov 6, 2026 •

Copy link
Copy Markdown
Member
  • wolfSPDM_TCG_GetPubKey sent GET_PUBK without a prior GET_VERSION
  • Nuvoton NPCT75x answers that with ERROR UnexpectedRequest (0x04)
  • GetPubKey now runs GET_VERSION first when no version is negotiated
  • A failed GET_VERSION is returned without sending GET_PUBK
  • wolfSPDM_ConnectTCG already negotiated first, so its path is unchanged
  • Added a test where the mock rejects GET_PUBK before GET_VERSION, and one where GET_VERSION fails and the retry succeeds

needs wolfSSL/wolfTPM#670

@aidangarske aidangarske self-assigned this Nov 6, 2026
Copilot AI balanced review requested due to automatic review settings November 6, 2026 20:14

Copilot AI 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.

🟢 Approval recommended

No active review issues are reported for the change to negotiate the SPDM version before public-key discovery.

No open issues 🎉

What changed in this PR

Ensures TCG public-key discovery negotiates the SPDM version before sending GET_PUBK, addressing Nuvoton NPCT75x rejection of requests sent before negotiation.

Changes:

  • Adds version negotiation for fresh contexts and returns negotiation errors without sending GET_PUBK.
  • Adds tests for request ordering, reuse of the negotiated version, and successful retry after negotiation failure.
File Description
test/​unit_test.c Updates the mock to enforce negotiation ordering and adds success and failure/retry tests.
src/​spdm_tcg.c Negotiates the version before GET_PUBK when the context is in its initial state.

Review effort: Balanced

@dgarske
dgarske merged commit 0e0cbe8 into wolfSSL:main Nov 6, 2026
74 of 88 checks passed
@aidangarske
aidangarske deleted the fix-known-bugs branch November 6, 2026 22:38
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