66
77#include "internal/libspdm_common_lib.h"
88
9- /**
10- * Map slot ID to key pair ID.
11- *
12- * @param spdm_context A pointer to the SPDM context.
13- * @param slot_id The slot ID.
14- * @param is_requester Indicate of the key generation for a requester or a responder.
15- *
16- * @return key pair ID.
17- */
189uint8_t libspdm_slot_id_to_key_pair_id (
1910 void * spdm_context ,
2011 uint8_t slot_id ,
@@ -73,16 +64,6 @@ void libspdm_get_peer_cert_chain_data(void *spdm_context,
7364}
7465#endif /* LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT */
7566
76- /**
77- * This function returns local used certificate chain buffer including spdm_cert_chain_t header.
78- *
79- * @param spdm_context A pointer to the SPDM context.
80- * @param cert_chain_buffer Certificate chain buffer including spdm_cert_chain_t header.
81- * @param cert_chain_buffer_size size in bytes of the certificate chain buffer.
82- *
83- * @retval true Local used certificate chain buffer including spdm_cert_chain_t header is returned.
84- * @retval false Local used certificate chain buffer including spdm_cert_chain_t header is not found.
85- **/
8667void libspdm_get_local_cert_chain_buffer (void * spdm_context ,
8768 uint8_t slot_id ,
8869 const void * * cert_chain_buffer ,
@@ -99,16 +80,6 @@ void libspdm_get_local_cert_chain_buffer(void *spdm_context,
9980 * cert_chain_buffer_size = context -> local_context .local_cert_chain_provision_size [slot_id ];
10081}
10182
102- /**
103- * This function returns local used certificate chain data without spdm_cert_chain_t header.
104- *
105- * @param spdm_context A pointer to the SPDM context.
106- * @param cert_chain_data Certificate chain data without spdm_cert_chain_t header.
107- * @param cert_chain_data_size size in bytes of the certificate chain data.
108- *
109- * @retval true Local used certificate chain data without spdm_cert_chain_t header is returned.
110- * @retval false Local used certificate chain data without spdm_cert_chain_t header is not found.
111- **/
11283bool libspdm_get_local_cert_chain_data (void * spdm_context ,
11384 uint8_t slot_id ,
11485 const void * * cert_chain_data ,
@@ -129,16 +100,6 @@ bool libspdm_get_local_cert_chain_data(void *spdm_context,
129100 return true;
130101}
131102
132- /**
133- * This function returns peer public key buffer.
134- *
135- * @param spdm_context A pointer to the SPDM context.
136- * @param peer_public_key_buffer Peer public key buffer.
137- * @param peer_public_key_buffer_size Size in bytes of peer public key buffer.
138- *
139- * @retval true Peer public key buffer is returned.
140- * @retval false Peer public key buffer is not found.
141- **/
142103bool libspdm_get_peer_public_key_buffer (void * spdm_context ,
143104 const void * * peer_public_key_buffer ,
144105 size_t * peer_public_key_buffer_size )
@@ -154,16 +115,6 @@ bool libspdm_get_peer_public_key_buffer(void *spdm_context,
154115 return false;
155116}
156117
157- /**
158- * This function returns local public key buffer.
159- *
160- * @param spdm_context A pointer to the SPDM context.
161- * @param local_public_key_buffer Local public key buffer.
162- * @param local_public_key_buffer_size Size in bytes of local public key buffer.
163- *
164- * @retval true Local public key buffer is returned.
165- * @retval false Local public key buffer is not found.
166- **/
167118bool libspdm_get_local_public_key_buffer (void * spdm_context ,
168119 const void * * local_public_key_buffer ,
169120 size_t * local_public_key_buffer_size )
@@ -634,16 +585,6 @@ static bool libspdm_calculate_il1il2_hash(libspdm_context_t *spdm_context,
634585}
635586#endif /* LIBSPDM_RECORD_TRANSCRIPT_DATA_SUPPORT */
636587
637- /**
638- * This function generates the certificate chain hash.
639- *
640- * @param spdm_context A pointer to the SPDM context.
641- * @param slot_id The slot index of the certificate chain.
642- * @param signature The buffer to store the certificate chain hash.
643- *
644- * @retval true certificate chain hash is generated.
645- * @retval false certificate chain hash is not generated.
646- **/
647588bool libspdm_generate_cert_chain_hash (libspdm_context_t * spdm_context ,
648589 size_t slot_id , uint8_t * hash )
649590{
@@ -654,15 +595,6 @@ bool libspdm_generate_cert_chain_hash(libspdm_context_t *spdm_context,
654595 spdm_context -> local_context .local_cert_chain_provision_size [slot_id ], hash );
655596}
656597
657- /**
658- * This function generates the public key hash.
659- *
660- * @param spdm_context A pointer to the SPDM context.
661- * @param hash The buffer to store the public key hash.
662- *
663- * @retval true public key hash is generated.
664- * @retval false public key hash is not generated.
665- **/
666598bool libspdm_generate_public_key_hash (libspdm_context_t * spdm_context ,
667599 uint8_t * hash )
668600{
@@ -672,13 +604,6 @@ bool libspdm_generate_public_key_hash(libspdm_context_t *spdm_context,
672604 spdm_context -> local_context .local_public_key_provision_size , hash );
673605}
674606
675- /**
676- * Get the certificate slot mask
677- *
678- * @param[in] context A pointer to the SPDM context.
679- *
680- * @retval slot_mask get slot mask
681- **/
682607uint8_t libspdm_get_cert_slot_mask (libspdm_context_t * spdm_context )
683608{
684609 size_t index ;
@@ -694,13 +619,6 @@ uint8_t libspdm_get_cert_slot_mask(libspdm_context_t *spdm_context)
694619 return slot_mask ;
695620}
696621
697- /**
698- * Get the certificate slot count
699- *
700- * @param[in] context A pointer to the SPDM context.
701- *
702- * @retval slot_count get slot count
703- **/
704622uint8_t libspdm_get_cert_slot_count (libspdm_context_t * spdm_context )
705623{
706624 size_t index ;
@@ -717,17 +635,6 @@ uint8_t libspdm_get_cert_slot_count(libspdm_context_t *spdm_context)
717635}
718636
719637#if LIBSPDM_CERT_PARSE_SUPPORT
720- /**
721- * This function verifies the integrity of peer certificate chain buffer including
722- * spdm_cert_chain_t header.
723- *
724- * @param spdm_context A pointer to the SPDM context.
725- * @param cert_chain_buffer Certificate chain buffer including spdm_cert_chain_t header.
726- * @param cert_chain_buffer_size size in bytes of the certificate chain buffer.
727- *
728- * @retval true Peer certificate chain buffer integrity verification passed.
729- * @retval false Peer certificate chain buffer integrity verification failed.
730- **/
731638bool libspdm_verify_peer_cert_chain_buffer_integrity (libspdm_context_t * spdm_context ,
732639 const void * cert_chain_buffer ,
733640 size_t cert_chain_buffer_size )
@@ -768,19 +675,6 @@ bool libspdm_verify_peer_cert_chain_buffer_integrity(libspdm_context_t *spdm_con
768675 return result ;
769676}
770677
771- /**
772- * This function verifies peer certificate chain authority.
773- *
774- * @param spdm_context A pointer to the SPDM context.
775- * @param cert_chain_buffer Certificate chain buffer including spdm_cert_chain_t header.
776- * @param cert_chain_buffer_size size in bytes of the certificate chain buffer.
777- * @param trust_anchor A buffer to hold the trust_anchor which is used to validate the peer certificate, if not NULL.
778- * @param trust_anchor_size A buffer to hold the trust_anchor_size, if not NULL.
779- *
780- * @retval true Peer certificate chain buffer authority verification passed.
781- * Or there is no root_cert in local_context.
782- * @retval false Peer certificate chain buffer authority verification failed.
783- **/
784678bool libspdm_verify_peer_cert_chain_buffer_authority (libspdm_context_t * spdm_context ,
785679 const void * cert_chain_buffer ,
786680 size_t cert_chain_buffer_size ,
@@ -881,16 +775,6 @@ bool libspdm_verify_peer_cert_chain_buffer_authority(libspdm_context_t *spdm_con
881775}
882776#endif
883777
884- /**
885- * This function generates the challenge signature based upon m1m2 for authentication.
886- *
887- * @param spdm_context A pointer to the SPDM context.
888- * @param is_requester Indicate of the signature generation for a requester or a responder.
889- * @param signature The buffer to store the challenge signature.
890- *
891- * @retval true challenge signature is generated.
892- * @retval false challenge signature is not generated.
893- **/
894778bool libspdm_generate_challenge_auth_signature (libspdm_context_t * spdm_context ,
895779 bool is_requester ,
896780 uint8_t slot_id ,
@@ -995,16 +879,6 @@ bool libspdm_generate_challenge_auth_signature(libspdm_context_t *spdm_context,
995879 return result ;
996880}
997881
998- /**
999- * This function verifies the certificate chain hash.
1000- *
1001- * @param spdm_context A pointer to the SPDM context.
1002- * @param certificate_chain_hash The certificate chain hash data buffer.
1003- * @param certificate_chain_hash_size size in bytes of the certificate chain hash data buffer.
1004- *
1005- * @retval true hash verification pass.
1006- * @retval false hash verification fail.
1007- **/
1008882bool libspdm_verify_certificate_chain_hash (libspdm_context_t * spdm_context ,
1009883 uint8_t slot_id ,
1010884 const void * certificate_chain_hash ,
@@ -1063,16 +937,6 @@ bool libspdm_verify_certificate_chain_hash(libspdm_context_t *spdm_context,
1063937 return true;
1064938}
1065939
1066- /**
1067- * This function verifies the public key hash.
1068- *
1069- * @param spdm_context A pointer to the SPDM context.
1070- * @param public_key_hash The public key hash data buffer.
1071- * @param public_key_hash_size size in bytes of the public key hash data buffer.
1072- *
1073- * @retval true hash verification pass.
1074- * @retval false hash verification fail.
1075- **/
1076940bool libspdm_verify_public_key_hash (libspdm_context_t * spdm_context ,
1077941 const void * public_key_hash ,
1078942 size_t public_key_hash_size )
@@ -1107,17 +971,6 @@ bool libspdm_verify_public_key_hash(libspdm_context_t *spdm_context,
1107971 return true;
1108972}
1109973
1110- /**
1111- * This function verifies the challenge signature based upon m1m2.
1112- *
1113- * @param spdm_context A pointer to the SPDM context.
1114- * @param is_requester Indicate of the signature verification for a requester or a responder.
1115- * @param sign_data The signature data buffer.
1116- * @param sign_data_size size in bytes of the signature data buffer.
1117- *
1118- * @retval true signature verification pass.
1119- * @retval false signature verification fail.
1120- **/
1121974bool libspdm_verify_challenge_auth_signature (libspdm_context_t * spdm_context ,
1122975 bool is_requester ,
1123976 uint8_t slot_id ,
@@ -1333,16 +1186,6 @@ bool libspdm_verify_challenge_auth_signature(libspdm_context_t *spdm_context,
13331186 return true;
13341187}
13351188
1336- /**
1337- * This function calculate the measurement summary hash size.
1338- *
1339- * @param spdm_context A pointer to the SPDM context.
1340- * @param is_requester Is the function called from a requester.
1341- * @param measurement_summary_hash_type The type of the measurement summary hash.
1342- *
1343- * @return 0 measurement summary hash type is invalid, NO_MEAS hash type or no MEAS capabilities.
1344- * @return measurement summary hash size according to type.
1345- **/
13461189uint32_t
13471190libspdm_get_measurement_summary_hash_size (libspdm_context_t * spdm_context ,
13481191 bool is_requester ,
@@ -1370,17 +1213,6 @@ libspdm_get_measurement_summary_hash_size(libspdm_context_t *spdm_context,
13701213}
13711214
13721215#if LIBSPDM_ENABLE_CAPABILITY_ENDPOINT_INFO_CAP
1373- /**
1374- * This function generates the endpoint info signature based upon il1il2 for authentication.
1375- *
1376- * @param spdm_context A pointer to the SPDM context.
1377- * @param session_info A pointer to the SPDM session context.
1378- * @param is_requester Indicate of the signature generation for a requester or a responder.
1379- * @param signature The buffer to store the endpoint info signature.
1380- *
1381- * @retval true challenge signature is generated.
1382- * @retval false challenge signature is not generated.
1383- **/
13841216bool libspdm_generate_endpoint_info_signature (libspdm_context_t * spdm_context ,
13851217 libspdm_session_info_t * session_info ,
13861218 bool is_requester ,
@@ -1482,18 +1314,6 @@ bool libspdm_generate_endpoint_info_signature(libspdm_context_t *spdm_context,
14821314}
14831315#endif /* LIBSPDM_ENABLE_CAPABILITY_ENDPOINT_INFO_CAP */
14841316
1485- /**
1486- * This function verifies the endpoint info signature based upon il1il2.
1487- *
1488- * @param spdm_context A pointer to the SPDM context.
1489- * @param session_info A pointer to the SPDM session context.
1490- * @param is_requester Indicate of the signature verification for a requester or a responder.
1491- * @param sign_data The signature data buffer.
1492- * @param sign_data_size size in bytes of the signature data buffer.
1493- *
1494- * @retval true signature verification pass.
1495- * @retval false signature verification fail.
1496- **/
14971317bool libspdm_verify_endpoint_info_signature (libspdm_context_t * spdm_context ,
14981318 libspdm_session_info_t * session_info ,
14991319 bool is_requester ,
0 commit comments