DMTF / libspdm

BSD 3-Clause "New" or "Revised" License
113 stars 102 forks source link

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

Open Zhiqiang520 opened 11 months ago

Zhiqiang520 commented 11 months ago

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. https://github.com/DMTF/libspdm/blob/955350eff19ff9cf2af29663b5407bb7e9cede57/os_stub/spdm_device_secret_lib_sample/lib.c#L1232-L1274 https://github.com/DMTF/libspdm/blob/955350eff19ff9cf2af29663b5407bb7e9cede57/os_stub/spdm_device_secret_lib_sample/lib.c#L1207-L1228

steven-bellock commented 11 months ago

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 commented 11 months ago

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

steven-bellock commented 10 months ago

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.