Skip to content

Commit

Permalink
Add key_pair_id for libspdm_gen_csr_ex
Browse files Browse the repository at this point in the history
Fix the issue: #2550

Signed-off-by: Wenxing Hou <[email protected]>
  • Loading branch information
Wenxing-hou committed Feb 4, 2024
1 parent eded450 commit 857cb52
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion include/hal/library/responder/csrlib.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright Notice:
* Copyright 2021-2023 DMTF. All rights reserved.
* Copyright 2021-2024 DMTF. All rights reserved.
* License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
**/

Expand Down Expand Up @@ -92,6 +92,8 @@ extern bool libspdm_gen_csr(uint32_t base_hash_algo, uint32_t base_asym_algo, bo
*
* @param[in, out] req_csr_tracking_tag For input, this field shall contain the CSRTrackingTag of the associated GET_CSR request.
* For output, this field indicate responder available csr_tracking_tag.
* @param[in] req_key_pair_id The value of this field shall be the unique key pair number identifying the desired
* asymmetric key pair to associate with SlotID.
* @param[in] overwrite If set, the Responder shall stop processing any existing GET_CSR request and
* overwrite it with this request
*
Expand All @@ -107,6 +109,7 @@ extern bool libspdm_gen_csr_ex(uint32_t base_hash_algo, uint32_t base_asym_algo,
size_t *csr_len, uint8_t *csr_pointer,
uint8_t req_cert_model,
uint8_t *req_csr_tracking_tag,
uint8_t req_key_pair_id,
bool overwrite);
#endif /*LIBSPDM_ENABLE_CAPABILITY_CSR_CAP_EX*/
#endif /* LIBSPDM_ENABLE_CAPABILITY_CSR_CAP */
Expand Down
4 changes: 2 additions & 2 deletions library/spdm_responder_lib/libspdm_rsp_csr.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright Notice:
* Copyright 2021-2022 DMTF. All rights reserved.
* Copyright 2021-2024 DMTF. All rights reserved.
* License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
**/

Expand Down Expand Up @@ -204,7 +204,7 @@ libspdm_return_t libspdm_get_response_csr(libspdm_context_t *spdm_context,
requester_info, requester_info_length,
opaque_data, opaque_data_length,
&csr_len, csr_p, req_cert_model,
&csr_tracking_tag, overwrite);
&csr_tracking_tag, key_pair_id, overwrite);
#else
return libspdm_generate_error_response(
spdm_context,
Expand Down
3 changes: 2 additions & 1 deletion os_stub/spdm_device_secret_lib_null/lib.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright Notice:
* Copyright 2021-2022 DMTF. All rights reserved.
* Copyright 2021-2024 DMTF. All rights reserved.
* License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
**/

Expand Down Expand Up @@ -161,6 +161,7 @@ bool libspdm_gen_csr_ex(uint32_t base_hash_algo, uint32_t base_asym_algo, bool *
size_t *csr_len, uint8_t *csr_pointer,
uint8_t req_cert_model,
uint8_t *csr_tracking_tag,
uint8_t req_key_pair_id,
bool overwrite)
{
return false;
Expand Down
3 changes: 2 additions & 1 deletion os_stub/spdm_device_secret_lib_sample/lib.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright Notice:
* Copyright 2021-2022 DMTF. All rights reserved.
* Copyright 2021-2024 DMTF. All rights reserved.
* License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
**/

Expand Down Expand Up @@ -870,6 +870,7 @@ bool libspdm_gen_csr_ex(uint32_t base_hash_algo, uint32_t base_asym_algo, bool *
size_t *csr_len, uint8_t *csr_pointer,
uint8_t req_cert_model,
uint8_t *req_csr_tracking_tag,
uint8_t req_key_pair_id,
bool overwrite)
{
bool result;
Expand Down

0 comments on commit 857cb52

Please sign in to comment.