15#define SPDM_MAX_SLOT_COUNT 8
16#define SPDM_MAX_OPAQUE_DATA_SIZE 1024
17#define SPDM_NONCE_SIZE 32
18#define SPDM_RANDOM_DATA_SIZE 32
22#define SPDM_DIGESTS 0x01
23#define SPDM_CERTIFICATE 0x02
24#define SPDM_CHALLENGE_AUTH 0x03
25#define SPDM_VERSION 0x04
26#define SPDM_MEASUREMENTS 0x60
27#define SPDM_CAPABILITIES 0x61
28#define SPDM_ALGORITHMS 0x63
29#define SPDM_VENDOR_DEFINED_RESPONSE 0x7E
30#define SPDM_ERROR 0x7F
34#define SPDM_KEY_EXCHANGE_RSP 0x64
35#define SPDM_FINISH_RSP 0x65
36#define SPDM_PSK_EXCHANGE_RSP 0x66
37#define SPDM_PSK_FINISH_RSP 0x67
38#define SPDM_HEARTBEAT_ACK 0x68
39#define SPDM_KEY_UPDATE_ACK 0x69
40#define SPDM_ENCAPSULATED_REQUEST 0x6A
41#define SPDM_ENCAPSULATED_RESPONSE_ACK 0x6B
42#define SPDM_END_SESSION_ACK 0x6C
47#define SPDM_SET_CERTIFICATE_RSP 0x6E
48#define SPDM_CHUNK_SEND_ACK 0x05
49#define SPDM_CHUNK_RESPONSE 0x06
53#define SPDM_GET_DIGESTS 0x81
54#define SPDM_GET_CERTIFICATE 0x82
55#define SPDM_CHALLENGE 0x83
56#define SPDM_GET_VERSION 0x84
57#define SPDM_GET_MEASUREMENTS 0xE0
58#define SPDM_GET_CAPABILITIES 0xE1
59#define SPDM_NEGOTIATE_ALGORITHMS 0xE3
60#define SPDM_VENDOR_DEFINED_REQUEST 0xFE
61#define SPDM_RESPOND_IF_READY 0xFF
65#define SPDM_KEY_EXCHANGE 0xE4
66#define SPDM_FINISH 0xE5
67#define SPDM_PSK_EXCHANGE 0xE6
68#define SPDM_PSK_FINISH 0xE7
69#define SPDM_HEARTBEAT 0xE8
70#define SPDM_KEY_UPDATE 0xE9
71#define SPDM_GET_ENCAPSULATED_REQUEST 0xEA
72#define SPDM_DELIVER_ENCAPSULATED_RESPONSE 0xEB
73#define SPDM_END_SESSION 0xEC
77#define SPDM_GET_CSR 0xED
78#define SPDM_SET_CERTIFICATE 0xEE
79#define SPDM_CHUNK_SEND 0x85
80#define SPDM_CHUNK_GET 0x86
87 UINT8 RequestResponseCode;
92#define SPDM_MESSAGE_VERSION_10 0x10
93#define SPDM_MESSAGE_VERSION_11 0x11
94#define SPDM_MESSAGE_VERSION_12 0x12
95#define SPDM_MESSAGE_VERSION SPDM_MESSAGE_VERSION_10
114 UINT8 VersionNumberEntryCount;
126#define SPDM_VERSION_NUMBER_SHIFT_BIT 8
128#define SPDM_VERSION_1_2_SIGNING_PREFIX_CONTEXT "dmtf-spdm-v1.2.*"
129#define SPDM_VERSION_1_2_SIGNING_PREFIX_CONTEXT_SIZE \
130 (sizeof(SPDM_VERSION_1_2_SIGNING_PREFIX_CONTEXT) - 1)
131#define SPDM_VERSION_1_2_SIGNING_CONTEXT_SIZE 100
145 UINT32 DataTransferSize;
146 UINT32 MaxSpdmMsgSize;
161 UINT32 DataTransferSize;
162 UINT32 MaxSpdmMsgSize;
165#define SPDM_MIN_DATA_TRANSFER_SIZE_VERSION_12 42
170#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_CERT_CAP BIT1
171#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_CHAL_CAP BIT2
172#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_ENCRYPT_CAP BIT6
173#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_MAC_CAP BIT7
174#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_MUT_AUTH_CAP BIT8
175#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_KEY_EX_CAP BIT9
176#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_PSK_CAP (BIT10 | BIT11)
177#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_PSK_CAP_REQUESTER BIT10
178#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_ENCAP_CAP BIT12
179#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_HBEAT_CAP BIT13
180#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_KEY_UPD_CAP BIT14
181#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_HANDSHAKE_IN_THE_CLEAR_CAP BIT15
182#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_PUB_KEY_ID_CAP BIT16
183#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_11_MASK (\
184 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_CERT_CAP | \
185 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_CHAL_CAP | \
186 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_ENCRYPT_CAP | \
187 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_MAC_CAP | \
188 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_MUT_AUTH_CAP | \
189 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_KEY_EX_CAP | \
190 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_PSK_CAP | \
191 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_ENCAP_CAP | \
192 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_HBEAT_CAP | \
193 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_KEY_UPD_CAP | \
194 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_HANDSHAKE_IN_THE_CLEAR_CAP | \
195 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_PUB_KEY_ID_CAP)
200#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_CHUNK_CAP BIT17
201#define SPDM_GET_CAPABILITIES_REQUEST_FLAGS_12_MASK (\
202 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_11_MASK | \
203 SPDM_GET_CAPABILITIES_REQUEST_FLAGS_CHUNK_CAP)
207#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CACHE_CAP BIT0
208#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CERT_CAP BIT1
209#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CHAL_CAP BIT2
210#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MEAS_CAP (BIT3 | BIT4)
211#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MEAS_CAP_NO_SIG BIT3
212#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MEAS_CAP_SIG BIT4
213#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MEAS_FRESH_CAP BIT5
214#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_10_MASK (\
215 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CACHE_CAP | \
216 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CERT_CAP | \
217 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CHAL_CAP | \
218 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MEAS_CAP | \
219 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MEAS_FRESH_CAP)
223#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_ENCRYPT_CAP BIT6
224#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MAC_CAP BIT7
225#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MUT_AUTH_CAP BIT8
226#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_KEY_EX_CAP BIT9
227#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_PSK_CAP (BIT10 | BIT11)
228#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_PSK_CAP_RESPONDER BIT10
229#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_PSK_CAP_RESPONDER_WITH_CONTEXT BIT11
230#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_ENCAP_CAP BIT12
231#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_HBEAT_CAP BIT13
232#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_KEY_UPD_CAP BIT14
233#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_HANDSHAKE_IN_THE_CLEAR_CAP BIT15
234#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_PUB_KEY_ID_CAP BIT16
235#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_11_MASK (\
236 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_10_MASK | \
237 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_ENCRYPT_CAP | \
238 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MAC_CAP | \
239 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MUT_AUTH_CAP | \
240 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_KEY_EX_CAP | \
241 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_PSK_CAP | \
242 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_ENCAP_CAP | \
243 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_HBEAT_CAP | \
244 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_KEY_UPD_CAP | \
245 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_HANDSHAKE_IN_THE_CLEAR_CAP | \
246 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_PUB_KEY_ID_CAP)
250#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CHUNK_CAP BIT17
251#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_ALIAS_CERT_CAP BIT18
256#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_SET_CERT_CAP BIT19
257#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CSR_CAP BIT20
258#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CERT_INSTALL_RESET_CAP BIT21
259#define SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_12_MASK (\
260 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_11_MASK | \
261 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CHUNK_CAP | \
262 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_ALIAS_CERT_CAP | \
263 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_SET_CERT_CAP | \
264 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CSR_CAP | \
265 SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_CERT_INSTALL_RESET_CAP)
274 UINT8 MeasurementSpecification;
279 UINT8 OtherParamsSupport;
292#define SPDM_NEGOTIATE_ALGORITHMS_REQUEST_MAX_LENGTH_VERSION_10 BIT6
293#define SPDM_NEGOTIATE_ALGORITHMS_REQUEST_MAX_LENGTH_VERSION_11 BIT7
294#define SPDM_NEGOTIATE_ALGORITHMS_REQUEST_MAX_LENGTH_VERSION_12 BIT7
295#define SPDM_NEGOTIATE_ALGORITHMS_REQUEST_MAX_EXT_ALG_COUNT_VERSION_10 BIT3
296#define SPDM_NEGOTIATE_ALGORITHMS_REQUEST_MAX_EXT_ALG_COUNT_VERSION_11 (BIT4 | BIT2)
297#define SPDM_NEGOTIATE_ALGORITHMS_REQUEST_MAX_EXT_ALG_COUNT_VERSION_12 (BIT4 | BIT2)
307 UINT8 ExtAlgCount : 4;
308 UINT8 FixedAlgByteCount : 4;
311#define SPDM_NEGOTIATE_ALGORITHMS_MAX_NUM_STRUCT_TABLE_ALG 4
313#define SPDM_NEGOTIATE_ALGORITHMS_STRUCT_TABLE_ALG_TYPE_DHE 2
314#define SPDM_NEGOTIATE_ALGORITHMS_STRUCT_TABLE_ALG_TYPE_AEAD 3
315#define SPDM_NEGOTIATE_ALGORITHMS_STRUCT_TABLE_ALG_TYPE_REQ_BASE_ASYM_ALG 4
316#define SPDM_NEGOTIATE_ALGORITHMS_STRUCT_TABLE_ALG_TYPE_KEY_SCHEDULE 5
327#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_RSASSA_2048 BIT0
328#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_RSAPSS_2048 BIT1
329#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_RSASSA_3072 BIT2
330#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_RSAPSS_3072 BIT3
331#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_ECDSA_ECC_NIST_P256 BIT4
332#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_RSASSA_4096 BIT5
333#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_RSAPSS_4096 BIT6
334#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_ECDSA_ECC_NIST_P384 BIT7
335#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_ECDSA_ECC_NIST_P521 BIT8
340#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_SM2_ECC_SM2_P256 BIT9
341#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_EDDSA_ED25519 BIT10
342#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_EDDSA_ED448 BIT11
347#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_256 BIT0
348#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_384 BIT1
349#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA_512 BIT2
350#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_256 BIT3
351#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_384 BIT4
352#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SHA3_512 BIT5
357#define SPDM_ALGORITHMS_BASE_HASH_ALGO_TPM_ALG_SM3_256 BIT6
362#define SPDM_ALGORITHMS_DHE_NAMED_GROUP_FFDHE_2048 BIT0
363#define SPDM_ALGORITHMS_DHE_NAMED_GROUP_FFDHE_3072 BIT1
364#define SPDM_ALGORITHMS_DHE_NAMED_GROUP_FFDHE_4096 BIT2
365#define SPDM_ALGORITHMS_DHE_NAMED_GROUP_SECP_256_R1 BIT3
366#define SPDM_ALGORITHMS_DHE_NAMED_GROUP_SECP_384_R1 BIT4
367#define SPDM_ALGORITHMS_DHE_NAMED_GROUP_SECP_521_R1 BIT5
372#define SPDM_ALGORITHMS_DHE_NAMED_GROUP_SM2_P256 BIT6
377#define SPDM_ALGORITHMS_AEAD_CIPHER_SUITE_AES_128_GCM BIT0
378#define SPDM_ALGORITHMS_AEAD_CIPHER_SUITE_AES_256_GCM BIT1
379#define SPDM_ALGORITHMS_AEAD_CIPHER_SUITE_CHACHA20_POLY1305 BIT2
384#define SPDM_ALGORITHMS_AEAD_CIPHER_SUITE_AEAD_SM4_GCM BIT3
388#define SPDM_ALGORITHMS_KEY_SCHEDULE_HMAC_HASH BIT0
398 UINT8 MeasurementSpecificationSel;
403 UINT8 OtherParamsSelection;
404 UINT32 MeasurementHashAlgo;
408 UINT8 ExtAsymSelCount;
409 UINT8 ExtHashSelCount;
420#define SPDM_ALGORITHMS_MEASUREMENT_HASH_ALGO_RAW_BIT_STREAM_ONLY BIT0
421#define SPDM_ALGORITHMS_MEASUREMENT_HASH_ALGO_TPM_ALG_SHA_256 BIT1
422#define SPDM_ALGORITHMS_MEASUREMENT_HASH_ALGO_TPM_ALG_SHA_384 BIT2
423#define SPDM_ALGORITHMS_MEASUREMENT_HASH_ALGO_TPM_ALG_SHA_512 BIT3
424#define SPDM_ALGORITHMS_MEASUREMENT_HASH_ALGO_TPM_ALG_SHA3_256 BIT4
425#define SPDM_ALGORITHMS_MEASUREMENT_HASH_ALGO_TPM_ALG_SHA3_384 BIT5
426#define SPDM_ALGORITHMS_MEASUREMENT_HASH_ALGO_TPM_ALG_SHA3_512 BIT6
431#define SPDM_ALGORITHMS_MEASUREMENT_HASH_ALGO_TPM_ALG_SM3_256 BIT7
436#define SPDM_ALGORITHMS_OPAQUE_DATA_FORMAT_NONE 0x0
437#define SPDM_ALGORITHMS_OPAQUE_DATA_FORMAT_0 0x1
438#define SPDM_ALGORITHMS_OPAQUE_DATA_FORMAT_1 0x2
439#define SPDM_ALGORITHMS_OPAQUE_DATA_FORMAT_MASK 0xF
462#define SPDM_REGISTRY_ID_DMTF 0
463#define SPDM_REGISTRY_ID_TCG 1
464#define SPDM_REGISTRY_ID_USB 2
465#define SPDM_REGISTRY_ID_PCISIG 3
466#define SPDM_REGISTRY_ID_IANA 4
467#define SPDM_REGISTRY_ID_HDBASET 5
468#define SPDM_REGISTRY_ID_MIPI 6
469#define SPDM_REGISTRY_ID_CXL 7
470#define SPDM_REGISTRY_ID_JEDEC 8
502#define SPDM_GET_CERTIFICATE_REQUEST_SLOT_ID_MASK 0xF
510 UINT16 PortionLength;
511 UINT16 RemainderLength;
515#define SPDM_CERTIFICATE_RESPONSE_SLOT_ID_MASK 0xF
541#define SPDM_MAX_CERTIFICATE_CHAIN_SIZE 65535
570#define SPDM_REQUEST_NO_MEASUREMENT_SUMMARY_HASH 0
571#define SPDM_REQUEST_TCB_COMPONENT_MEASUREMENT_HASH 1
572#define SPDM_REQUEST_ALL_MEASUREMENTS_HASH 0xFF
577#define SPDM_CHALLENGE_REQUEST_NO_MEASUREMENT_SUMMARY_HASH SPDM_REQUEST_NO_MEASUREMENT_SUMMARY_HASH
578#define SPDM_CHALLENGE_REQUEST_TCB_COMPONENT_MEASUREMENT_HASH \
579 SPDM_REQUEST_TCB_COMPONENT_MEASUREMENT_HASH
580#define SPDM_CHALLENGE_REQUEST_ALL_MEASUREMENTS_HASH SPDM_REQUEST_ALL_MEASUREMENTS_HASH
582#define SPDM_CHALLENGE_AUTH_RESPONSE_ATTRIBUTE_SLOT_ID_MASK 0xF
587 UINT8 BasicMutAuthReq : 1;
593#define SPDM_CHALLENGE_AUTH_RESPONSE_ATTRIBUTE_BASIC_MUT_AUTH_REQ BIT7
595#define SPDM_CHALLENGE_AUTH_SIGN_CONTEXT "responder-challenge_auth signing"
596#define SPDM_CHALLENGE_AUTH_SIGN_CONTEXT_SIZE (sizeof(SPDM_CHALLENGE_AUTH_SIGN_CONTEXT) - 1)
597#define SPDM_MUT_CHALLENGE_AUTH_SIGN_CONTEXT "requester-challenge_auth signing"
598#define SPDM_MUT_CHALLENGE_AUTH_SIGN_CONTEXT_SIZE (sizeof(SPDM_MUT_CHALLENGE_AUTH_SIGN_CONTEXT) - 1)
617#define SPDM_GET_MEASUREMENTS_REQUEST_SLOT_ID_MASK 0xF
622#define SPDM_GET_MEASUREMENTS_REQUEST_ATTRIBUTES_GENERATE_SIGNATURE BIT0
623#define SPDM_GET_MEASUREMENTS_REQUEST_ATTRIBUTES_RAW_BIT_STREAM_REQUESTED BIT1
624#define SPDM_GET_MEASUREMENTS_REQUEST_ATTRIBUTES_NEW_MEASUREMENT_REQUESTED BIT2
629#define SPDM_GET_MEASUREMENTS_REQUEST_MEASUREMENT_OPERATION_TOTAL_NUMBER_OF_MEASUREMENTS 0
634#define SPDM_GET_MEASUREMENTS_REQUEST_MEASUREMENT_OPERATION_ALL_MEASUREMENTS 0xFF
641 UINT8 MeasurementSpecification;
642 UINT16 MeasurementSize;
646#define SPDM_MEASUREMENT_BLOCK_HEADER_SPECIFICATION_DMTF BIT0
652 UINT8 DMTFSpecMeasurementValueType;
653 UINT16 DMTFSpecMeasurementValueSize;
665 UINT8 Presentation : 1;
671#define SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_IMMUTABLE_ROM 0
672#define SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_MUTABLE_FIRMWARE 1
673#define SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_HARDWARE_CONFIGURATION 2
674#define SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_FIRMWARE_CONFIGURATION 3
675#define SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_MEASUREMENT_MANIFEST 4
676#define SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_DEVICE_MODE 5
677#define SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_VERSION 6
678#define SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_SECURE_VERSION_NUMBER 7
679#define SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_MASK 0x7
680#define SPDM_MEASUREMENT_BLOCK_MEASUREMENT_TYPE_RAW_BIT_STREAM BIT7
685#define SPDM_MEASUREMENT_BLOCK_MEASUREMENT_INDEX_MEASUREMENT_MANIFEST 0xFD
686#define SPDM_MEASUREMENT_BLOCK_MEASUREMENT_INDEX_DEVICE_MODE 0xFE
692 UINT32 OperationalModeCapabilities;
693 UINT32 OperationalModeState;
694 UINT32 DeviceModeCapabilities;
695 UINT32 DeviceModeState;
698#define SPDM_MEASUREMENT_DEVICE_OPERATION_MODE_MANUFACTURING_MODE BIT0
699#define SPDM_MEASUREMENT_DEVICE_OPERATION_MODE_VALIDATION_MODE BIT1
700#define SPDM_MEASUREMENT_DEVICE_OPERATION_MODE_NORMAL_MODE BIT2
701#define SPDM_MEASUREMENT_DEVICE_OPERATION_MODE_RECOVERY_MODE BIT3
702#define SPDM_MEASUREMENT_DEVICE_OPERATION_MODE_RMA_MODE BIT4
703#define SPDM_MEASUREMENT_DEVICE_OPERATION_MODE_DECOMMISSIONED_MODE BIT5
705#define SPDM_MEASUREMENT_DEVICE_MODE_NON_INVASIVE_DEBUG_MODE_IS_ACTIVE BIT0
706#define SPDM_MEASUREMENT_DEVICE_MODE_INVASIVE_DEBUG_MODE_IS_ACTIVE BIT1
707#define SPDM_MEASUREMENT_DEVICE_MODE_NON_INVASIVE_DEBUG_MODE_HAS_BEEN_ACTIVE BIT2
708#define SPDM_MEASUREMENT_DEVICE_MODE_INVASIVE_DEBUG_MODE_HAS_BEEN_ACTIVE BIT3
709#define SPDM_MEASUREMENT_DEVICE_MODE_INVASIVE_DEBUG_MODE_HAS_BEEN_ACTIVE_AFTER_MFG BIT4
723 UINT8 NumberOfBlocks;
724 UINT8 MeasurementRecordLength[3];
732#define SPDM_MEASUREMENTS_RESPONSE_SLOT_ID_MASK 0xF
737#define SPDM_MEASUREMENTS_RESPONSE_CONTENT_CHANGE_MASK 0x30
738#define SPDM_MEASUREMENTS_RESPONSE_CONTENT_CHANGE_NO_DETECTION 0x00
739#define SPDM_MEASUREMENTS_RESPONSE_CONTENT_CHANGE_DETECTED 0x10
740#define SPDM_MEASUREMENTS_RESPONSE_CONTENT_NO_CHANGE_DETECTED 0x20
742#define SPDM_MEASUREMENTS_SIGN_CONTEXT "responder-measurements signing"
743#define SPDM_MEASUREMENTS_SIGN_CONTEXT_SIZE (sizeof(SPDM_MEASUREMENTS_SIGN_CONTEXT) - 1)
745#define SPDM_MEL_SPECIFICATION_DMTF BIT0
757#define SPDM_EXTENDED_ERROR_DATA_MAX_SIZE 32
762#define SPDM_ERROR_CODE_INVALID_REQUEST 0x01
763#define SPDM_ERROR_CODE_BUSY 0x03
764#define SPDM_ERROR_CODE_UNEXPECTED_REQUEST 0x04
765#define SPDM_ERROR_CODE_UNSPECIFIED 0x05
766#define SPDM_ERROR_CODE_UNSUPPORTED_REQUEST 0x07
767#define SPDM_ERROR_CODE_VERSION_MISMATCH 0x41
768#define SPDM_ERROR_CODE_RESPONSE_NOT_READY 0x42
769#define SPDM_ERROR_CODE_REQUEST_RESYNCH 0x43
770#define SPDM_ERROR_CODE_VENDOR_DEFINED 0xFF
774#define SPDM_ERROR_CODE_DECRYPT_ERROR 0x06
775#define SPDM_ERROR_CODE_REQUEST_IN_FLIGHT 0x08
776#define SPDM_ERROR_CODE_INVALID_RESPONSE_CODE 0x09
777#define SPDM_ERROR_CODE_SESSION_LIMIT_EXCEEDED 0x0A
782#define SPDM_ERROR_CODE_SESSION_REQUIRED 0x0B
783#define SPDM_ERROR_CODE_RESET_REQUIRED 0x0C
784#define SPDM_ERROR_CODE_RESPONSE_TOO_LARGE 0x0D
785#define SPDM_ERROR_CODE_REQUEST_TOO_LARGE 0x0E
786#define SPDM_ERROR_CODE_LARGE_RESPONSE 0x0F
787#define SPDM_ERROR_CODE_MESSAGE_LOST 0x10
834#define SPDM_MAX_VENDOR_DEFINED_DATA_LEN 65535
840#define SPDM_MAX_VENDOR_ID_LENGTH 255
883 UINT8 RandomData[32];
892#define SPDM_KEY_EXCHANGE_REQUEST_SESSION_POLICY_TERMINATION_POLICY_RUNTIME_UPDATE BIT0
897#define SPDM_KEY_EXCHANGE_REQUEST_NO_MEASUREMENT_SUMMARY_HASH \
898 SPDM_REQUEST_NO_MEASUREMENT_SUMMARY_HASH
899#define SPDM_KEY_EXCHANGE_REQUEST_TCB_COMPONENT_MEASUREMENT_HASH \
900 SPDM_REQUEST_TCB_COMPONENT_MEASUREMENT_HASH
901#define SPDM_KEY_EXCHANGE_REQUEST_ALL_MEASUREMENTS_HASH SPDM_REQUEST_ALL_MEASUREMENTS_HASH
911 UINT8 MutAuthRequested;
912 UINT8 ReqSlotIDParam;
913 UINT8 RandomData[32];
925#define SPDM_KEY_EXCHANGE_RESPONSE_MUT_AUTH_REQUESTED BIT0
926#define SPDM_KEY_EXCHANGE_RESPONSE_MUT_AUTH_REQUESTED_WITH_ENCAP_REQUEST BIT1
927#define SPDM_KEY_EXCHANGE_RESPONSE_MUT_AUTH_REQUESTED_WITH_GET_DIGESTS BIT2
929#define SPDM_KEY_EXCHANGE_RESPONSE_SIGN_CONTEXT "responder-key_exchange_rsp signing"
930#define SPDM_KEY_EXCHANGE_RESPONSE_SIGN_CONTEXT_SIZE \
931 (sizeof(SPDM_KEY_EXCHANGE_RESPONSE_SIGN_CONTEXT) - 1)
933#define SPDM_VERSION_1_2_KEY_EXCHANGE_REQUESTER_CONTEXT "Requester-KEP-dmtf-spdm-v1.2"
934#define SPDM_VERSION_1_2_KEY_EXCHANGE_REQUESTER_CONTEXT_SIZE \
935 (sizeof(SPDM_VERSION_1_2_KEY_EXCHANGE_REQUESTER_CONTEXT) - 1)
937#define SPDM_VERSION_1_2_KEY_EXCHANGE_RESPONDER_CONTEXT "Responder-KEP-dmtf-spdm-v1.2"
938#define SPDM_VERSION_1_2_KEY_EXCHANGE_RESPONDER_CONTEXT_SIZE \
939 (sizeof(SPDM_VERSION_1_2_KEY_EXCHANGE_RESPONDER_CONTEXT) - 1)
955#define SPDM_FINISH_REQUEST_ATTRIBUTES_SIGNATURE_INCLUDED BIT0
967#define SPDM_FINISH_SIGN_CONTEXT "requester-finish signing"
968#define SPDM_FINISH_SIGN_CONTEXT_SIZE (sizeof(SPDM_FINISH_SIGN_CONTEXT) - 1)
978 UINT16 PSKHintLength;
979 UINT16 RequesterContextLength;
989#define SPDM_PSK_EXCHANGE_REQUEST_NO_MEASUREMENT_SUMMARY_HASH \
990 SPDM_REQUEST_NO_MEASUREMENT_SUMMARY_HASH
991#define SPDM_PSK_EXCHANGE_REQUEST_TCB_COMPONENT_MEASUREMENT_HASH \
992 SPDM_REQUEST_TCB_COMPONENT_MEASUREMENT_HASH
993#define SPDM_PSK_EXCHANGE_REQUEST_ALL_MEASUREMENTS_HASH SPDM_REQUEST_ALL_MEASUREMENTS_HASH
1002 UINT16 RspSessionID;
1004 UINT16 ResponderContextLength;
1005 UINT16 OpaqueLength;
1061#define SPDM_KEY_UPDATE_OPERATIONS_TABLE_UPDATE_KEY 1
1062#define SPDM_KEY_UPDATE_OPERATIONS_TABLE_UPDATE_ALL_KEYS 2
1063#define SPDM_KEY_UPDATE_OPERATIONS_TABLE_VERIFY_NEW_KEY 3
1119#define SPDM_ENCAPSULATED_RESPONSE_ACK_RESPONSE_PAYLOAD_TYPE_ABSENT 0
1120#define SPDM_ENCAPSULATED_RESPONSE_ACK_RESPONSE_PAYLOAD_TYPE_PRESENT 1
1121#define SPDM_ENCAPSULATED_RESPONSE_ACK_RESPONSE_PAYLOAD_TYPE_REQ_SLOT_NUMBER 2
1135#define SPDM_END_SESSION_REQUEST_ATTRIBUTES_PRESERVE_NEGOTIATED_STATE_CLEAR BIT0
1164#define SPDM_SET_CERTIFICATE_REQUEST_SLOT_ID_MASK 0xF
1169#define SPDM_SET_CERTIFICATE_REQUEST_ATTRIBUTES_CERT_MODEL_MASK 0x70
1170#define SPDM_SET_CERTIFICATE_REQUEST_ATTRIBUTES_CERT_MODEL_OFFSET 4
1171#define SPDM_SET_CERTIFICATE_REQUEST_ATTRIBUTES_ERASE 0x80
1183#define SPDM_SET_CERTIFICATE_RESPONSE_SLOT_ID_MASK 0xF
1190 UINT16 RequesterInfoLength;
1191 UINT16 OpaqueDataLength;
1200#define SPDM_GET_CSR_REQUEST_ATTRIBUTES_CERT_MODEL_MASK 0x07
1201#define SPDM_GET_CSR_REQUEST_ATTRIBUTES_CSR_TRACKING_TAG_MASK 0x38
1202#define SPDM_GET_CSR_REQUEST_ATTRIBUTES_CSR_TRACKING_TAG_OFFSET 3
1203#define SPDM_GET_CSR_REQUEST_ATTRIBUTES_OVERWRITE 0x80
1204#define SPDM_GET_CSR_REQUEST_ATTRIBUTES_MAX_CSR_CERT_MODEL 4
1209#define SPDM_MAX_CSR_SIZE 65535
1239#define SPDM_CHUNK_SEND_REQUEST_ATTRIBUTE_LAST_CHUNK (1 << 0)
1253#define SPDM_CHUNK_SEND_ACK_RESPONSE_ATTRIBUTE_EARLY_ERROR_DETECTED (1 << 0)
1282#define SPDM_CHUNK_GET_RESPONSE_ATTRIBUTE_LAST_CHUNK (1 << 0)
1285#define SPDM_VERSION_1_1_BIN_CONCAT_LABEL "spdm1.1 "
1286#define SPDM_VERSION_1_2_BIN_CONCAT_LABEL "spdm1.2 "
1287#define SPDM_BIN_STR_0_LABEL "derived"
1288#define SPDM_BIN_STR_1_LABEL "req hs data"
1289#define SPDM_BIN_STR_2_LABEL "rsp hs data"
1290#define SPDM_BIN_STR_3_LABEL "req app data"
1291#define SPDM_BIN_STR_4_LABEL "rsp app data"
1292#define SPDM_BIN_STR_5_LABEL "key"
1293#define SPDM_BIN_STR_6_LABEL "iv"
1294#define SPDM_BIN_STR_7_LABEL "finished"
1295#define SPDM_BIN_STR_8_LABEL "exp master"
1296#define SPDM_BIN_STR_9_LABEL "traffic upd"
1302#define SPDM_ST1_VALUE_US 100000
1309#define SPDM_OID_DMTF \
1310 {0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1C }
1312#define SPDM_OID_DMTF_SPDM \
1313 {0x06, 0x01, 0x04, 0x01, 0x83, 0x1C, 0x82, 0x12 }
1315#define SPDM_OID_DMTF_DEVICE_INFO \
1316 {0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1C, 0x82, 0x12, 0x01 }
1318#define SPDM_OID_DMTF_HARDWARE_IDENTITY \
1319 {0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1C, 0x82, 0x12, 0x02 }
1321#define SPDM_OID_DMTF_EKU_RESPONDER_AUTH \
1322 {0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1C, 0x82, 0x12, 0x03 }
1324#define SPDM_OID_DMTF_EKU_REQUESTER_AUTH \
1325 {0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1C, 0x82, 0x12, 0x04 }
1327#define SPDM_OID_DMTF_MUTABLE_CERTIFICATE \
1328 {0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1C, 0x82, 0x12, 0x05 }
1330#define SPDM_OID_DMTF_SPDM_EXTENSION \
1331 {0x2B, 0x06, 0x01, 0x04, 0x01, 0x83, 0x1C, 0x82, 0x12, 0x06 }
UINT16 SPDM_VERSION_NUMBER
UINT64 SPDM_MEASUREMENTS_SECURE_VERSION_NUMBER