Skip to content

Commit

Permalink
Fix SET_CERTIFICATE build break
Browse files Browse the repository at this point in the history
1. Set LIBSPDM_SET_CERT_CSR_PARAMS to 0 by default.
2. Wrap is_busy parameter in sert_cert.c with LIBSPDM_SET_CERT_CSR_PARAMS.

Signed-off-by: Steven Bellock <[email protected]>
  • Loading branch information
steven-bellock committed Dec 2, 2024
1 parent 7206ad5 commit daaf36d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/library/spdm_lib_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
* This macro will be removed when libspdm 4.0 is released.
*/
#ifndef LIBSPDM_SET_CERT_CSR_PARAMS
#define LIBSPDM_SET_CERT_CSR_PARAMS 1
#define LIBSPDM_SET_CERT_CSR_PARAMS 0
#endif

#endif /* SPDM_LIB_CONFIG_H */
5 changes: 4 additions & 1 deletion os_stub/spdm_device_secret_lib_sample/set_cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@ bool libspdm_write_certificate_to_nvm(
#endif /* LIBSPDM_SET_CERT_CSR_PARAMS */
)
{
#if LIBSPDM_SET_CERT_CSR_PARAMS
if (g_set_cert_is_busy) {
*is_busy = true;

return false;
} else {
} else
#endif /* LIBSPDM_SET_CERT_CSR_PARAMS */
{
#if defined(_WIN32) || (defined(__clang__) && (defined (LIBSPDM_CPU_AARCH64) || \
defined(LIBSPDM_CPU_ARM)))
FILE *fp_out;
Expand Down
2 changes: 2 additions & 0 deletions unit_test/test_spdm_responder/set_certificate_rsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,7 @@ void libspdm_test_responder_set_certificate_rsp_case12(void **state)
**/
void libspdm_test_responder_set_certificate_rsp_case13(void **state)
{
#if LIBSPDM_SET_CERT_CSR_PARAMS
libspdm_return_t status;
libspdm_test_context_t *spdm_test_context;
libspdm_context_t *spdm_context;
Expand Down Expand Up @@ -1111,6 +1112,7 @@ void libspdm_test_responder_set_certificate_rsp_case13(void **state)

free(cert_chain);
free(m_libspdm_set_certificate_request);
#endif /* LIBSPDM_SET_CERT_CSR_PARAMS */
}

int libspdm_responder_set_certificate_rsp_test_main(void)
Expand Down

0 comments on commit daaf36d

Please sign in to comment.