Skip to content

Tighten session state, negotiation and secured record handling - #77

Open
aidangarske wants to merge 74 commits into
wolfSSL:mainfrom
aidangarske:fenrir-fixes-15487-14777
Open

aidangarske wants to merge 74 commits into
wolfSSL:mainfrom
aidangarske:fenrir-fixes-15487-14777

Conversation

@aidangarske

@aidangarske aidangarske commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

F-15487 - 7d6409a - FINISH now marks the requester connected only after the session keys are derived.

F-14777 - 780ec90 - Handshake secrets and the ephemeral key are now retired once application keys are installed or a key exchange is rejected.

F-14790 - 8e23e48 - A failed KEY_EXCHANGE now restores the requester transcript.

F-14791 - 39b9dc7 - A failed FINISH now restores the requester transcript.

F-14792 - 0203d0e - GetVersion now starts a fresh negotiation and clears the prior session and certificate state.

F-14795 - 83dfcac - The decrypted FINISH peer error code is now recorded.

F-15489 - 3ad2fd2 - The decrypted PSK_FINISH peer error code is now recorded.

F-15491 - 8f83a30 - The peer error code now survives END_SESSION teardown.

F-15490 - 7277eaf - TCG VCA and secured vendor replies now preserve the peer error code.

F-15494 - eb513ff - A cleartext PSK_FINISH rejection is now recognized before secured record decoding.

F-14812 - 51f58f2 - Requester session reset now wipes the retained measurement record.

F-15493 - fb3d24b - Certificate retrieval is now rejected before it can modify an active or provisional session.

F-15597 - a4811de - A failed PSK connection now retires the provisional session keys and keeps the error and peer code.

F-15517 - 5cdccbb - PSK handshake material is now wiped when the exchange parser rejects peer verification.

F-18793 - 813fd3f - Debug output no longer prints locally computed PSK verification data.

F-15512 - f9a3886 - The public header and implementation comments now describe the PSK exchange actually performed.

F-17861 - c0dcf1a - The reset documentation now says only an unconsumed PSK is retained.

F-15513 - 0bc50d4 - The BinConcat overview now documents the negotiated SPDM version and the base specification.

F-17862 - 16c214b - The ML-KEM comment and docs now describe an HMAC mismatch during KEY_EXCHANGE_RSP.

F-17863 - 40132e6 - The docs now say M1 can append in RUN_LIVE and consecutive L1/L2 measurements continue in RUN_OPEN.

F-15594 - 8e86e04 - The shared post-extract KDF now wipes its handshake root when expansion fails.

F-15596 - e8a04d3 - TCG Connect now resets provisional session material on a GIVE_PUB or FINISH failure and returns the original error.

F-14809 - 6968f2d - Standard Connect now resets provisional handshake and traffic material on a FINISH failure and returns the original error.

F-17870 - 2ed7fd8 - A single-direction key update now resets the request sequence only alongside newly derived keys, and a derivation failure retires the session.

F-17875 - 2c9d205 - P-384 key storage now has a compile-time minimum, and the pinning API checks copy capacity.

F-14810 - b16023d - Both per-record IVs are now cleared on success and failure.

F-14811 - ff1fd8a - The full decrypted measurements response buffer is now cleared.

F-15488 - 357721c - The responder now reports connected only after sealing the FINISH reply and deriving application keys, and resets if either fails.

F-17895 - ce76b6a - TCG connect and fine-grained KEY_EXCHANGE now reject a certificate-derived key with WOLFSPDM_E_BAD_STATE.

F-17896 - d28bad8 - Both record paths now wipe the AES context after freeing it.

F-15549 - b4da50d - CHALLENGE now rejects measurement summaries when the peer has no measurement capability and rejects reserved summary types.

F-15495 - 6ab79fe - GET_VERSION and END_SESSION now require a complete versioned message before acting.

F-17871 - d213a71 - A secured TCG frame must now match its declared record length.

F-15568 - 7e2e9ea - TCG framing now checks destination capacity and the representable return size before adding the header.

F-15555 - 2777cf3 - ALGORITHMS parsing now ignores reserved OtherParamsSelection bits while still validating the known format and connection-mode bits.

F-17897 - 1620202 - HMAC setup, update and finalization errors now share the existing release and wipe.

F-15553 - 94fadb7 - The secured MCTP message type is now rejected at authenticated application-data boundaries.

F-17853 - de842be - Vendor responses before negotiation now use the request version without setting the negotiated version.

F-15557 - e2e384d - CHALLENGE and GET_MEASUREMENTS now zero-fill the unused SPDM 1.3 RequesterContext.

