Skip to content

Commit

Permalink
Add 1.3 digest
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 Dec 5, 2023
1 parent 840c948 commit 99115a2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions spdm_emu/spdm_requester_emu/spdm_requester_spdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,21 @@ void *spdm_client_init(void)
libspdm_set_data(spdm_context,
LIBSPDM_DATA_LOCAL_PUBLIC_CERT_CHAIN,
&parameter, data, data_size);
data8 = (uint8_t)(0xB0 + index);
libspdm_set_data(spdm_context,
LIBSPDM_DATA_LOCAL_KEY_PAIR_ID,
&parameter, &data8, sizeof(data8));
data8 = SPDM_CERTIFICATE_INFO_CERT_MODEL_DEVICE_CERT;
libspdm_set_data(spdm_context,
LIBSPDM_DATA_LOCAL_CERT_INFO,
&parameter, &data8, sizeof(data8));
data16 = SPDM_KEY_USAGE_BIT_MASK_KEY_EX_USE |
SPDM_KEY_USAGE_BIT_MASK_CHALLENGE_USE |
SPDM_KEY_USAGE_BIT_MASK_MEASUREMENT_USE |
SPDM_KEY_USAGE_BIT_MASK_ENDPOINT_INFO_USE;
libspdm_set_data(spdm_context,
LIBSPDM_DATA_LOCAL_KEY_USAGE_BIT_MASK,
&parameter, &data16, sizeof(data16));
}
/* do not free it*/
} else {
Expand All @@ -529,6 +544,12 @@ void *spdm_client_init(void)
}
}

libspdm_zero_mem(&parameter, sizeof(parameter));
parameter.location = LIBSPDM_DATA_LOCATION_LOCAL;
data8 = 0x3F;
libspdm_set_data(spdm_context, LIBSPDM_DATA_LOCAL_SUPPORTED_SLOT_MASK, &parameter,
&data8, sizeof(data8));

if (m_save_state_file_name != NULL) {
spdm_save_negotiated_state(spdm_context, true);
}
Expand Down
21 changes: 21 additions & 0 deletions spdm_emu/spdm_responder_emu/spdm_responder_spdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,21 @@ void spdm_server_connection_state_callback(
LIBSPDM_DATA_LOCAL_PUBLIC_CERT_CHAIN,
&parameter, data, data_size);
}
data8 = (uint8_t)(0xA0 + index);
libspdm_set_data(spdm_context,
LIBSPDM_DATA_LOCAL_KEY_PAIR_ID,
&parameter, &data8, sizeof(data8));
data8 = SPDM_CERTIFICATE_INFO_CERT_MODEL_DEVICE_CERT;
libspdm_set_data(spdm_context,
LIBSPDM_DATA_LOCAL_CERT_INFO,
&parameter, &data8, sizeof(data8));
data16 = SPDM_KEY_USAGE_BIT_MASK_KEY_EX_USE |
SPDM_KEY_USAGE_BIT_MASK_CHALLENGE_USE |
SPDM_KEY_USAGE_BIT_MASK_MEASUREMENT_USE |
SPDM_KEY_USAGE_BIT_MASK_ENDPOINT_INFO_USE;
libspdm_set_data(spdm_context,
LIBSPDM_DATA_LOCAL_KEY_USAGE_BIT_MASK,
&parameter, &data16, sizeof(data16));
}
/* do not free it*/
}
Expand Down Expand Up @@ -485,6 +500,12 @@ void spdm_server_connection_state_callback(
}
}

libspdm_zero_mem(&parameter, sizeof(parameter));
parameter.location = LIBSPDM_DATA_LOCATION_LOCAL;
data8 = 0x3F;
libspdm_set_data(spdm_context, LIBSPDM_DATA_LOCAL_SUPPORTED_SLOT_MASK, &parameter,
&data8, sizeof(data8));

if (m_save_state_file_name != NULL) {
spdm_save_negotiated_state(spdm_context, false);
}
Expand Down

0 comments on commit 99115a2

Please sign in to comment.