libspdm icon indicating copy to clipboard operation
libspdm copied to clipboard

`libspdm_decode_secured_message` to support out-of-order message decryption

Open PrithviAPai opened this issue 2 years ago • 7 comments

Reference: https://github.com/DMTF/libspdm/issues/2560

PrithviAPai avatar Feb 08 '24 04:02 PrithviAPai

Spec mentions SPDM EndPoint shall NOT send messages with out of sequence. image

In case of packet drop/timeout, spec mentions integrator either to END_SESSION or Re-establish NEW Session. Should there be changes in spec ? Or is there anything integrator can do about this ?

PrithviAPai avatar Feb 08 '24 15:02 PrithviAPai

Yeah let me file an issue against the specification on what is meant by that. It should be more clear.

steven-bellock avatar Feb 08 '24 15:02 steven-bellock

Yeah let me file an issue against the specification on what is meant by that. It should be more clear.

Any response from the authors ? When can libspdm support out-of-order message delivery ?

PrithviAPai avatar Feb 14 '24 07:02 PrithviAPai

Any response from the authors ?

Yes. The SPDM Working Group meetings are every Wednesday.

They clarified that 277 itself is not a transport. In particular, if a transport receives messages out-of-order then it is up to the transport layer(s), below 277, to re-arrange things. Individual 277 messages, and their sequence number, cannot be presented to the 277 layer out-of-order, else that is flagged as an error. libspdm is currently consistent with that behavior.

If you'd like to see changes in future specifications let me know and I can get you added to the specification repository where you can file an issue.

steven-bellock avatar Feb 14 '24 15:02 steven-bellock

Thanks for your response @steven-bellock I was exploring part of NOT having sequence number for my use case. 277 doesn't recommend having sequence numbers. image

In libspdm, I didnt find any option to send packet without sequence numbers. Is there any provision like that ?

PrithviAPai avatar Feb 14 '24 16:02 PrithviAPai

The Integrator needs to register. https://github.com/DMTF/libspdm/blob/11a60b3e7386f996fca98c2196cc02605dd3c5c7/include/library/spdm_secured_message_lib.h#L182-L196 libspdm will call this function and the Integrator provides the sequence number as it will appear in the 277 message. Different transports define the size of the 277 message sequence number. For example MCTP defines it to be the lower two bytes of the full eight byte sequence number.

steven-bellock avatar Feb 14 '24 17:02 steven-bellock

@PrithviAPai please close this issue if it has been resolved / answered.

steven-bellock avatar Jul 11 '24 23:07 steven-bellock