F-18792 - 604d5aa - SHA-384 state is now freed and wiped on success and failure.

F-15593 - 1dd1031 - An accepted END_SESSION now retires the responder session even if the ACK cannot be sealed.

F-17864 - df48b12 - Comments now explain the TCG NEGOTIATE_ALGORITHMS MeasurementSpecification and OtherParamsSupport bytes.

F-18803 - 761c170 - Standard NEGOTIATE_ALGORITHMS now advertises only the DHE, AEAD, key schedule and optional KEM structures it supports, dropping requester signing.

F-15556 - e3f13a9 - END_SESSION_ACK validation now checks length, version and opcode and ignores the reserved parameters.

F-18777 - 6957e33 - The public header overview now documents the standard, TCG, vendor and PSK modes.

F-15592 - cf560fd - Removing a PSK credential now retires pending or established PSK sessions and leaves asymmetric sessions alone.

F-15554 - 19edce3 - ALGORITHMS parsing now requires the specified count field in the standard binding and keeps the legacy layout for TCG.

F-17854 - 70b1814 - The responder now restores its clear transcript when a handler fails.

F-18775 - 2b0692a - A standard requester with a pinned P-384 key now omits ML-DSA and rejects an incompatible selection.

F-18774 - b55b533 - The responder now restores its transcript after reporting an unsupported request.

F-17865 - 8a64363 - PSK_EXCHANGE_RSP parsing now uses the 12-byte fixed field size for the minimum length and verify offset.

F-18817 - c5bb305 - The responder now validates the full decrypted header and authenticated version before dispatch.

F-15497 - 9c7073b - The Nations status API now exposes the SPDM-only pending-disable state.

F-18805 - 090f4f1 - The VERSION reply buffer now holds a response up to the minimum transfer size.

F-17852 - 430996f - The handshake transcript now keeps one certificate hash across repeat fetches, and a failed fetch leaves only the VCA.

F-15496 - b772378 - The TPM2CMD0-4 request aliases now expect a TPM2_CMD acknowledgment.

F-15537 - 86a79c0 - Certificate chain validation now enforces validity dates and leaf and CA key usage.

F-15547 - 1962e59 - SPDM 1.4 PSK_FINISH and PSK_FINISH_RSP now carry OpaqueDataLength, covered by the transcript.

F-15548 - ad5b658 - ConnectPsk now skips PSK_FINISH when PSK_EXCHANGE_RSP has no ResponderContext.

F-15567 - 73a81dd - Responder reset now clears the negotiated version, so GET_VERSION must come first again.

F-15570 - fc86e7b - The responder now requires KEY_EXCHANGE OpaqueDataLength to match the request length.

F-18823 - 50145de - A failed responder KEY_EXCHANGE or PSK_EXCHANGE now wipes the handshake state, and a failed FINISH or PSK_FINISH resets the responder.

F-14808 - 0a90072 - Responses after negotiation must now carry the negotiated SPDM version.

F-15538 - 67493a7 - Every TCG exchange now replaces the cached FIPS indicator, and only an exact APPROVED value counts.

F-15551 - f640169 - A standard KEY_EXCHANGE with a pinned key now requires a retrieved certificate chain before naming a slot.

F-18802 - e050894 - An authenticated DecryptError from the peer now ends the requester session and wipes its keys.

F-18773 - 30ae5f5 - Cleartext ERROR replies are now detected on every secured exchange, including chunked FINISH.

F-17855 - 3892920 - Any sealed SPDM request, including KEY_UPDATE and EncryptMessage, now ends an open measurement run.

F-15569 - 2230c8c - Secured records whose length does not fit the 16-bit Length field are now refused.

F-15550 - e0e5e91 - MCTP records now track the full 64-bit sequence number across 16-bit rollover.

F-15518 - db7f560 - Responder and TCG builds now require wolfSSL with ECC_TIMING_RESISTANT, checked at configure and compile time.

F-15552 - 267cd83 - KeyUpdate now ends the session when VerifyNewKey fails after the responder acknowledged the update.

@aidangarske aidangarske self-assigned this Nov 23, 2026
Comment thread src/spdm_context.c
if (pubKeySz != WOLFSPDM_ECC_POINT_SIZE) {
return WOLFSPDM_E_INVALID_ARG;
}
if (pubKeySz > sizeof(ctx->rspPubKey)) {
@aidangarske
aidangarske force-pushed the fenrir-fixes-15487-14777 branch from 100e19d to f431f9e Compare November 23, 2026 23:58
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