@@ -18,7 +18,8 @@ typedef struct {
18
18
uint32_t measurement_hash_algo ;
19
19
uint32_t base_asym_sel ;
20
20
uint32_t base_hash_sel ;
21
- uint8_t reserved2 [12 ];
21
+ uint8_t reserved2 [11 ];
22
+ uint8_t mel_specification_sel ;
22
23
uint8_t ext_asym_sel_count ;
23
24
uint8_t ext_hash_sel_count ;
24
25
uint16_t reserved3 ;
@@ -257,6 +258,10 @@ libspdm_return_t libspdm_get_response_algorithms(libspdm_context_t *spdm_context
257
258
SPDM_ALGORITHMS_OPAQUE_DATA_FORMAT_NONE
258
259
};
259
260
261
+ uint32_t mel_spec_priority_table [] = {
262
+ SPDM_MEL_SPECIFICATION_DMTF ,
263
+ };
264
+
260
265
spdm_request = request ;
261
266
262
267
ext_alg_total_count = 0 ;
@@ -550,6 +555,10 @@ libspdm_return_t libspdm_get_response_algorithms(libspdm_context_t *spdm_context
550
555
if (spdm_request -> header .spdm_version >= SPDM_MESSAGE_VERSION_12 ) {
551
556
spdm_context -> connection_info .algorithm .other_params_support =
552
557
spdm_request -> other_params_support ;
558
+ if (spdm_request -> header .spdm_version >= SPDM_MESSAGE_VERSION_13 ) {
559
+ spdm_context -> connection_info .algorithm .mel_spec =
560
+ spdm_request -> mel_specification ;
561
+ }
553
562
}
554
563
555
564
spdm_response -> measurement_specification_sel = (uint8_t )libspdm_prioritize_algorithm (
@@ -583,6 +592,13 @@ libspdm_return_t libspdm_get_response_algorithms(libspdm_context_t *spdm_context
583
592
SPDM_ALGORITHMS_OPAQUE_DATA_FORMAT_MASK ,
584
593
spdm_context -> connection_info .algorithm .other_params_support &
585
594
SPDM_ALGORITHMS_OPAQUE_DATA_FORMAT_MASK );
595
+ if (spdm_request -> header .spdm_version >= SPDM_MESSAGE_VERSION_13 ) {
596
+ spdm_response -> mel_specification_sel = (uint8_t )libspdm_prioritize_algorithm (
597
+ mel_spec_priority_table ,
598
+ LIBSPDM_ARRAY_SIZE (mel_spec_priority_table ),
599
+ spdm_context -> local_context .algorithm .mel_spec ,
600
+ spdm_context -> connection_info .algorithm .mel_spec );
601
+ }
586
602
}
587
603
588
604
if (spdm_request -> header .spdm_version >= SPDM_MESSAGE_VERSION_13 ) {
@@ -718,6 +734,12 @@ libspdm_return_t libspdm_get_response_algorithms(libspdm_context_t *spdm_context
718
734
if (spdm_response -> header .spdm_version >= SPDM_MESSAGE_VERSION_12 ) {
719
735
spdm_context -> connection_info .algorithm .other_params_support =
720
736
spdm_response -> other_params_selection ;
737
+ if (spdm_response -> header .spdm_version >= SPDM_MESSAGE_VERSION_13 ) {
738
+ spdm_context -> connection_info .algorithm .mel_spec =
739
+ spdm_response -> mel_specification_sel ;
740
+ } else {
741
+ spdm_context -> connection_info .algorithm .mel_spec = 0 ;
742
+ }
721
743
} else {
722
744
spdm_context -> connection_info .algorithm .other_params_support = 0 ;
723
745
}
0 commit comments