Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make variables static in get_key_pair_info.c #2880

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ libspdm_return_t spdm_requester_receive_message(void *spdm_context,
return LIBSPDM_STATUS_SUCCESS;
}

uint8_t m_scratch_buffer[LIBSPDM_SCRATCH_BUFFER_SIZE];
static uint8_t m_scratch_buffer[LIBSPDM_SCRATCH_BUFFER_SIZE];

bool m_send_receive_buffer_acquired = false;
uint8_t m_send_receive_buffer[LIBSPDM_MAX_SENDER_RECEIVER_BUFFER_SIZE];
size_t m_send_receive_buffer_size;
static bool m_send_receive_buffer_acquired = false;
static uint8_t m_send_receive_buffer[LIBSPDM_MAX_SENDER_RECEIVER_BUFFER_SIZE];
static size_t m_send_receive_buffer_size;

libspdm_return_t spdm_device_acquire_sender_buffer (
void *context, void **msg_buf_ptr)
Expand Down
6 changes: 3 additions & 3 deletions unit_test/test_spdm_requester/encap_certificate.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ spdm_get_certificate_request_t m_spdm_get_certificate_request1 = {
0,
LIBSPDM_MAX_CERT_CHAIN_BLOCK_LEN
};
size_t m_spdm_get_certificate_request1_size =
static size_t m_spdm_get_certificate_request1_size =
sizeof(m_spdm_get_certificate_request1);

spdm_get_certificate_request_t m_spdm_get_certificate_request3 = {
{SPDM_MESSAGE_VERSION_11, SPDM_GET_CERTIFICATE, 0, 0}, 0, 0
};
size_t m_spdm_get_certificate_request3_size =
static size_t m_spdm_get_certificate_request3_size =
sizeof(m_spdm_get_certificate_request3);

spdm_get_certificate_request_t m_spdm_get_certificate_request4 = {
{SPDM_MESSAGE_VERSION_13, SPDM_GET_CERTIFICATE, 0, 0},
0,
LIBSPDM_MAX_CERT_CHAIN_BLOCK_LEN
};
size_t m_spdm_get_certificate_request4_size =
static size_t m_spdm_get_certificate_request4_size =
sizeof(m_spdm_get_certificate_request4);

