@@ -800,6 +800,15 @@ qgs_msg_error_t qgs_msg_inflate_get_collateral_resp(
800
800
return ret;
801
801
}
802
802
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
+ */
803
812
uint32_t qgs_msg_get_type (const uint8_t *p_serialized_msg, uint32_t size, uint32_t *p_type) {
804
813
qgs_msg_error_t ret = QGS_MSG_SUCCESS;
805
814
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
823
832
return ret;
824
833
}
825
834
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
+ */
826
850
qgs_msg_error_t qgs_msg_gen_get_platform_info_req (
827
851
uint8_t **pp_req, uint32_t *p_req_size)
828
852
{
@@ -854,6 +878,14 @@ qgs_msg_error_t qgs_msg_gen_get_platform_info_req(
854
878
return ret;
855
879
}
856
880
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
+ */
857
889
qgs_msg_error_t qgs_msg_inflate_get_platform_info_req (
858
890
const uint8_t *p_serialized_req, uint32_t size)
859
891
{
@@ -897,6 +929,22 @@ qgs_msg_error_t qgs_msg_inflate_get_platform_info_req(
897
929
return ret;
898
930
}
899
931
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
+ */
900
948
qgs_msg_error_t qgs_msg_gen_get_platform_info_resp (
901
949
uint16_t tdqe_isvsvn, uint16_t pce_isvsvn,
902
950
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(
964
1012
return ret;
965
1013
}
966
1014
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
+ */
967
1028
qgs_msg_error_t qgs_msg_inflate_get_platform_info_resp (
968
1029
const uint8_t *p_serialized_resp, uint32_t size,
969
1030
uint16_t *p_tdqe_isvsvn, uint16_t *p_pce_isvsvn,
0 commit comments