Skip to content

certificate: dynamically size portion length based on response buffer capacity - #8

Merged
wmaroneAMD merged 1 commit into
OpenPRoT:mainfrom
bluerise:spdm-valid-cert
Oct 23, 2026
Merged

wmaroneAMD merged 1 commit into
OpenPRoT:mainfrom
bluerise:spdm-valid-cert

Conversation

@bluerise

Copy link
Copy Markdown
Contributor

In DMTF SPDM conformance testing (test case 5.8 "no partial chain", assertion 5.8.4), the requester specifies Length = 0xFFFF expecting the entire remaining certificate chain to be returned in a single response when the transport and buffer allow it. Previously, generate_certificate_response unconditionally clamped portion_len to SPDM_MAX_CERT_CHAIN_PORTION_LEN (512 bytes), resulting in an unexpected non-zero RemainderLength and failing the test.

Changes:

  • Calculate max_portion from the response buffer's remaining capacity (rsp.capacity() - headers).
  • Bound portion_len by min(length, remainder_len, max_portion).
  • Return the full remaining certificate chain when buffer capacity permits while preventing buffer overflows.

… capacity

In DMTF SPDM conformance testing (test case 5.8 "no partial chain",
assertion 5.8.4), the requester specifies Length = 0xFFFF expecting the
entire remaining certificate chain to be returned in a single response
when the transport and buffer allow it. Previously,
generate_certificate_response unconditionally clamped portion_len to
SPDM_MAX_CERT_CHAIN_PORTION_LEN (512 bytes), resulting in an unexpected
non-zero RemainderLength and failing the test.

Changes:
- Calculate max_portion from the response buffer's remaining capacity
  (rsp.capacity() - headers).
- Bound portion_len by min(length, remainder_len, max_portion).
- Return the full remaining certificate chain when buffer capacity permits
  while preventing buffer overflows.
@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: bluerise / name: Patrick Wildt (8b85d4c)

@wmaroneAMD
wmaroneAMD merged commit 624d0b4 into OpenPRoT:main Oct 23, 2026
12 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