/**
Expand Down
8 changes: 4 additions & 4 deletions unit_test/test_spdm_requester/encap_challenge_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ spdm_challenge_request_t m_spdm_challenge_request1 = {
{SPDM_MESSAGE_VERSION_11, SPDM_CHALLENGE, 0,
SPDM_CHALLENGE_REQUEST_NO_MEASUREMENT_SUMMARY_HASH},
};
size_t m_spdm_challenge_request1_size = sizeof(m_spdm_challenge_request1);
static size_t m_spdm_challenge_request1_size = sizeof(m_spdm_challenge_request1);

spdm_challenge_request_t m_spdm_challenge_request3 = {
{SPDM_MESSAGE_VERSION_11, SPDM_CHALLENGE, SPDM_MAX_SLOT_COUNT,
SPDM_CHALLENGE_REQUEST_NO_MEASUREMENT_SUMMARY_HASH},
};
size_t m_spdm_challenge_request3_size = sizeof(m_spdm_challenge_request3);
static size_t m_spdm_challenge_request3_size = sizeof(m_spdm_challenge_request3);

spdm_challenge_request_t m_spdm_challenge_request4 = {
{SPDM_MESSAGE_VERSION_11, SPDM_CHALLENGE, 0xFF,
SPDM_CHALLENGE_REQUEST_NO_MEASUREMENT_SUMMARY_HASH},
};
size_t m_spdm_challenge_request4_size = sizeof(m_spdm_challenge_request4);
static size_t m_spdm_challenge_request4_size = sizeof(m_spdm_challenge_request4);

spdm_challenge_request_t m_spdm_challenge_request5 = {
{SPDM_MESSAGE_VERSION_13, SPDM_CHALLENGE, 0,
SPDM_CHALLENGE_REQUEST_NO_MEASUREMENT_SUMMARY_HASH},
};
size_t m_spdm_challenge_request5_size = sizeof(m_spdm_challenge_request5);
static size_t m_spdm_challenge_request5_size = sizeof(m_spdm_challenge_request5);

extern size_t libspdm_secret_lib_challenge_opaque_data_size;

Expand Down
4 changes: 2 additions & 2 deletions unit_test/test_spdm_requester/encap_digests.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spdm_get_digest_request_t m_spdm_get_digests_request1 = {
SPDM_GET_DIGESTS,
},
};
size_t m_spdm_get_digests_request1_size = sizeof(m_spdm_get_digests_request1);
static size_t m_spdm_get_digests_request1_size = sizeof(m_spdm_get_digests_request1);


spdm_get_digest_request_t m_spdm_get_digests_request2 = {
Expand All @@ -24,7 +24,7 @@ spdm_get_digest_request_t m_spdm_get_digests_request2 = {
SPDM_GET_DIGESTS,
},
};
size_t m_spdm_get_digests_request2_size = sizeof(m_spdm_get_digests_request2);
static size_t m_spdm_get_digests_request2_size = sizeof(m_spdm_get_digests_request2);

static uint8_t m_local_certificate_chain[LIBSPDM_MAX_CERT_CHAIN_SIZE];

Expand Down
20 changes: 10 additions & 10 deletions unit_test/test_spdm_requester/encap_key_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,60 +13,60 @@ spdm_key_update_request_t m_spdm_key_update_request1 = {
{SPDM_MESSAGE_VERSION_11, SPDM_KEY_UPDATE,
SPDM_KEY_UPDATE_OPERATIONS_TABLE_UPDATE_KEY, 0x3}
};
size_t m_spdm_key_update_request1_size = sizeof(m_spdm_key_update_request1);
static size_t m_spdm_key_update_request1_size = sizeof(m_spdm_key_update_request1);

spdm_key_update_request_t m_spdm_key_update_request2 = {
{SPDM_MESSAGE_VERSION_11, SPDM_KEY_UPDATE,
SPDM_KEY_UPDATE_OPERATIONS_TABLE_UPDATE_KEY, 0x3}
};
size_t m_spdm_key_update_request2_size = LIBSPDM_MAX_SPDM_MSG_SIZE;
static size_t m_spdm_key_update_request2_size = LIBSPDM_MAX_SPDM_MSG_SIZE;

spdm_key_update_request_t m_spdm_key_update_request3 = {
{SPDM_MESSAGE_VERSION_11, SPDM_KEY_UPDATE,
SPDM_KEY_UPDATE_OPERATIONS_TABLE_UPDATE_ALL_KEYS, 0x71}
};
size_t m_spdm_key_update_request3_size = sizeof(m_spdm_key_update_request3);
static size_t m_spdm_key_update_request3_size = sizeof(m_spdm_key_update_request3);

spdm_key_update_request_t m_spdm_key_update_request4 = {
{SPDM_MESSAGE_VERSION_11, SPDM_KEY_UPDATE,
SPDM_KEY_UPDATE_OPERATIONS_TABLE_UPDATE_ALL_KEYS, 0x71}
};
size_t m_spdm_key_update_request4_size = LIBSPDM_MAX_SPDM_MSG_SIZE;
static size_t m_spdm_key_update_request4_size = LIBSPDM_MAX_SPDM_MSG_SIZE;

spdm_key_update_request_t m_spdm_key_update_request5 = {
{SPDM_MESSAGE_VERSION_11, SPDM_KEY_UPDATE,
SPDM_KEY_UPDATE_OPERATIONS_TABLE_VERIFY_NEW_KEY, 0x4A}
};
size_t m_spdm_key_update_request5_size = sizeof(m_spdm_key_update_request5);
static size_t m_spdm_key_update_request5_size = sizeof(m_spdm_key_update_request5);

spdm_key_update_request_t m_spdm_key_update_request6 = {
{SPDM_MESSAGE_VERSION_11, SPDM_KEY_UPDATE,
SPDM_KEY_UPDATE_OPERATIONS_TABLE_VERIFY_NEW_KEY, 0x4A}
};
size_t m_spdm_key_update_request6_size = LIBSPDM_MAX_SPDM_MSG_SIZE;
static size_t m_spdm_key_update_request6_size = LIBSPDM_MAX_SPDM_MSG_SIZE;

spdm_key_update_request_t m_spdm_key_update_request7 = {
{SPDM_MESSAGE_VERSION_11, SPDM_KEY_UPDATE,
SPDM_KEY_UPDATE_OPERATIONS_TABLE_UPDATE_KEY, 0x92}
};
size_t m_spdm_key_update_request7_size = sizeof(m_spdm_key_update_request7);
static size_t m_spdm_key_update_request7_size = sizeof(m_spdm_key_update_request7);

spdm_key_update_request_t m_spdm_key_update_request8 = {
{SPDM_MESSAGE_VERSION_11, SPDM_KEY_UPDATE,
SPDM_KEY_UPDATE_OPERATIONS_TABLE_UPDATE_ALL_KEYS, 0x13}
};
size_t m_spdm_key_update_request8_size = sizeof(m_spdm_key_update_request8);
static size_t m_spdm_key_update_request8_size = sizeof(m_spdm_key_update_request8);

spdm_key_update_request_t m_spdm_key_update_request9 = {
{SPDM_MESSAGE_VERSION_11, SPDM_KEY_UPDATE,
SPDM_KEY_UPDATE_OPERATIONS_TABLE_VERIFY_NEW_KEY, 0x22}
};
size_t m_spdm_key_update_request9_size = sizeof(m_spdm_key_update_request9);
static size_t m_spdm_key_update_request9_size = sizeof(m_spdm_key_update_request9);

spdm_key_update_request_t m_spdm_key_update_request10 = {
{SPDM_MESSAGE_VERSION_11, SPDM_KEY_UPDATE, 0xFF, 0x12}
};
size_t m_spdm_key_update_request10_size = sizeof(m_spdm_key_update_request10);
static size_t m_spdm_key_update_request10_size = sizeof(m_spdm_key_update_request10);

static void spdm_set_standard_key_update_test_state(
libspdm_context_t *spdm_context, uint32_t *session_id)
Expand Down
4 changes: 2 additions & 2 deletions unit_test/test_spdm_requester/get_csr.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ uint8_t csr_pointer[LIBSPDM_MAX_CSR_SIZE] = {0};
uint8_t *csr_data_pointer = csr_pointer;
size_t global_csr_len;

uint8_t m_csr_opaque_data[8] = "libspdm";
uint16_t m_csr_opaque_data_size = sizeof(m_csr_opaque_data);
static uint8_t m_csr_opaque_data[8] = "libspdm";
static uint16_t m_csr_opaque_data_size = sizeof(m_csr_opaque_data);

/*ECC 256 req_info(include right req_info attribute)*/
uint8_t req_info_sequence[] = {0x30, 0x81, 0xBF,};
Expand Down
16 changes: 8 additions & 8 deletions unit_test/test_spdm_requester/get_key_pair_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

