Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When endpoint claims KEY_EX but not MAC capabilities libspdm should only prevent secure messages, not stop negotiation #2921

Closed
lordaule opened this issue Dec 2, 2024 · 1 comment · Fixed by #2933
Assignees
Labels
enhancement New feature or request

Comments

@lordaule
Copy link

lordaule commented Dec 2, 2024

A vendor claims their implementation is compliant with DSP0274, but libspdm is failing to accept their Capabilities response:

Received 13 bytes
00000000 05 11 61 00 00 00 0a 00 00 56 d2 00 00 : ..a......V...
SPDM negotiation failed (ret 0x80010005)

libspdm validate_responder_capability() currently has this code:

        if ((key_ex_cap == 1) || (psk_cap != 0)) {
            /* While clearing MAC_CAP and setting ENCRYPT_CAP is legal according to DSP0274, libspdm
             * also implements DSP0277 secure messages, which requires at least MAC_CAP to be set.
             */
            if (mac_cap == 0) {
                return false;
            }

By returning false above, the library prevents all future communication with the endpoint. Instead of preventing negotiation, libspdm instead could just clear the SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_KEY_EX_CAP and PSK_CAP bits from the negotiated response, or set some other flag, to prevent sending secure messages but still allow Challenge, Measurements, etc.

@steven-bellock steven-bellock added the enhancement New feature or request label Dec 2, 2024
@steven-bellock steven-bellock self-assigned this Dec 2, 2024
@steven-bellock
Copy link
Contributor

Similar to what is done for the OpaqueDataFmt

if (libspdm_get_connection_version(spdm_context) >= SPDM_MESSAGE_VERSION_12) {
if ((spdm_context->connection_info.algorithm.other_params_support &
SPDM_ALGORITHMS_OPAQUE_DATA_FORMAT_MASK) != SPDM_ALGORITHMS_OPAQUE_DATA_FORMAT_1) {
return LIBSPDM_STATUS_INVALID_STATE_PEER;
}
}
the check can be deferred to when KEY_EXCHANGE is initiated.

steven-bellock added a commit to steven-bellock/libspdm that referenced this issue Dec 17, 2024
steven-bellock added a commit to steven-bellock/libspdm that referenced this issue Dec 17, 2024
steven-bellock added a commit to steven-bellock/libspdm that referenced this issue Dec 18, 2024
@jyao1 jyao1 closed this as completed in 575862a Dec 20, 2024
ShitalJumbad pushed a commit to ShitalJumbad/libspdm that referenced this issue Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants