Skip to content

Commit 77b3476

Browse files
committed
Added some function header document for new interface
Signed-off-by: Qiu Feng <feng.qiu@intel.com>
1 parent fee1b95 commit 77b3476

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

QuoteGeneration/quote_wrapper/qgs_msg_lib/qgs_msg_lib.cpp

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,15 @@ qgs_msg_error_t qgs_msg_inflate_get_collateral_resp(
800800
return ret;
801801
}
802802

803+
/**
804+
* @brief Get the message type from the serialized message buffer.
805+
*
806+
* @param p_serialized_msg Pointer to the serialized message buffer.
807+
* @param size Size of the serialized message buffer.
808+
* @param p_type Pointer to a uint32_t variable to store the message type.
809+
*
810+
* @return qgs_msg_error_t The error code, QGS_MSG_SUCCESS on success.
811+
*/
803812
uint32_t qgs_msg_get_type(const uint8_t *p_serialized_msg, uint32_t size, uint32_t *p_type) {
804813
qgs_msg_error_t ret = QGS_MSG_SUCCESS;
805814
const qgs_msg_header_t *p_header = (const qgs_msg_header_t *)p_serialized_msg;
@@ -823,6 +832,21 @@ uint32_t qgs_msg_get_type(const uint8_t *p_serialized_msg, uint32_t size, uint32
823832
return ret;
824833
}
825834

835+
/**
836+
* @brief Generates a GET_PLATFORM_INFO request message
837+
*
838+
* This function generates a GET_PLATFORM_INFO request message and returns it
839+
* as a byte array.
840+
*
841+
* @param pp_req A pointer to a pointer to the generated request message byte
842+
* array. The caller is responsible for freeing this memory after
843+
* use.
844+
* @param p_req_size A pointer to the size of the generated request message in
845+
* bytes. Upon successful execution, the function updates this
846+
* value to reflect the size of the generated message.
847+
*
848+
* @return qgs_msg_error_t The error code, QGS_MSG_SUCCESS on success.
849+
*/
826850
qgs_msg_error_t qgs_msg_gen_get_platform_info_req(
827851
uint8_t **pp_req, uint32_t *p_req_size)
828852
{
@@ -854,6 +878,14 @@ qgs_msg_error_t qgs_msg_gen_get_platform_info_req(
854878
return ret;
855879
}
856880

881+
/**
882+
* @brief Inflate a serialized GET_PLATFORM_INFO_REQ message and validate it.
883+
*
884+
* @param p_serialized_req A pointer to the serialized GET_PLATFORM_INFO_REQ
885+
* message.
886+
* @param size The size of the serialized message in bytes.
887+
* @return qgs_msg_error_t The error code, QGS_MSG_SUCCESS on success.
888+
*/
857889
qgs_msg_error_t qgs_msg_inflate_get_platform_info_req(
858890
const uint8_t *p_serialized_req, uint32_t size)
859891
{
@@ -897,6 +929,22 @@ qgs_msg_error_t qgs_msg_inflate_get_platform_info_req(
897929
return ret;
898930
}
899931

932+
/**
933+
* @brief Generates a response message with the given information about the platform.
934+
*
935+
* @param tdqe_isvsvn ISVSVN of the TDQE enclave in the platform.
936+
* @param pce_isvsvn ISVSVN of the PCE enclave in the platform.
937+
* @param p_platform_id Pointer to an array of bytes that contains the platform
938+
* identification.
939+
* @param platform_id_size The size in bytes of the platform identification.
940+
* @param p_cpusvn Pointer to an array of bytes that contains the CPUSVN.
941+
* @param cpusvn_size The size in bytes of the CPUSVN.
942+
* @param pp_resp Pointer to a pointer to the response message buffer.
943+
The caller is responsible for freeing this memory after use.
944+
* @param p_resp_size Pointer to the size of the response message buffer.
945+
*
946+
* @return qgs_msg_error_t The error code, QGS_MSG_SUCCESS on success.
947+
*/
900948
qgs_msg_error_t qgs_msg_gen_get_platform_info_resp(
901949
uint16_t tdqe_isvsvn, uint16_t pce_isvsvn,
902950
const uint8_t *p_platform_id, uint32_t platform_id_size,
@@ -964,6 +1012,19 @@ qgs_msg_error_t qgs_msg_gen_get_platform_info_resp(
9641012
return ret;
9651013
}
9661014

1015+
/**
1016+
* @brief Extracts platform information from a serialized response message.
1017+
*
1018+
* @param p_serialized_resp Pointer to the serialized response message.
1019+
* @param size The size of the serialized response message.
1020+
* @param p_tdqe_isvsvn Pointer to the TDQE ISVSVN.
1021+
* @param p_pce_isvsvn Pointer to the PCE ISVSVN.
1022+
* @param pp_platform_id Pointer to a pointer to the platform ID.
1023+
* @param p_platform_id_size Pointer to the size of the platform ID.
1024+
* @param pp_cpusvn Pointer to a pointer to the CPUSVN.
1025+
* @param p_cpusvn_size Pointer to the size of the CPUSVN.
1026+
* @return qgs_msg_error_t The error code, QGS_MSG_SUCCESS on success.
1027+
*/
9671028
qgs_msg_error_t qgs_msg_inflate_get_platform_info_resp(
9681029
const uint8_t *p_serialized_resp, uint32_t size,
9691030
uint16_t *p_tdqe_isvsvn, uint16_t *p_pce_isvsvn,

0 commit comments

Comments
 (0)