Skip to content

Interrupting command (excluding GET_VERSION) during chunk transfer terminates chunk transfer sequence. #3577

@limak102003

Description

@limak102003

From DSP0274 version 1.3, it looks like chunk transfer sequence should be maintained after rejecting interrupting command (excluding GET_VERSION):

The chunked transfer shall not be interrupted by any commands that are not part of the chunk transfer
sequence, with the exception of GET_VERSION . The Responder shall return the error
ErrorCode=UnexpectedRequest if an unexpected command is received during the chunked transfer. If CHUNK_GET
is invalid or corrupted, the Requester may receive corresponding error codes ( ErrorCode=InvalidRequest ,
ErrorCode=VersionMismatch , etc.). These error codes shall not interrupt the chunk transfer sequence, with
exception of the error code ErrorCode=DecryptError

However, in libspdm 3.8.0, libspdm_build_response() terminates chunk transfer sequence when is interrupted by any command.

if (!is_app_message) {
    get_response_func = libspdm_get_response_func_via_last_request(context);

    #if LIBSPDM_ENABLE_CAPABILITY_CHUNK_CAP
    /* If responder is expecting chunk_get or chunk_send requests
     * and gets other requests instead, drop out of chunking mode */
    if (context->chunk_context.get.chunk_in_use
        && get_response_func != libspdm_get_response_chunk_get) {

        context->chunk_context.get.chunk_in_use = false;
        context->chunk_context.get.chunk_handle++; /* implicit wrap - around to 0. */
        context->chunk_context.get.chunk_seq_no = 0;

        context->chunk_context.get.large_message = NULL;
        context->chunk_context.get.large_message_size = 0;
        context->chunk_context.get.chunk_bytes_transferred = 0;
    }
    #if LIBSPDM_ENABLE_CAPABILITY_CHUNK_SEND_CAP
    if (context->chunk_context.send.chunk_in_use
        && get_response_func != libspdm_get_response_chunk_send) {

        context->chunk_context.send.chunk_in_use = false;
        context->chunk_context.send.chunk_handle = 0;
        context->chunk_context.send.chunk_seq_no = 0;

        context->chunk_context.send.large_message = NULL;
        context->chunk_context.send.large_message_size = 0;
        context->chunk_context.send.chunk_bytes_transferred = 0;
    }
    #endif /* LIBSPDM_ENABLE_CAPABILITY_CHUNK_SEND_CAP */
    #endif /* LIBSPDM_ENABLE_CAPABILITY_CHUNK_CAP */

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions