Skip to content

Fix spdm_ctrl public key output and error reporting - #670

Merged
dgarske merged 4 commits into
wolfSSL:masterfrom
aidangarske:fix-spdm-known-bugs
Nov 6, 2026
Merged

dgarske merged 4 commits into
wolfSSL:masterfrom
aidangarske:fix-spdm-known-bugs

Conversation

@aidangarske

@aidangarske aidangarske commented Nov 6, 2026 •

Copy link
Copy Markdown
Member
  • spdm_ctrl --get-pubkey printed only the first 32 bytes, so it could not feed --responder-pubkey
  • It now prints the full 192 hex P-384 X||Y, and rejects non-ECC keys, non-NIST curves and wrong coordinate sizes
  • spdm_ctrl printed "unknown error number" for wolfSPDM codes such as WOLFSPDM_E_CHUNK
  • All failure paths now print wolfSPDM error names, and -1 keeps the TPM string because the HAL also returns it
  • The session info skip missed Nuvoton's 0x1c4, which is TPM_RC_VALUE with parameter bits set
  • The skip now masks those bits, in the unit test and in spdm_ctrl --session-info
  • Fixed clang 21 unterminated-string warnings in the SPDM unit test
  • The GET_PUBK mock now answers GET_VERSION, so it works with the current lib/wolfSPDM pin and the fix

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.

🟡 Changes recommended

The ECC validation accepts oversized P-384 coordinates after the parser truncates them, allowing malformed keys to be printed without rejecting the lossy decoding.

1 open issue
What changed in this PR

This PR updates the SPDM control example to print complete responder public keys and improve error reporting, with regression tests and mock updates supporting the changes.

Changes:

  • Print full P-384 X||Y keys and validate decoded public-key fields.
  • Report wolfSPDM error names while preserving HAL handling for -1.
  • Recognize parameter-qualified capability errors and update SPDM test fixtures.
File Description
tests/​unit_tests.c Recognizes and tests unsupported SPDM capability responses with parameter bits.
tests/​spdm_ctrl_tests.c Adds error-string and public-key conversion regression tests.
src/​spdm/​unit_test.c Adds GET_VERSION mock responses and adjusts string buffer declarations.
examples/​spdm/​spdm_ctrl.c Adds full public-key output, validation, and consistent error reporting.

Review effort: Balanced

Comment thread examples/spdm/spdm_ctrl.c Resolved
@aidangarske aidangarske assigned dgarske and aidangarske and unassigned aidangarske and dgarske Nov 6, 2026

@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 #670

Scan targets checked: wolftpm-src, wolftpm-bugs
Coverage: 4 of 4 in-scope changed file(s) opened by the reviewer

Fenrir result: Approved ✅

No new issues found in the changed files.

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

Review tier: Max

@aidangarske aidangarske assigned dgarske and unassigned aidangarske Nov 6, 2026
@aidangarske
aidangarske requested a review from dgarske November 6, 2026 20:41
@dgarske
dgarske merged commit 750fa24 into wolfSSL:master Nov 6, 2026
247 checks passed
@aidangarske
aidangarske deleted the fix-spdm-known-bugs branch November 6, 2026 20:55
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.

4 participants