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

OpaqueData format should be different between SPDM 1.1.2 and SPDM 1.2.1 #2462

Open
Zhiqiang520 opened this issue Dec 6, 2023 · 3 comments
Open
Labels
bug Something isn't working

Comments

@Zhiqiang520
Copy link
Contributor

OpaqueData format should be different between SPDM 1.1.2 and SPDM 1.2.1.

  1. In DSP0274_1.1.2.pdf.
    1.1 Refer to the paragraph 256 Successful CHALLENGE_AUTH response message format
    image
    1.2 Refer to the paragraph 327 Successful MEASUREMENTS response message format
    image

  2. In DSP0274_1.2.1.pdf.
    2.1 Refer to the paragraph 353 Table 36 — Successful CHALLENGE_AUTH response message format
    image
    2.2 Refer to the paragraph 417 Table 43 — Successful MEASUREMENTS response message format
    image

  3. But the code always generate the OpaqueData Free-form in libspdm_challenge_opaque_data, libspdm_encap_challenge_opaque_data and libspdm_measurement_opaque_data, ignore the SPDM version and the selected opaque data format in OtherParamsSelection.

    bool libspdm_challenge_opaque_data(
    spdm_version_number_t spdm_version,
    uint8_t slot_id,
    uint8_t *measurement_summary_hash,
    size_t measurement_summary_hash_size,
    void *opaque_data,
    size_t *opaque_data_size)
    {
    size_t index;
    LIBSPDM_ASSERT(libspdm_secret_lib_challenge_opaque_data_size <= *opaque_data_size);
    *opaque_data_size = libspdm_secret_lib_challenge_opaque_data_size;
    for (index = 0; index < *opaque_data_size; index++)
    {
    ((uint8_t *)opaque_data)[index] = (uint8_t)index;
    }
    return true;
    }
    bool libspdm_encap_challenge_opaque_data(
    spdm_version_number_t spdm_version,
    uint8_t slot_id,
    uint8_t *measurement_summary_hash,
    size_t measurement_summary_hash_size,
    void *opaque_data,
    size_t *opaque_data_size)
    {
    size_t index;
    LIBSPDM_ASSERT(libspdm_secret_lib_challenge_opaque_data_size <= *opaque_data_size);
    *opaque_data_size = libspdm_secret_lib_challenge_opaque_data_size;
    for (index = 0; index < *opaque_data_size; index++)
    {
    ((uint8_t *)opaque_data)[index] = (uint8_t)index;
    }
    return true;
    }

    bool libspdm_measurement_opaque_data(
    spdm_version_number_t spdm_version,
    uint8_t measurement_specification,
    uint32_t measurement_hash_algo,
    uint8_t measurement_index,
    uint8_t request_attribute,
    void *opaque_data,
    size_t *opaque_data_size)
    {
    size_t index;
    LIBSPDM_ASSERT(libspdm_secret_lib_meas_opaque_data_size <= *opaque_data_size);
    *opaque_data_size = libspdm_secret_lib_meas_opaque_data_size;
    for (index = 0; index < *opaque_data_size; index++)
    {
    ((uint8_t *)opaque_data)[index] = (uint8_t)index;
    }
    return true;
    }

@steven-bellock
Copy link
Contributor

277 imposes more structure on SPDM 1.1 opaque data. If an endpoint supports 277 1.0 or 1.1 (ie, key exchange is supported), and if secured messages are enabled, then all OpaqueData fields must conform to the "Secured Message opaque data format".

The Secured Message general opaque data table defines the general format for all opaque data fields. If the selected SPDM protocol version is 1.1, then all opaque data fields in SPDM messages shall utilize the format defined by Secured Message general opaque data.

@steven-bellock
Copy link
Contributor

Filed https://github.com/DMTF/SPDM-WG/issues/3302 for clarification on that.

@jyao1 jyao1 added the bug Something isn't working label Dec 11, 2023
@steven-bellock
Copy link
Contributor

The resolution to https://github.com/DMTF/SPDM-WG/issues/3302 is that the "Secured Message opaque data format" is only applicable during key exchange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants