@@ -161,8 +161,61 @@ typedef struct {
161
161
uint32_t max_spdm_msg_size ;
162
162
} spdm_get_capabilities_request_t ;
163
163
164
- /* SPDM GET_CAPABILITIES response*/
164
+ /* SPDM extended algorithm */
165
+ typedef struct {
166
+ uint8_t registry_id ;
167
+ uint8_t reserved ;
168
+ uint16_t algorithm_id ;
169
+ } spdm_extended_algorithm_t ;
170
+
171
+ typedef struct {
172
+ uint8_t alg_type ;
173
+ uint8_t alg_count ;
174
+ uint16_t alg_supported ;
175
+ } spdm_negotiate_algorithms_common_struct_table_t ;
165
176
177
+ /* SPDM supported algorithms block */
178
+ typedef struct {
179
+ uint8_t param1 ; /* Number of Algorithms Structure Tables */
180
+ uint8_t param2 ; /* Reserved */
181
+ uint16_t length ;
182
+ uint8_t measurement_specification ;
183
+ uint8_t other_params_support ;
184
+ uint32_t base_asym_algo ;
185
+ uint32_t base_hash_algo ;
186
+ uint8_t reserved2 [12 ];
187
+ uint8_t ext_asym_count ;
188
+ uint8_t ext_hash_count ;
189
+ uint8_t reserved3 ;
190
+ uint8_t mel_specification ;
191
+ /* Followed by dynamic arrays for ext_asym, ext_hash, and struct_tableif needed
192
+ * spdm_extended_algorithm_t ext_asym[ext_asym_count];
193
+ * spdm_extended_algorithm_t ext_hash[ext_hash_count];
194
+ * spdm_negotiate_algorithms_common_struct_table_t struct_table[
195
+ * SPDM_NEGOTIATE_ALGORITHMS_MAX_NUM_STRUCT_TABLE_ALG];*/
196
+ } spdm_supported_algorithms_block_t ;
197
+
198
+ /* Specification states that total Extended algorithms count is less than or equal to 20*/
199
+ #define SPDM_ALGORITHMS_MAX_NUM_EXT_ASYM_COUNT 20
200
+ #define SPDM_ALGORITHMS_MAX_NUM_EXT_HASH_COUNT 20
201
+ #define SPDM_ALGORITHMS_MAX_NUM_STRUCT_TABLE_ALG 4
202
+
203
+ /* SPDM supported algorithms by responder */
204
+ typedef struct {
205
+ uint8_t measurement_specification ;
206
+ uint8_t other_params_support ;
207
+ uint32_t base_asym_algo ;
208
+ uint32_t base_hash_algo ;
209
+ uint8_t ext_asym_count ;
210
+ uint8_t ext_hash_count ;
211
+ uint8_t mel_specification ;
212
+ spdm_extended_algorithm_t ext_asym [SPDM_ALGORITHMS_MAX_NUM_EXT_ASYM_COUNT ];
213
+ spdm_extended_algorithm_t ext_hash [SPDM_ALGORITHMS_MAX_NUM_EXT_HASH_COUNT ];
214
+ spdm_negotiate_algorithms_common_struct_table_t struct_table [
215
+ SPDM_ALGORITHMS_MAX_NUM_STRUCT_TABLE_ALG ];
216
+ } spdm_responder_supported_algorithms_t ;
217
+
218
+ /* SPDM GET_CAPABILITIES response*/
166
219
typedef struct {
167
220
spdm_message_header_t header ;
168
221
/* param1 == RSVD
@@ -174,6 +227,8 @@ typedef struct {
174
227
/* Below field is added in 1.2.*/
175
228
uint32_t data_transfer_size ;
176
229
uint32_t max_spdm_msg_size ;
230
+ /* Below field is added in 1.3.*/
231
+ spdm_supported_algorithms_block_t supported_algorithms ;
177
232
} spdm_capabilities_response_t ;
178
233
179
234
#define SPDM_MIN_DATA_TRANSFER_SIZE_VERSION_12 42
@@ -357,12 +412,6 @@ typedef struct {
357
412
#define SPDM_NEGOTIATE_ALGORITHMS_ALG_SUPPORTED_AEAD_12_MASK 0x000f
358
413
#define SPDM_NEGOTIATE_ALGORITHMS_ALG_SUPPORTED_REQ_BASE_ASYM_ALG_12_MASK 0x0fff
359
414
360
- typedef struct {
361
- uint8_t alg_type ;
362
- uint8_t alg_count ;
363
- uint16_t alg_supported ;
364
- } spdm_negotiate_algorithms_common_struct_table_t ;
365
-
366
415
367
416
/* SPDM NEGOTIATE_ALGORITHMS request base_asym_algo/REQ_BASE_ASYM_ALG */
368
417
#define SPDM_ALGORITHMS_BASE_ASYM_ALGO_TPM_ALG_RSASSA_2048 0x00000001
@@ -481,13 +530,6 @@ typedef struct {
481
530
/*opaque_element_table_t opaque_list[];*/
482
531
} spdm_general_opaque_data_table_header_t ;
483
532
484
- /* SPDM extended algorithm */
485
- typedef struct {
486
- uint8_t registry_id ;
487
- uint8_t reserved ;
488
- uint16_t algorithm_id ;
489
- } spdm_extended_algorithm_t ;
490
-
491
533
/* SPDM registry_id */
492
534
#define SPDM_REGISTRY_ID_DMTF 0x0
493
535
#define SPDM_REGISTRY_ID_TCG 0x1
0 commit comments