diff --git a/include/hal/base.h b/include/hal/base.h index 096d1728537..0241048639a 100644 --- a/include/hal/base.h +++ b/include/hal/base.h @@ -25,7 +25,7 @@ * the 64-bit definition defined in libspdm and generates compile errors. */ /* To workaround this issue, LIBSPDM_OPENSSL_STDINT_WORKAROUND was created - * that is only defined for compilation via tha makefile of the OpenSSL library + * that is only defined for compilation via the makefile of the OpenSSL library * portion of libspdm. */ /* This will lead to _WIN32 and _WIN64 to be NOT defined when reaching the OpenSSL diff --git a/include/hal/library/cryptlib/cryptlib_cert.h b/include/hal/library/cryptlib/cryptlib_cert.h index c7e4cfedbf7..e596c9ef1a2 100644 --- a/include/hal/library/cryptlib/cryptlib_cert.h +++ b/include/hal/library/cryptlib/cryptlib_cert.h @@ -156,7 +156,7 @@ extern bool libspdm_x509_get_extension_data(const uint8_t *cert, size_t cert_siz * @param[out] to notAfter Pointer to date_time object. * @param[in,out] to_size notAfter date_time object size. * - * Note: libspdm_x509_compare_date_time to compare date_time oject + * Note: libspdm_x509_compare_date_time to compare date_time object * x509SetDateTime to get a date_time object from a date_time_str * * @retval true if the from_size and from_size are not equal 0. @@ -200,7 +200,7 @@ extern bool libspdm_x509_set_date_time(const char *date_time_str, void *date_tim * If date_time1 > date_time2, then return 1 * If date_time1 < date_time2, then return -1 * - * @param[in] date_time1 Pointer to a date_time Ojbect + * @param[in] date_time1 Pointer to a date_time Object * @param[in] date_time2 Pointer to a date_time Object * * @retval 0 If date_time1 == date_time2 diff --git a/include/industry_standard/spdm.h b/include/industry_standard/spdm.h index ed783f6baec..15964cbfa95 100644 --- a/include/industry_standard/spdm.h +++ b/include/industry_standard/spdm.h @@ -489,7 +489,7 @@ typedef struct { typedef struct { spdm_message_header_t header; /* param1 == RSVD (supported_slot_mask in 1.3) - * param2 == slot_mask (provisioned_slot_mask in 1.3) determing slot_count + * param2 == slot_mask (provisioned_slot_mask in 1.3) determine slot_count * cert slot state: * 1) not exist: supported_slot_mask[slot_id] = 0 * 2) exist and empty: supported_slot_mask[slot_id] = 1 && provisioned_slot_mask[slot_id] = 0 diff --git a/include/library/spdm_common_lib.h b/include/library/spdm_common_lib.h index 53aa1536a39..dd78558a69d 100644 --- a/include/library/spdm_common_lib.h +++ b/include/library/spdm_common_lib.h @@ -537,8 +537,8 @@ typedef libspdm_return_t (*libspdm_device_receive_message_func)(void *spdm_conte * This function must be called after libspdm_init_context, and before any SPDM communication. * * @param spdm_context A pointer to the SPDM context. - * @param send_message The fuction to send an SPDM transport layer message. - * @param receive_message The fuction to receive an SPDM transport layer message. + * @param send_message The function to send an SPDM transport layer message. + * @param receive_message The function to receive an SPDM transport layer message. **/ void libspdm_register_device_io_func( void *spdm_context, libspdm_device_send_message_func send_message, @@ -628,10 +628,10 @@ typedef void (*libspdm_device_release_receiver_buffer_func)(void *spdm_context, * @param spdm_context A pointer to the SPDM context. * @param sender_buffer_size Size in bytes of the sender buffer. * @param receiver_buffer_size Size in bytes of the receiver buffer. - * @param acquire_sender_buffer The fuction to acquire transport layer sender buffer. - * @param release_sender_buffer The fuction to release transport layer sender buffer. - * @param acquire_receiver_buffer The fuction to acquire transport layer receiver buffer. - * @param release_receiver_buffer The fuction to release transport layer receiver buffer. + * @param acquire_sender_buffer The function to acquire transport layer sender buffer. + * @param release_sender_buffer The function to release transport layer sender buffer. + * @param acquire_receiver_buffer The function to acquire transport layer receiver buffer. + * @param release_receiver_buffer The function to release transport layer receiver buffer. **/ void libspdm_register_device_buffer_func( void *spdm_context, @@ -732,8 +732,8 @@ typedef uint32_t (*libspdm_transport_get_header_size_func)(void *spdm_context); * This function must be called after libspdm_init_context, and before any SPDM communication. * * @param spdm_context A pointer to the SPDM context. - * @param transport_encode_message The fuction to encode an SPDM or APP message to a transport layer message. - * @param transport_decode_message The fuction to decode an SPDM or APP message from a transport layer message. + * @param transport_encode_message The function to encode an SPDM or APP message to a transport layer message. + * @param transport_decode_message The function to decode an SPDM or APP message from a transport layer message. **/ void libspdm_register_transport_layer_func( void *spdm_context, @@ -827,7 +827,7 @@ typedef bool (*libspdm_verify_spdm_cert_chain_func)( * This function must be called after libspdm_init_context, and before any SPDM communication. * * @param spdm_context A pointer to the SPDM context. - * @param verify_certificate The fuction to verify an SPDM certificate after GET_CERTIFICATE. + * @param verify_certificate The function to verify an SPDM certificate after GET_CERTIFICATE. **/ void libspdm_register_verify_spdm_cert_chain_func( void *spdm_context, diff --git a/library/spdm_common_lib/libspdm_com_context_data.c b/library/spdm_common_lib/libspdm_com_context_data.c index 8156984bd1d..7476abfb8a4 100644 --- a/library/spdm_common_lib/libspdm_com_context_data.c +++ b/library/spdm_common_lib/libspdm_com_context_data.c @@ -2403,8 +2403,8 @@ bool libspdm_is_encap_supported(const libspdm_context_t *spdm_context) * This function must be called after libspdm_init_context, and before any SPDM communication. * * @param spdm_context A pointer to the SPDM context. - * @param send_message The fuction to send an SPDM transport layer message. - * @param receive_message The fuction to receive an SPDM transport layer message. + * @param send_message The function to send an SPDM transport layer message. + * @param receive_message The function to receive an SPDM transport layer message. **/ void libspdm_register_device_io_func( void *spdm_context, libspdm_device_send_message_func send_message, @@ -2455,10 +2455,10 @@ void libspdm_register_device_io_func( * @param spdm_context A pointer to the SPDM context. * @param sender_buffer_size Size in bytes of the sender buffer. * @param receiver_buffer_size Size in bytes of the receiver buffer. - * @param acquire_sender_buffer The fuction to acquire transport layer sender buffer. - * @param release_sender_buffer The fuction to release transport layer sender buffer. - * @param acquire_receiver_buffer The fuction to acquire transport layer receiver buffer. - * @param release_receiver_buffer The fuction to release transport layer receiver buffer. + * @param acquire_sender_buffer The function to acquire transport layer sender buffer. + * @param release_sender_buffer The function to release transport layer sender buffer. + * @param acquire_receiver_buffer The function to acquire transport layer receiver buffer. + * @param release_receiver_buffer The function to release transport layer receiver buffer. **/ void libspdm_register_device_buffer_func( void *spdm_context, @@ -2502,8 +2502,8 @@ void libspdm_register_device_buffer_func( * This function must be called after libspdm_init_context, and before any SPDM communication. * * @param spdm_context A pointer to the SPDM context. - * @param transport_encode_message The fuction to encode an SPDM or APP message to a transport layer message. - * @param transport_decode_message The fuction to decode an SPDM or APP message from a transport layer message. + * @param transport_encode_message The function to encode an SPDM or APP message to a transport layer message. + * @param transport_decode_message The function to decode an SPDM or APP message from a transport layer message. **/ void libspdm_register_transport_layer_func( void *spdm_context, @@ -2552,7 +2552,7 @@ void libspdm_register_transport_layer_func( * This function must be called after libspdm_init_context, and before any SPDM communication. * * @param context A pointer to the SPDM context. - * @param verify_spdm_cert_chain The fuction to verify an SPDM certificate after GET_CERTIFICATE. + * @param verify_spdm_cert_chain The function to verify an SPDM certificate after GET_CERTIFICATE. **/ void libspdm_register_verify_spdm_cert_chain_func( void *spdm_context, diff --git a/library/spdm_crypt_lib/libspdm_crypt_cert.c b/library/spdm_crypt_lib/libspdm_crypt_cert.c index 79aaa988376..28b396d8666 100644 --- a/library/spdm_crypt_lib/libspdm_crypt_cert.c +++ b/library/spdm_crypt_lib/libspdm_crypt_cert.c @@ -408,7 +408,7 @@ static uint32_t libspdm_get_public_key_algo_OID_len(uint32_t base_asym_algo) * @param[in,out] oid_other Other SPDM public key encryption algorithm OID * because of ASN1 code for integer * - * @retval true get OID sucessful. + * @retval true get OID successful. * @retval false get OID fail. **/ static bool libspdm_get_public_key_algo_OID(uint32_t base_asym_algo, uint8_t *oid, @@ -1495,9 +1495,9 @@ bool libspdm_get_dmtf_subject_alt_name_from_bytes( return false; } - /* the src and dst adress are overlap, + /* the src and dst address are overlap, * When the function is called by libspdm_get_dmtf_subject_alt_name. - * libspdm_copy_mem can not be uesed */ + * libspdm_copy_mem can not be used */ if ((name_buffer != NULL) && (ptr != NULL)) { dst = (volatile uint8_t*) name_buffer; src = (const volatile uint8_t*) ptr; diff --git a/library/spdm_requester_lib/libspdm_req_common.c b/library/spdm_requester_lib/libspdm_req_common.c index f900634c96c..0886a68a96c 100644 --- a/library/spdm_requester_lib/libspdm_req_common.c +++ b/library/spdm_requester_lib/libspdm_req_common.c @@ -146,7 +146,7 @@ libspdm_return_t libspdm_process_opaque_data_version_selection_data(libspdm_cont opaque_element_table_header = (const secured_message_opaque_element_table_header_t*) get_element_ptr; - /*check for selection vesion data*/ + /* Check for selection version data. */ if ((opaque_element_table_header->vendor_len != 0) || (opaque_element_table_header->opaque_element_data_len != sizeof(secured_message_opaque_element_version_selection_t))) { diff --git a/library/spdm_requester_lib/libspdm_req_handle_error_response.c b/library/spdm_requester_lib/libspdm_req_handle_error_response.c index d7fbb02c764..262b844a079 100644 --- a/library/spdm_requester_lib/libspdm_req_handle_error_response.c +++ b/library/spdm_requester_lib/libspdm_req_handle_error_response.c @@ -148,7 +148,7 @@ libspdm_return_t libspdm_handle_simple_error_response(libspdm_context_t *spdm_co * On input, it means the size in bytes of response data buffer. * On output, it means the size in bytes of copied response data buffer if RETURN_SUCCESS is returned. * @param response The SPDM response message. - * @param original_request_code Indicate the orginal request code. + * @param original_request_code Indicate the original request code. * @param expected_response_code Indicate the expected response code. * * @retval RETURN_SUCCESS The RESPOND_IF_READY is sent and an expected SPDM response is received. diff --git a/library/spdm_requester_lib/libspdm_req_negotiate_algorithms.c b/library/spdm_requester_lib/libspdm_req_negotiate_algorithms.c index 6a8fcc8d252..767a47f3791 100644 --- a/library/spdm_requester_lib/libspdm_req_negotiate_algorithms.c +++ b/library/spdm_requester_lib/libspdm_req_negotiate_algorithms.c @@ -312,7 +312,7 @@ static libspdm_return_t libspdm_try_negotiate_algorithms(libspdm_context_t *spdm sizeof(uint32_t) * spdm_response->ext_hash_sel_count); if (spdm_response->header.spdm_version >= SPDM_MESSAGE_VERSION_11) { alg_type_pre = struct_table->alg_type; - /* header.param1 is implictly checked through spdm_response_size. */ + /* header.param1 is implicitly checked through spdm_response_size. */ for (index = 0; index < spdm_response->header.param1; index++) { if ((size_t)spdm_response + spdm_response_size < (size_t)struct_table) { status = LIBSPDM_STATUS_INVALID_MSG_SIZE; diff --git a/library/spdm_responder_lib/libspdm_rsp_chunk_send_ack.c b/library/spdm_responder_lib/libspdm_rsp_chunk_send_ack.c index c3ce78378e2..94aa6b02415 100644 --- a/library/spdm_responder_lib/libspdm_rsp_chunk_send_ack.c +++ b/library/spdm_responder_lib/libspdm_rsp_chunk_send_ack.c @@ -82,7 +82,7 @@ libspdm_return_t libspdm_get_response_chunk_send(libspdm_context_t *spdm_context } if (spdm_context->chunk_context.get.chunk_in_use) { - /* Spec does not support simultanious chunk send and chunk get */ + /* Specification does not support simultaneous chunk send and chunk get. */ return libspdm_generate_error_response( spdm_context, SPDM_ERROR_CODE_UNEXPECTED_REQUEST, 0, response_size, response); diff --git a/os_stub/cryptlib_mbedtls/pk/x509.c b/os_stub/cryptlib_mbedtls/pk/x509.c index aee0549de6c..1e7fb6819cd 100644 --- a/os_stub/cryptlib_mbedtls/pk/x509.c +++ b/os_stub/cryptlib_mbedtls/pk/x509.c @@ -1340,7 +1340,7 @@ bool libspdm_x509_get_extension_data(const uint8_t *cert, size_t cert_size, * @param[out] to notAfter Pointer to date_time object. * @param[in,out] to_size notAfter date_time object size. * - * Note: libspdm_x509_compare_date_time to compare date_time oject + * Note: libspdm_x509_compare_date_time to compare date_time object * x509SetDateTime to get a date_time object from a date_time_str * * @retval true The certificate Validity retrieved successfully. @@ -1659,7 +1659,7 @@ bool libspdm_x509_set_date_time(const char *date_time_str, void *date_time, size * If date_time1 > date_time2, then return 1 * If date_time1 < date_time2, then return -1 * - * @param[in] date_time1 Pointer to a date_time Ojbect + * @param[in] date_time1 Pointer to a date_time Object * @param[in] date_time2 Pointer to a date_time Object * * @retval 0 If date_time1 == date_time2 diff --git a/os_stub/cryptlib_null/pk/x509.c b/os_stub/cryptlib_null/pk/x509.c index 6ecfef56585..a10b7113e45 100644 --- a/os_stub/cryptlib_null/pk/x509.c +++ b/os_stub/cryptlib_null/pk/x509.c @@ -596,7 +596,7 @@ bool libspdm_x509_get_extension_data(const uint8_t *cert, size_t cert_size, * @param[out] to notAfter Pointer to date_time object. * @param[in,out] to_size notAfter date_time object size. * - * Note: libspdm_x509_compare_date_time to compare date_time oject + * Note: libspdm_x509_compare_date_time to compare date_time object * x509SetDateTime to get a date_time object from a date_time_str * * @retval true The certificate Validity retrieved successfully. @@ -712,7 +712,7 @@ bool libspdm_x509_set_date_time(const char *date_time_str, void *date_time, size * If date_time1 > date_time2, then return 1 * If date_time1 < date_time2, then return -1 * - * @param[in] date_time1 Pointer to a date_time Ojbect + * @param[in] date_time1 Pointer to a date_time Object * @param[in] date_time2 Pointer to a date_time Object * * @retval 0 If date_time1 == date_time2 diff --git a/os_stub/cryptlib_openssl/pk/x509.c b/os_stub/cryptlib_openssl/pk/x509.c index ba21a38e246..fabb43ae3cc 100644 --- a/os_stub/cryptlib_openssl/pk/x509.c +++ b/os_stub/cryptlib_openssl/pk/x509.c @@ -1075,7 +1075,7 @@ bool libspdm_x509_get_signature_algorithm(const uint8_t *cert, * @param[out] to notAfter Pointer to date_time object. * @param[in,out] to_size notAfter date_time object size. * - * Note: libspdm_x509_compare_date_time to compare date_time oject + * Note: libspdm_x509_compare_date_time to compare date_time object * x509SetDateTime to get a date_time object from a date_time_str * * @retval true The certificate Validity retrieved successfully. @@ -1248,7 +1248,7 @@ bool libspdm_x509_set_date_time(const char *date_time_str, void *date_time, size * If date_time1 > date_time2, then return 1 * If date_time1 < date_time2, then return -1 * - * @param[in] date_time1 Pointer to a date_time Ojbect + * @param[in] date_time1 Pointer to a date_time Object * @param[in] date_time2 Pointer to a date_time Object * * @retval 0 If date_time1 == date_time2 diff --git a/os_stub/spdm_cert_verify_callback_sample/spdm_cert_verify_callback_internal.h b/os_stub/spdm_cert_verify_callback_sample/spdm_cert_verify_callback_internal.h index 633679a664d..614cd1e1205 100644 --- a/os_stub/spdm_cert_verify_callback_sample/spdm_cert_verify_callback_internal.h +++ b/os_stub/spdm_cert_verify_callback_sample/spdm_cert_verify_callback_internal.h @@ -14,7 +14,7 @@ * * @param spdm_context A pointer to the SPDM context. * @param slot_id The number of slot for the certificate chain. - * This params is not uesed, just for compatible in this function. + * This params is not used, just for compatible in this function. * @param cert_chain_size size in bytes of the certificate chain buffer. * @param cert_chain Certificate chain buffer including spdm_cert_chain_t header. * @param trust_anchor A buffer to hold the trust_anchor which is used to validate the peer certificate, if not NULL. diff --git a/unit_test/test_spdm_common/context_data.c b/unit_test/test_spdm_common/context_data.c index a09873625c2..377db93f2ed 100644 --- a/unit_test/test_spdm_common/context_data.c +++ b/unit_test/test_spdm_common/context_data.c @@ -1564,21 +1564,21 @@ int libspdm_common_context_data_test_main(void) cmocka_unit_test(libspdm_test_set_data_case9), - /* Successful response V1.1 for multi element opaque data supported vesion, element number is 2*/ + /* Successful response V1.1 for multi element opaque data supported version, element number is 2*/ cmocka_unit_test(libspdm_test_process_opaque_data_supported_version_data_case10), - /* Failed response V1.1 for multi element opaque data supported vesion, element id is wrong*/ + /* Failed response V1.1 for multi element opaque data supported version, element id is wrong*/ cmocka_unit_test(libspdm_test_process_opaque_data_supported_version_data_case11), - /* Successful response V1.2 for multi element opaque data supported vesion, element number is 2*/ + /* Successful response V1.2 for multi element opaque data supported version, element number is 2*/ cmocka_unit_test(libspdm_test_process_opaque_data_supported_version_data_case12), - /* Failed response V1.2 for multi element opaque data supported vesion, element id is wrong*/ + /* Failed response V1.2 for multi element opaque data supported version, element id is wrong*/ cmocka_unit_test(libspdm_test_process_opaque_data_supported_version_data_case13), - /* Successful response V1.1 for multi element opaque data selecetion vesion, element number is 2*/ + /* Successful response V1.1 for multi element opaque data selection version, element number is 2*/ cmocka_unit_test(libspdm_test_process_opaque_data_selection_version_data_case14), - /* Failed response V1.1 for multi element opaque data selecetion vesion, element number is wrong*/ + /* Failed response V1.1 for multi element opaque data selection version, element number is wrong*/ cmocka_unit_test(libspdm_test_process_opaque_data_selection_version_data_case15), - /* Successful response V1.2 for multi element opaque data selecetion vesion, element number is 2*/ + /* Successful response V1.2 for multi element opaque data selection version, element number is 2*/ cmocka_unit_test(libspdm_test_process_opaque_data_selection_version_data_case16), - /* Failed response V1.2 for multi element opaque data selecetion vesion, element number is wrong*/ + /* Failed response V1.2 for multi element opaque data selection version, element number is wrong*/ cmocka_unit_test(libspdm_test_process_opaque_data_selection_version_data_case17), /* Successful initialization and setting of secured message context location. */ diff --git a/unit_test/test_spdm_requester/get_version.c b/unit_test/test_spdm_requester/get_version.c index 564f9d98042..8a3b1fdf6c7 100644 --- a/unit_test/test_spdm_requester/get_version.c +++ b/unit_test/test_spdm_requester/get_version.c @@ -700,7 +700,7 @@ static void libspdm_test_requester_get_version_case10(void **state) */ /** - * Test 15: receiving a VERSION message with unordered vesion list. + * Test 15: receiving a VERSION message with unordered version list. * Requester list:5.5, 0.9, 1.0, 1.1 * Responder list:4.2, 5.2, 1.2, 1.1, 1.0 * Expected behavior: client returns a status of LIBSPDM_STATUS_SUCCESS and right negotiated version 1.1.