Skip to content

Commit

Permalink
1.3 add mutli_key_conn set/get data.
Browse files Browse the repository at this point in the history
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
  • Loading branch information
jyao1 committed Nov 20, 2023
1 parent 70aedf5 commit bdb7f70
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/library/spdm_common_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ typedef enum {
LIBSPDM_DATA_SEQUENCE_NUMBER_ENDIAN,
LIBSPDM_DATA_SESSION_SEQUENCE_NUMBER_ENDIAN,

LIBSPDM_DATA_MULTI_KEY_CONN_REQ,
LIBSPDM_DATA_MULTI_KEY_CONN_RSP,

/* MAX */
LIBSPDM_DATA_MAX
} libspdm_data_type_t;
Expand Down
35 changes: 35 additions & 0 deletions library/spdm_common_lib/libspdm_com_context_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,25 @@ libspdm_return_t libspdm_set_data(void *spdm_context, libspdm_data_type_t data_t
return LIBSPDM_STATUS_INVALID_PARAMETER;
}
context->sequence_number_endian = *(uint8_t *)data;
break;
case LIBSPDM_DATA_MULTI_KEY_CONN_REQ:
if (parameter->location != LIBSPDM_DATA_LOCATION_CONNECTION) {
return LIBSPDM_STATUS_INVALID_PARAMETER;
}
if (data_size != sizeof(bool)) {
return LIBSPDM_STATUS_INVALID_PARAMETER;
}
context->connection_info.multi_key_conn_req = *(bool *)data;
break;
case LIBSPDM_DATA_MULTI_KEY_CONN_RSP:
if (parameter->location != LIBSPDM_DATA_LOCATION_CONNECTION) {
return LIBSPDM_STATUS_INVALID_PARAMETER;
}
if (data_size != sizeof(bool)) {
return LIBSPDM_STATUS_INVALID_PARAMETER;
}
context->connection_info.multi_key_conn_rsp = *(bool *)data;
break;
default:
return LIBSPDM_STATUS_UNSUPPORTED_CAP;
break;
Expand Down Expand Up @@ -994,9 +1013,25 @@ libspdm_return_t libspdm_get_data(void *spdm_context, libspdm_data_type_t data_t
case LIBSPDM_DATA_SEQUENCE_NUMBER_ENDIAN:
target_data_size = sizeof(uint8_t);
target_data = &context->sequence_number_endian;
break;
case LIBSPDM_DATA_SESSION_SEQUENCE_NUMBER_ENDIAN:
target_data_size = sizeof(uint8_t);
target_data = &secured_context->sequence_number_endian;
break;
case LIBSPDM_DATA_MULTI_KEY_CONN_REQ:
if (parameter->location != LIBSPDM_DATA_LOCATION_CONNECTION) {
return LIBSPDM_STATUS_INVALID_PARAMETER;
}
target_data_size = sizeof(bool);
target_data = &context->connection_info.multi_key_conn_req;
break;
case LIBSPDM_DATA_MULTI_KEY_CONN_RSP:
if (parameter->location != LIBSPDM_DATA_LOCATION_CONNECTION) {
return LIBSPDM_STATUS_INVALID_PARAMETER;
}
target_data_size = sizeof(bool);
target_data = &context->connection_info.multi_key_conn_rsp;
break;
default:
return LIBSPDM_STATUS_UNSUPPORTED_CAP;
break;
Expand Down

0 comments on commit bdb7f70

Please sign in to comment.