Skip to content

Add DSP0277 1.3 AEAD limit support#3644

Open
jyao1 wants to merge 2 commits into
DMTF:mainfrom
jyao1:dsp0277-1.3-proposal
Open

Add DSP0277 1.3 AEAD limit support#3644
jyao1 wants to merge 2 commits into
DMTF:mainfrom
jyao1:dsp0277-1.3-proposal

Conversation

@jyao1

@jyao1 jyao1 commented Jun 6, 2026

Copy link
Copy Markdown
Member

Implements the DSP0277 1.3 "AEAD limit" feature (issue #3639).

A new Secured Message opaque-data element AEADlimitOE (SMDataID = 2) carries a 1-byte AeadLimitExponent (<= 64; AeadLimit = 2^exp; default 64). It is exchanged in the Session-Secrets-Exchange request and response opaque data (KEY_EXCHANGE/KEY_EXCHANGE_RSP and PSK_EXCHANGE/PSK_EXCHANGE_RSP), and both the Requester and the Responder populate it.

Design

  • Single source of truth: max_spdm_session_sequence_number is the only integrator-settable knob. The advertised AeadLimitExponent is derived from it as floor(log2(max + 1)); a non-power-of-two cap rounds the advertised limit down (the safe direction). There is no separate exponent set/get, so the two can never disagree.
  • The session cap is stored as (2^exp) - 1 to match the seq >= max overflow check, and the all-ones default maps to exponent 64 without ever computing 2^64.
  • At session establishment each endpoint sets the session's effective cap to min(local cap, peer AEAD limit); neither side is ever raised by the other.
  • The per-session cap is read-only via get_data(LIBSPDM_DATA_MAX_SPDM_SESSION_SEQUENCE_NUMBER, LIBSPDM_DATA_LOCATION_SESSION); a per-session set is rejected.
  • AEADlimitOE is only defined for secured message version 1.3+. The version gate is enforced inside the size/append helpers (they take the target version), so the element is never emitted onto a sub-1.3 session, and a received element is ignored for an older negotiated version. Parsing is order-independent.
  • Secured message version 0x13 is added to the default advertised list.

Tests

Adds unit tests covering: build/parse round-trip, exponent > 64 rejected, absent-defaults-to-64, effective limit = min, order-independence, version gating, and peer-supports vs peer-does-not-support. Also adds doc/aead_limit.md.

All test_spdm_common cases pass (28 total), and the requester/responder KEY_EXCHANGE and PSK_EXCHANGE suites pass.

@jyao1 jyao1 requested a review from steven-bellock as a code owner June 6, 2026 01:44
@jyao1 jyao1 linked an issue Jun 6, 2026 that may be closed by this pull request
@jyao1 jyao1 force-pushed the dsp0277-1.3-proposal branch from 3d2bd4d to 895b930 Compare June 6, 2026 01:50
Implement the DSP0277 1.3 "AEAD limit" feature. A new Secured Message
opaque-data element AEADlimitOE (SMDataID = 2) carries a 1-byte
AeadLimitExponent (<= 64; AeadLimit = 2^exp; default 64). It is exchanged
in the Session-Secrets-Exchange request and response opaque data
(KEY_EXCHANGE/KEY_EXCHANGE_RSP and PSK_EXCHANGE/PSK_EXCHANGE_RSP), and
both the Requester and the Responder populate it.

Design highlights:
- Single source of truth: max_spdm_session_sequence_number is the only
  integrator-settable knob. The advertised AeadLimitExponent is derived
  from it as floor(log2(max + 1)); a non-power-of-two cap rounds the
  advertised limit down (the safe direction). There is no separate
  exponent set/get, so the two can never disagree.
- The session cap is stored as (2^exp) - 1 to match the
  "seq >= max" overflow check, and the all-ones default maps to
  exponent 64 without computing 2^64.
- At session establishment each endpoint sets the session's effective
  cap to min(local cap, peer AEAD limit); neither side is ever raised.
- The per-session cap is read-only via
  get_data(LIBSPDM_DATA_MAX_SPDM_SESSION_SEQUENCE_NUMBER,
  LIBSPDM_DATA_LOCATION_SESSION); a per-session set is rejected.
- The AEADlimitOE element is only defined for secured message version
  1.3+. The version gate is enforced inside the size/append helpers
  (they take the target version), so the element is never emitted onto
  a sub-1.3 session, and a received element is ignored for an older
  negotiated version. Parsing is order-independent.
- Secured message version 0x13 is added to the default advertised list.

Adds unit tests (build/parse round-trip, exponent > 64 rejected,
absent-defaults-to-64, effective limit = min, order-independence,
version gating, peer-supports vs peer-does-not-support) and
doc/aead_limit.md.

Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Assisted-by: Claude Code:claude-opus-4-8
@jyao1 jyao1 force-pushed the dsp0277-1.3-proposal branch 2 times, most recently from 0365e51 to ceda067 Compare June 6, 2026 02:11
libspdm now implements the DSP0277 1.3 AEAD limit feature, so list
DSP0277 version 1.3.0 in the specifications section.

Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Assisted-by: Claude Code:claude-opus-4-8
@jyao1 jyao1 force-pushed the dsp0277-1.3-proposal branch from ceda067 to 3643aeb Compare June 6, 2026 02:14
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.

Add DSP0277 version 1.3

1 participant