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

Allow non-zero vendor_id for libspdm_get_element_from_opaque_data() #2935

Merged
merged 3 commits into from
Dec 21, 2024

Conversation

jyao1
Copy link
Member

@jyao1 jyao1 commented Dec 18, 2024

Fix #2934

@jyao1 jyao1 force-pushed the opaque branch 4 times, most recently from 64851e3 to 8428037 Compare December 18, 2024 16:46
include/industry_standard/spdm.h Outdated Show resolved Hide resolved

opaque_data_ptr = (uint8_t *)&opaque_data;
opaque_data_size = sizeof(opaque_data);
status = libspdm_get_element_from_opaque_data(spdm_context,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does libspdm_get_element_from_opaque_data only get the first element_id? What if opaque data contains multiple opaque elements with the same element_id?

Copy link
Member Author

@jyao1 jyao1 Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libspdm_get_element_from_opaque_data() will get (element_id, and sm_data_id) pair. Although the name is generic, but it has assumption that element_id is DMTF, because sm_data_id is only under DMTF.

To me, this function is mess, I would not define in this way, if I can redo the work.

I plan to define two functions:

  • libspdm_get_element_from_opaque_data_with_element_id (element_id, element_index) - that is to get element with ID and index to support multiple elements.
  • libspdm_get_sm_data_element_from_opaque_data (sm_data_id) - that is to get SM_DATA only, with assumption that element_id is DMTF.

The first function can be used for SPDM 1.4 with DMTF-DSP, and support DSP0289 Authorization AODS.

  • libspdm_get_aods_element_from_opaque_data (aods_id) - that is to get AODS with assumption that element_id is DMTF-DSP.

I will file a new issue for the new function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will file a new issue for the new function.

That will be in a separate pull request?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, separate PR definitely.
Most likely, I will submit after I finish DSP0289 Auth POC. Then we can know how to handle different element ID.

@jyao1 jyao1 merged commit 02aaa49 into DMTF:main Dec 21, 2024
97 checks passed
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.

error in calculation opaque data element
2 participants