-
Notifications
You must be signed in to change notification settings - Fork 102
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
Enforce non-zero CertModel
#2745
Conversation
I'll add the unit tests for CSR in a subsequent push. |
if (key_pair_id == 0) { | ||
return LIBSPDM_STATUS_INVALID_PARAMETER; | ||
} | ||
if ((csr_cert_model != SPDM_CERTIFICATE_INFO_CERT_MODEL_DEVICE_CERT) && |
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.
Hi. It is better to use:
req_cert_model >= SPDM_GET_CSR_REQUEST_ATTRIBUTES_MAX_CSR_CERT_MODEL
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.
It can't be 0
either. I'll make a helper function in common_lib
and then this logic can be consolidated.
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.
Didn't make a helper function for now.
f150e8a
to
5fd0328
Compare
Fix DMTF#2581. Signed-off-by: Steven Bellock <[email protected]>
The unit test has been added. |
@steven-bellock , have you validated spdm-emu? I notice spdm-emu failed on set_cert with latest libspdm. Would you please take a look?
|
I have not. I'll have a look at it. |
@jyao1 the
In particular if |
As an aside, after re-reading the specification and looking at this pull request, it might be too aggressive with the
But maybe this should only be checked if |
Yes, please submit PR to fix. We need this patch for Q2 release. |
I have a fix for |
Fix #2581.
Signed-off-by: Steven Bellock [email protected]