-
Notifications
You must be signed in to change notification settings - Fork 108
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
Conversation
64851e3
to
8428037
Compare
|
||
opaque_data_ptr = (uint8_t *)&opaque_data; | ||
opaque_data_size = sizeof(opaque_data); | ||
status = libspdm_get_element_from_opaque_data(spdm_context, |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Signed-off-by: Jiewen Yao <[email protected]>
Signed-off-by: Jiewen Yao <[email protected]>
Signed-off-by: Jiewen Yao <[email protected]>
Fix #2934