8#ifndef __LIBSPDM_STUB_H__
9#define __LIBSPDM_STUB_H__
11#include <library/spdm_common_lib.h>
12#include <library/spdm_return_status.h>
13#include <library/spdm_crypt_lib.h>
14#include <library/spdm_requester_lib.h>
15#include <library/spdm_responder_lib.h>
16#include <library/spdm_transport_pcidoe_lib.h>
26typedef UINT32 SPDM_RETURN;
32 UINT8 RequestResponseCode;
67 UINT8 MeasurementSpecification;
68 UINT16 MeasurementSize;
74 UINT8 DMTFSpecMeasurementValueType;
75 UINT16 DMTFSpecMeasurementValueSize;
85#define SPDM_DATA_PARAMETER libspdm_data_parameter_t
92 SpdmDataSecuredMessageVersion,
96 SpdmDataCapabilityFlags,
97 SpdmDataCapabilityCTExponent,
98 SpdmDataCapabilityRttUs,
99 SpdmDataCapabilityDataTransferSize,
100 SpdmDataCapabilityMaxSpdmMsgSize,
101 SpdmDataCapabilitySenderDataTransferSize,
106 SpdmDataMeasurementSpec,
107 SpdmDataMeasurementHashAlgo,
108 SpdmDataBaseAsymAlgo,
109 SpdmDataBaseHashAlgo,
110 SpdmDataDHENameGroup,
111 SpdmDataAEADCipherSuite,
112 SpdmDataReqBaseAsymAlg,
114 SpdmDataOtherParamsSupport,
120 SpdmDataConnectionState,
124 SpdmDataResponseState,
128 SpdmDataLocalPublicCertChain,
129 SpdmDataPeerPublicRootCert,
130 SpdmDataPeerPublicKey,
131 SpdmDataLocalPublicKey,
132 SpdmDataLocalSupportedSlotMask,
133 SpdmDataLocalKeyPairId,
134 SpdmDataLocalCertInfo,
135 SpdmDataLocalKeyUsageBitMask,
137 SpdmDataBasicMutAuthRequested,
138 SpdmDataMutAuthRequested,
139 SpdmDataHeartBeatPeriod,
143 SpdmDataPeerUsedCertChainBuffer,
144 SpdmDataPeerSlotMask,
145 SpdmDataPeerProvisionedSlotMask = SpdmDataPeerSlotMask,
146 SpdmDataPeerSupportedSlotMask,
147 SpdmDataPeerTotalDigestBuffer,
148 SpdmDataPeerKeyPairId,
149 SpdmDataPeerCertInfo,
150 SpdmDataPeerKeyUsageBitMask,
161 SpdmDataSessionUsePsk,
162 SpdmDataSessionMutAuthRequested,
163 SpdmDataSessionEndSessionAttributes,
164 SpdmDataSessionPolicy,
166 SpdmDataAppContextData,
168 SpdmDataHandleErrorReturnPolicy,
181 SpdmDataRequestRetryTimes,
187 SpdmDataRequestRetryDelayTime,
190 SpdmDataMaxDheSessionConut,
191 SpdmDataMaxPskSessionConut,
193 SpdmDataSessionSequenceNumberRspDir,
194 SpdmDataSessionSequenceNumberReqDir,
195 SpdmDataMaxSessionSequenceNumber,
198 SpdmDataSpdmVersion1011VerifySigatureEndian,
200 SpdmDataSequenceNumberEndian,
201 SpdmDataSessionSequenceNumberEndian,
203 SpdmDataMultiKeyConnReq,
204 SpdmDataMultiKeyConnRsp,
212 SpdmDataLocationLocal,
213 SpdmDataLocationConnection,
214 SpdmDataLocationSession,
222 SpdmConnectionStateNotStarted,
226 SpdmConnectionStateAfterVersion,
230 SpdmConnectionStateAfterCapabilities,
234 SpdmConnectionStateNegotiated,
238 SpdmConnectionStateAfterDigests,
242 SpdmConnectionStateAfterCertificate,
246 SpdmConnectionStateAuthenticated,
250 SpdmConnectionStateMax,
251} SPDM_CONNECTION_STATE;
257 SpdmResponseStateNormal,
261 SpdmResponseStateBusy,
262 #if LIBSPDM_RESPOND_IF_READY_SUPPORT
266 SpdmResponseStateNotReady,
271 SpdmResponseStateNeedResync,
275 SpdmResponseStateProcessingEncap,
279 SpdmResponseStateMax,
280} SPDM_RESPONSE_STATE;
286 UINT8 DataObjectType;
299#define SpdmSetData libspdm_set_data
300#define SpdmGetData libspdm_get_data
301#define SpdmInitContext libspdm_init_context
302#define SpdmGetContextSize libspdm_get_context_size
303#define SpdmRegisterDeviceIoFunc libspdm_register_device_io_func
304#define SpdmRegisterTransportLayerFunc libspdm_register_transport_layer_func
305#define SpdmGetSizeofRequiredScratchBuffer libspdm_get_sizeof_required_scratch_buffer
306#define SpdmRegisterDeviceBufferFunc libspdm_register_device_buffer_func
307#define SpdmSetScratchBuffer libspdm_set_scratch_buffer
309#define SpdmGetHashSize libspdm_get_hash_size
310#define SpdmHashAll libspdm_hash_all
311#define SpdmGetMeasurementHashSize libspdm_get_measurement_hash_size
312#define SpdmMeasurementHashAll libspdm_measurement_hash_all
313#define SpdmHmacAll libspdm_hmac_all
314#define SpdmHkdfExpand libspdm_hkdf_expand
315#define SpdmAsymFree libspdm_asym_free
316#define SpdmAsymGetPrivateKeyFromPem libspdm_asym_get_private_key_from_pem
317#define SpdmAsymSign libspdm_asym_sign
318#define SpdmAsymSignHash libspdm_asym_sign_hash
320#define SpdmInitConnection libspdm_init_connection
321#define SpdmGetDigest libspdm_get_digest
322#define SpdmGetCertificate libspdm_get_certificate
323#define SpdmGetCertificateEx libspdm_get_certificate_ex
324#define SpdmChallenge libspdm_challenge
325#define SpdmChallengeEx libspdm_challenge_ex
326#define SpdmGetMeasurement libspdm_get_measurement
327#define SpdmGetMeasurementEx libspdm_get_measurement_ex
328#define SpdmStartSession libspdm_start_session
329#define SpdmStopSession libspdm_stop_session
330#define SpdmSendReceiveData libspdm_send_receive_data
331#define SpdmRegisterGetResponseFunc libspdm_register_get_response_func
332#define SpdmProcessRequest libspdm_process_request
333#define SpdmBuildResponse libspdm_build_response
334#define SpdmGenerateErrorResponse libspdm_generate_error_response
335#define SpdmTransportPciDoeEncodeMessage libspdm_transport_pci_doe_encode_message
336#define SpdmTransportPciDoeDecodeMessage libspdm_transport_pci_doe_decode_message
338#define SpdmMeasurementCollectionFunc libspdm_measurement_collection
339#define SpdmRequesterDataSignFunc libspdm_requester_data_sign
340#define SpdmResponderDataSignFunc libspdm_responder_data_sign
341#define SpdmGenerateMeasurementSummaryHash libspdm_generate_measurement_summary_hash
342#define SpdmPskMasterSecretHkdfExpandFunc libspdm_psk_master_secret_hkdf_expand
343#define SpdmPskHandshakeSecretHkdfExpandFunc libspdm_psk_handshake_secret_hkdf_expand
344#define SpdmMeasurementOpaqueData libspdm_measurement_opaque_data
345#define SpdmChallengeOpaqueData libspdm_challenge_opaque_data
UINT16 SPDM_VERSION_NUMBER