DMTF / spdm-emu

BSD 3-Clause "New" or "Revised" License
32 stars 44 forks source link

spdm_responder_emu/spdm_requester_emu fails if transport NONE is selected. #358

Open arugan02 opened 3 months ago

arugan02 commented 3 months ago

$ ./spdm_responder_emu --trans NONE spdm_responder_emu version 0.1 trans - 0x0 context_size - 0x3048 max_spdm_msg_size (4608) must be greater than or equal to data_transfer_size (4736).

I believe the issue is due to macro LIBSPDM_SENDER_BUFFER_SIZE, LIBSPDM_RECEIVER_BUFFER_SIZE appending LIBSPDM_TRANSPORT_ADDITIONAL_SIZE. The transport header_size, tail_size is set during runtime based on the selected transport. For transport NONE these values are 0. But these macros LIBSPDM_SENDER_BUFFER_SIZE and LIBSPDM_RECEIVER_BUFFER_SIZE add LIBSPDM_TRANSPORT_ADDITIONAL_SIZE. I have a possible fix, shall raise a PR and we can discuss other options in code review. Please ack. Thanks.

steven-bellock commented 3 months ago

@arugan02 that seems reasonable. We'll review the pull request.