Skip to content

Commit

Permalink
add LIBSPDM_ or libspdm_ for any external symbol or MACRO.
Browse files Browse the repository at this point in the history
for libspdm_common_lib.

Signed-off-by: Qi Zhang <[email protected]>
  • Loading branch information
qizhangz authored and jyao1 committed Feb 24, 2022
1 parent d972fc7 commit 2a5fdc0
Show file tree
Hide file tree
Showing 133 changed files with 3,647 additions and 3,588 deletions.
352 changes: 176 additions & 176 deletions include/internal/libspdm_common_lib.h

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions include/internal/libspdm_requester_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ return_status spdm_handle_simple_error_response(void *context,
* @retval RETURN_SECURITY_VIOLATION The error code is DECRYPT_ERROR and session_id is NOT NULL.
**/
return_status spdm_handle_error_response_main(
spdm_context_t *spdm_context, const uint32_t *session_id,
libspdm_context_t *spdm_context, const uint32_t *session_id,
uintn *response_size, void *response,
uint8_t original_request_code, uint8_t expected_response_code,
uintn expected_response_size);
Expand All @@ -65,7 +65,7 @@ return_status spdm_handle_error_response_main(
* @retval RETURN_SUCCESS The GET_VERSION is sent and the VERSION is received.
* @retval RETURN_DEVICE_ERROR A device error occurs when communicates with the device.
**/
return_status spdm_get_version(spdm_context_t *spdm_context,
return_status spdm_get_version(libspdm_context_t *spdm_context,
uint8_t *version_number_entry_count,
spdm_version_number_t *version_number_entry);

Expand All @@ -81,7 +81,7 @@ return_status spdm_get_version(spdm_context_t *spdm_context,
* @retval RETURN_SUCCESS The GET_CAPABILITIES is sent and the CAPABILITIES is received.
* @retval RETURN_DEVICE_ERROR A device error occurs when communicates with the device.
**/
return_status spdm_get_capabilities(spdm_context_t *spdm_context);
return_status spdm_get_capabilities(libspdm_context_t *spdm_context);

/**
* This function sends NEGOTIATE_ALGORITHMS and receives ALGORITHMS.
Expand All @@ -91,7 +91,7 @@ return_status spdm_get_capabilities(spdm_context_t *spdm_context);
* @retval RETURN_SUCCESS The NEGOTIATE_ALGORITHMS is sent and the ALGORITHMS is received.
* @retval RETURN_DEVICE_ERROR A device error occurs when communicates with the device.
**/
return_status spdm_negotiate_algorithms(spdm_context_t *spdm_context);
return_status spdm_negotiate_algorithms(libspdm_context_t *spdm_context);

/**
* This function sends KEY_EXCHANGE and receives KEY_EXCHANGE_RSP for SPDM key exchange.
Expand All @@ -111,7 +111,7 @@ return_status spdm_negotiate_algorithms(spdm_context_t *spdm_context);
#if LIBSPDM_ENABLE_CAPABILITY_KEY_EX_CAP

return_status spdm_send_receive_key_exchange(
spdm_context_t *spdm_context, uint8_t measurement_hash_type,
libspdm_context_t *spdm_context, uint8_t measurement_hash_type,
uint8_t slot_id, uint8_t session_policy, uint32_t *session_id,
uint8_t *heartbeat_period,
uint8_t *req_slot_id_param, void *measurement_hash);
Expand Down Expand Up @@ -139,7 +139,7 @@ return_status spdm_send_receive_key_exchange(
#if LIBSPDM_ENABLE_CAPABILITY_KEY_EX_CAP

return_status spdm_send_receive_key_exchange_ex(
spdm_context_t *spdm_context, uint8_t measurement_hash_type,
libspdm_context_t *spdm_context, uint8_t measurement_hash_type,
uint8_t slot_id, uint8_t session_policy, uint32_t *session_id,
uint8_t *heartbeat_period,
uint8_t *req_slot_id_param, void *measurement_hash,
Expand All @@ -159,7 +159,7 @@ return_status spdm_send_receive_key_exchange_ex(
* @retval RETURN_SUCCESS The FINISH is sent and the FINISH_RSP is received.
* @retval RETURN_DEVICE_ERROR A device error occurs when communicates with the device.
**/
return_status spdm_send_receive_finish(spdm_context_t *spdm_context,
return_status spdm_send_receive_finish(libspdm_context_t *spdm_context,
uint32_t session_id,
uint8_t req_slot_id_param);

Expand All @@ -178,7 +178,7 @@ return_status spdm_send_receive_finish(spdm_context_t *spdm_context,
**/
#if LIBSPDM_ENABLE_CAPABILITY_PSK_EX_CAP

return_status spdm_send_receive_psk_exchange(spdm_context_t *spdm_context,
return_status spdm_send_receive_psk_exchange(libspdm_context_t *spdm_context,
uint8_t measurement_hash_type,
uint8_t session_policy,
uint32_t *session_id,
Expand Down Expand Up @@ -213,7 +213,7 @@ return_status spdm_send_receive_psk_exchange(spdm_context_t *spdm_context,
**/
#if LIBSPDM_ENABLE_CAPABILITY_PSK_EX_CAP

return_status spdm_send_receive_psk_exchange_ex(spdm_context_t *spdm_context,
return_status spdm_send_receive_psk_exchange_ex(libspdm_context_t *spdm_context,
uint8_t measurement_hash_type,
uint8_t session_policy,
uint32_t *session_id,
Expand All @@ -239,7 +239,7 @@ return_status spdm_send_receive_psk_exchange_ex(spdm_context_t *spdm_context,
**/
#if LIBSPDM_ENABLE_CAPABILITY_PSK_EX_CAP

return_status spdm_send_receive_psk_finish(spdm_context_t *spdm_context,
return_status spdm_send_receive_psk_finish(libspdm_context_t *spdm_context,
uint32_t session_id);

#endif /* LIBSPDM_ENABLE_CAPABILITY_PSK_EX_CAP*/
Expand All @@ -254,7 +254,7 @@ return_status spdm_send_receive_psk_finish(spdm_context_t *spdm_context,
* @retval RETURN_SUCCESS The END_SESSION is sent and the END_SESSION_ACK is received.
* @retval RETURN_DEVICE_ERROR A device error occurs when communicates with the device.
**/
return_status spdm_send_receive_end_session(spdm_context_t *spdm_context,
return_status spdm_send_receive_end_session(libspdm_context_t *spdm_context,
uint32_t session_id,
uint8_t end_session_attributes);

Expand All @@ -274,7 +274,7 @@ return_status spdm_send_receive_end_session(spdm_context_t *spdm_context,
* @retval RETURN_SUCCESS The SPDM Encapsulated requests are sent and the responses are received.
* @retval RETURN_DEVICE_ERROR A device error occurs when communicates with the device.
**/
return_status spdm_encapsulated_request(spdm_context_t *spdm_context,
return_status spdm_encapsulated_request(libspdm_context_t *spdm_context,
const uint32_t *session_id,
uint8_t mut_auth_requested,
uint8_t *req_slot_id_param);
Expand Down Expand Up @@ -388,7 +388,7 @@ return_status spdm_get_encap_response_key_update(void *context,
* @retval RETURN_SUCCESS The SPDM request is sent successfully.
* @retval RETURN_DEVICE_ERROR A device error occurs when the SPDM request is sent to the device.
**/
return_status spdm_send_spdm_request(spdm_context_t *spdm_context,
return_status spdm_send_spdm_request(libspdm_context_t *spdm_context,
const uint32_t *session_id,
uintn request_size, const void *request);

Expand All @@ -407,7 +407,7 @@ return_status spdm_send_spdm_request(spdm_context_t *spdm_context,
* @retval RETURN_SUCCESS The SPDM response is received successfully.
* @retval RETURN_DEVICE_ERROR A device error occurs when the SPDM response is received from the device.
**/
return_status spdm_receive_spdm_response(spdm_context_t *spdm_context,
return_status spdm_receive_spdm_response(libspdm_context_t *spdm_context,
const uint32_t *session_id,
uintn *response_size,
void *response);
Expand Down
26 changes: 13 additions & 13 deletions include/internal/libspdm_responder_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ return_status spdm_get_response_encapsulated_response_ack(
* @retval RETURN_BUFFER_TOO_SMALL The buffer is too small to hold the data.
**/
return_status
spdm_get_encap_request_get_digest(spdm_context_t *spdm_context,
spdm_get_encap_request_get_digest(libspdm_context_t *spdm_context,
uintn *encap_request_size,
void *encap_request);

Expand All @@ -490,7 +490,7 @@ spdm_get_encap_request_get_digest(spdm_context_t *spdm_context,
#if LIBSPDM_ENABLE_CAPABILITY_CERT_CAP

return_status spdm_process_encap_response_digest(
spdm_context_t *spdm_context, uintn encap_response_size,
libspdm_context_t *spdm_context, uintn encap_response_size,
const void *encap_response, bool *need_continue);

#endif /* LIBSPDM_ENABLE_CAPABILITY_CERT_CAP*/
Expand All @@ -509,7 +509,7 @@ return_status spdm_process_encap_response_digest(
* @retval RETURN_BUFFER_TOO_SMALL The buffer is too small to hold the data.
**/
return_status
spdm_get_encap_request_get_certificate(spdm_context_t *spdm_context,
spdm_get_encap_request_get_certificate(libspdm_context_t *spdm_context,
uintn *encap_request_size,
void *encap_request);

Expand All @@ -526,7 +526,7 @@ spdm_get_encap_request_get_certificate(spdm_context_t *spdm_context,
* @retval RETURN_SECURITY_VIOLATION Any verification fails.
**/
return_status spdm_process_encap_response_certificate(
spdm_context_t *spdm_context, uintn encap_response_size,
libspdm_context_t *spdm_context, uintn encap_response_size,
const void *encap_response, bool *need_continue);

/**
Expand All @@ -542,7 +542,7 @@ return_status spdm_process_encap_response_certificate(
* @retval RETURN_SUCCESS The encapsulated request is returned.
* @retval RETURN_BUFFER_TOO_SMALL The buffer is too small to hold the data.
**/
return_status spdm_get_encap_request_challenge(spdm_context_t *spdm_context,
return_status spdm_get_encap_request_challenge(libspdm_context_t *spdm_context,
uintn *encap_request_size,
void *encap_request);

Expand All @@ -559,7 +559,7 @@ return_status spdm_get_encap_request_challenge(spdm_context_t *spdm_context,
* @retval RETURN_SECURITY_VIOLATION Any verification fails.
**/
return_status spdm_process_encap_response_challenge_auth(
spdm_context_t *spdm_context, uintn encap_response_size,
libspdm_context_t *spdm_context, uintn encap_response_size,
const void *encap_response, bool *need_continue);

/**
Expand All @@ -576,7 +576,7 @@ return_status spdm_process_encap_response_challenge_auth(
* @retval RETURN_BUFFER_TOO_SMALL The buffer is too small to hold the data.
**/
return_status
spdm_get_encap_request_key_update(spdm_context_t *spdm_context,
spdm_get_encap_request_key_update(libspdm_context_t *spdm_context,
uintn *encap_request_size,
void *encap_request);

Expand All @@ -593,7 +593,7 @@ spdm_get_encap_request_key_update(spdm_context_t *spdm_context,
* @retval RETURN_SECURITY_VIOLATION Any verification fails.
**/
return_status spdm_process_encap_response_key_update(
spdm_context_t *spdm_context, uintn encap_response_size,
libspdm_context_t *spdm_context, uintn encap_response_size,
const void *encap_response, bool *need_continue);

/**
Expand All @@ -612,15 +612,15 @@ spdm_get_response_func_via_request_code(uint8_t request_code);
* @param spdm_context A pointer to the SPDM context.
* @param mut_auth_requested Indicate of the mut_auth_requested through KEY_EXCHANGE response.
**/
void spdm_init_mut_auth_encap_state(spdm_context_t *spdm_context,
void spdm_init_mut_auth_encap_state(libspdm_context_t *spdm_context,
uint8_t mut_auth_requested);

/**
* This function initializes the basic_mut_auth encapsulated state.
*
* @param spdm_context A pointer to the SPDM context.
**/
void spdm_init_basic_mut_auth_encap_state(spdm_context_t *spdm_context);
void spdm_init_basic_mut_auth_encap_state(libspdm_context_t *spdm_context);

/**
* This function handles the encap error response.
Expand All @@ -631,7 +631,7 @@ void spdm_init_basic_mut_auth_encap_state(spdm_context_t *spdm_context);
* @retval RETURN_DEVICE_ERROR A device error occurs when communicates with the device.
**/
return_status spdm_handle_encap_error_response_main(
spdm_context_t *spdm_context, uint8_t error_code);
libspdm_context_t *spdm_context, uint8_t error_code);

/**
* Set session_state to an SPDM secured message context and trigger callback.
Expand All @@ -640,7 +640,7 @@ return_status spdm_handle_encap_error_response_main(
* @param session_id Indicate the SPDM session ID.
* @param session_state Indicate the SPDM session state.
*/
void spdm_set_session_state(spdm_context_t *spdm_context,
void spdm_set_session_state(libspdm_context_t *spdm_context,
uint32_t session_id,
libspdm_session_state_t session_state);

Expand All @@ -650,7 +650,7 @@ void spdm_set_session_state(spdm_context_t *spdm_context,
* @param spdm_context A pointer to the SPDM context.
* @param connection_state Indicate the SPDM connection state.
*/
void spdm_set_connection_state(spdm_context_t *spdm_context,
void spdm_set_connection_state(libspdm_context_t *spdm_context,
libspdm_connection_state_t connection_state);

#endif
Loading

0 comments on commit 2a5fdc0

Please sign in to comment.