#if LIBSPDM_ENABLE_CAPABILITY_GET_KEY_PAIR_INFO_CAP

uint8_t m_response_total_key_pairs;
uint8_t m_response_key_pair_id;
uint16_t m_response_capabilities;
uint16_t m_response_key_usage_capabilities;
uint16_t m_response_current_key_usage;
uint32_t m_response_asym_algo_capabilities;
uint32_t m_response_current_asym_algo;
uint8_t m_response_assoc_cert_slot_mask;
static uint8_t m_response_total_key_pairs;
static uint8_t m_response_key_pair_id;
static uint16_t m_response_capabilities;
static uint16_t m_response_key_usage_capabilities;
static uint16_t m_response_current_key_usage;
static uint32_t m_response_asym_algo_capabilities;
static uint32_t m_response_current_asym_algo;
static uint8_t m_response_assoc_cert_slot_mask;

libspdm_return_t libspdm_requester_get_key_pair_info_test_send_message(
void *spdm_context, size_t request_size, const void *request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

#define LIBSPDM_MAX_MEASUREMENT_EXTENSION_LOG_SIZE 0x1000

uint8_t m_libspdm_mel_test[LIBSPDM_MAX_MEASUREMENT_EXTENSION_LOG_SIZE];
size_t m_libspdm_mel_len;
uint8_t m_libspdm_mel_number;
static uint8_t m_libspdm_mel_test[LIBSPDM_MAX_MEASUREMENT_EXTENSION_LOG_SIZE];
static size_t m_libspdm_mel_len;
static uint8_t m_libspdm_mel_number;

void generate_mel_entry_test()
{
Expand Down
Loading
Loading