DMTF / libspdm

BSD 3-Clause "New" or "Revised" License
116 stars 106 forks source link

`ChunkSeqNo` should not wrap #2875

Open steven-bellock opened 1 month ago

steven-bellock commented 1 month ago

I believe a reading of the Large SPDM message transfer mechanism implies that ChunkSeqNo should not wrap. Ie, if the message is too large for 65536 chunks then it should not be sent. However libspdm assumes wrapping, for example

https://github.com/DMTF/libspdm/blob/30014a822710d58a0387afdce5bce4ec144bcd74/library/spdm_responder_lib/libspdm_rsp_chunk_get.c#L157

I filed https://github.com/DMTF/SPDM-WG/issues/3703 to increase the size of ChunkSeqNo so that we don't have to think about this for SPDM 1.4 and greater.

jyao1 commented 1 month ago

Good finding.

Read the spec, the LargeMessageSize is present when ChunkSeqNo is 0. But it is not considered on wrap case.

I think we should prevent wrap from happening.

steven-bellock commented 3 weeks ago

The SPDM Working Group confirmed that it does not wrap. This will be made more explicit in the specification.

Li-Aaron commented 4 days ago

I'll take this.