libspdm icon indicating copy to clipboard operation
libspdm copied to clipboard

Question about ALGORITHMS for multiple tables

Open hiption opened this issue 3 years ago • 3 comments

https://github.com/DMTF/libspdm/blob/b42d264dd770d6f14c2a2278c9942806e2c554fd/unit_test/test_spdm_responder/algorithms.c#L1139-L1204

Above TC (libspdm_test_responder_algorithms_case7) is for nonmal behavior with multiple tables.

https://github.com/DMTF/libspdm/blob/b42d264dd770d6f14c2a2278c9942806e2c554fd/library/spdm_responder_lib/libspdm_rsp_algorithms.c#L408-L439

In the current implementation, the same type of algorithm structure is overwritten when it comes. Therefore, when multiple tables are used, only the algorithm described last of the same type is set. I wonder it is correct.

hiption avatar Jun 07 '22 01:06 hiption

The specification says

AlgType shall monotonically increase for subsequent entries.

and that is something that the Requester / Responder can check, and for the Responder's case it can return an ERROR response if the Requester has generated an algorithm structure with repeated entries or entries that are in reverse order.

steven-bellock avatar Jun 07 '22 16:06 steven-bellock

@hiption Are you interested in creating a pull request to resolve this issue? It entails creating a counter to ensure that entries aren't repeated and are always increasing.

steven-bellock avatar Jun 13 '22 14:06 steven-bellock

I agree with your comment that "it can return an ERROR response if the Requester has generated an algorithm structure with repeated entries or entries that are in reverse order".

I am interested in participating in libSpdm. However, PR is not possible due to the restrictions of my development environment.

I am sorry.

hiption avatar Jun 20 '22 00:06 hiption