Skip to content

Commit aa278d7

Browse files
manojkiranedasteven-bellock
authored andcommitted
Fix spelling mistakes across the repository
Spelling mistakes were identified using the following command: $ codespell -w $(find . -type f \( -iname \*.c -o -iname \*.h -o -iname \*.md \)) Wherever possible, codespell automatically fixed the errors. For any issues that could not be automatically corrected, those were addressed manually. Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
1 parent 5b657a3 commit aa278d7

File tree

30 files changed

+115
-115
lines changed

30 files changed

+115
-115
lines changed

doc/api/common_api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Enumeration value used for the `libspdm_set_data` and/or `libspdm_get_data` func
118118
timing." and is in units of microseconds. This value is only used by a Requester and is used
119119
in the following scenarios.
120120
- It is the value of the `timeout` argument in `libspdm_device_send_message_func`. When
121-
sending a message this is a worst-case value, and the implementor of the function is free
121+
sending a message this is a worst-case value, and the implementer of the function is free
122122
to reduce the timeout value based on knowledge of the underlying transport.
123123
- It is added to the Responder's `CT` or `ST1` value and passed via the `timeout` argument
124124
in `libspdm_device_receive_message_func`.

doc/api/secured_message_api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ destination buffer.
125125
This function should only be called after the session has been fully established and
126126
`libspdm_secured_message_get_session_state()` returns `LIBSPDM_SESSION_STATE_ESTABLISHED`.
127127

128-
The structure is packed and is layed out as
128+
The structure is packed and is laid out as
129129
- Struct Version (4 bytes)
130130
- AEAD Key Size (4 bytes)
131131
- AEAD IV Size (4 bytes)

doc/fips.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ If FIPS mode is enabled, then only FIPS-approved algorithms will be enabled, whi
7777

7878
### Key zeroization
7979

80-
If a key is not used, then the variable to hold the key must be explictly zeroized. This is done in the libspdm.
80+
If a key is not used, then the variable to hold the key must be explicitly zeroized. This is done in the libspdm.
8181

8282
The private key for signing is managed by the [requester-asymsignlib](https://github.com/DMTF/libspdm/blob/main/include/hal/library/requester/reqasymsignlib.h) and [responder-asymlib](https://github.com/DMTF/libspdm/blob/main/include/hal/library/responder/asymsignlib.h). The library provider shall guarantee the key is zeroized after use.
8383

@@ -132,4 +132,4 @@ The expected step is as follows:
132132
#endif
133133
```
134134

135-
NOTE: If a crypto library does not support a FIPS algorithm, then the algorithm must be disabled explictly. Otherwise `libspdm_fips_run_selftest()` will fail. For example, if the integrator links libspdm with mbedtls, then SHA3 and RdDSA related algorithms must be disabled via `LIBSPDM_SHA3_256_SUPPORT=0`, `LIBSPDM_SHA3_384_SUPPORT=0`, `LIBSPDM_SHA3_512_SUPPORT=0`, `LIBSPDM_EDDSA_ED25519_SUPPORT=0`, `LIBSPDM_EDDSA_ED448_SUPPORT=0`, because they are not supported by mbedtls yet.
135+
NOTE: If a crypto library does not support a FIPS algorithm, then the algorithm must be disabled explicitly. Otherwise `libspdm_fips_run_selftest()` will fail. For example, if the integrator links libspdm with mbedtls, then SHA3 and RdDSA related algorithms must be disabled via `LIBSPDM_SHA3_256_SUPPORT=0`, `LIBSPDM_SHA3_384_SUPPORT=0`, `LIBSPDM_SHA3_512_SUPPORT=0`, `LIBSPDM_EDDSA_ED25519_SUPPORT=0`, `LIBSPDM_EDDSA_ED448_SUPPORT=0`, because they are not supported by mbedtls yet.

doc/test.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ For riscv64 (RISCV64 GCC): `qemu-riscv64 -L /usr/riscv64-linux-gnu <TestBinary>`
603603

604604
The output binary is created by the [goto-cc](https://github.com/diffblue/cbmc/blob/develop/doc/cprover-manual/goto-cc.md).
605605

606-
For more infomration on how to use [CBMC](https://github.com/diffblue/cbmc/), refer to [CBMC Manual](https://github.com/diffblue/cbmc/tree/develop/doc/cprover-manual), such as [properties](https://github.com/diffblue/cbmc/blob/develop/doc/cprover-manual/properties.md), [modeling-nondeterminism](https://github.com/diffblue/cbmc/blob/develop/doc/cprover-manual/modeling-nondeterminism.md), [api](https://github.com/diffblue/cbmc/blob/develop/doc/cprover-manual/api.md). Example below:
606+
For more information on how to use [CBMC](https://github.com/diffblue/cbmc/), refer to [CBMC Manual](https://github.com/diffblue/cbmc/tree/develop/doc/cprover-manual), such as [properties](https://github.com/diffblue/cbmc/blob/develop/doc/cprover-manual/properties.md), [modeling-nondeterminism](https://github.com/diffblue/cbmc/blob/develop/doc/cprover-manual/modeling-nondeterminism.md), [api](https://github.com/diffblue/cbmc/blob/develop/doc/cprover-manual/api.md). Example below:
607607

608608
Using [goto-instrument](https://github.com/diffblue/cbmc/blob/develop/doc/cprover-manual/goto-instrument.md) static analyzer operates on goto-binaries and generate a modified binary:
609609
`goto-instrument SpdmRequester.exe SpdmRequester.gb <instrumentation-options>`

os_stub/cryptlib_mbedtls/pk/x509.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ bool libspdm_x509_verify_cert_chain(const uint8_t *root_cert, size_t root_cert_l
712712
current_cert = (const unsigned char *)cert_chain;
713713

714714

715-
/* Get Current certificate from certificates buffer and Verify with preciding cert*/
715+
/* Get Current certificate from certificates buffer and Verify with preceding cert*/
716716

717717
do {
718718
tmp_ptr = current_cert;
@@ -1750,7 +1750,7 @@ static bool libspdm_convert_subject_to_string(uint8_t *ptr, size_t obj_len,
17501750
/*move to next SET*/
17511751
ptr += obj_len;
17521752

1753-
/*sequece*/
1753+
/*sequence*/
17541754
ret = libspdm_asn1_get_tag(&internal_p, end, &obj_len,
17551755
LIBSPDM_CRYPTO_ASN1_SEQUENCE | LIBSPDM_CRYPTO_ASN1_CONSTRUCTED);
17561756
if (!ret) {
@@ -1855,7 +1855,7 @@ bool libspdm_set_attribute_for_req(mbedtls_x509write_csr *req,
18551855

18561856
/*integer:version*/
18571857
ret = libspdm_asn1_get_tag(&ptr, end, &obj_len, LIBSPDM_CRYPTO_ASN1_INTEGER);
1858-
/*check req_info verson. spec PKCS#10: It shall be 0 for this version of the standard.*/
1858+
/*check req_info version. spec PKCS#10: It shall be 0 for this version of the standard.*/
18591859
if ((obj_len != 1) || (*ptr != 0)) {
18601860
return false;
18611861
}

os_stub/cryptlib_null/pk/x509.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -313,16 +313,16 @@ bool libspdm_x509_verify_cert(const uint8_t *cert, size_t cert_size,
313313
*
314314
* @param[in] cert_chain One or more ASN.1 DER-encoded X.509 certificates
315315
* where the first certificate is signed by the Root
316-
* Certificate or is the Root Cerificate itself. and
317-
* subsequent cerificate is signed by the preceding
318-
* cerificate.
316+
* Certificate or is the Root Certificate itself. and
317+
* subsequent certificate is signed by the preceding
318+
* certificate.
319319
* @param[in] cert_chain_length Total length of the certificate chain, in bytes.
320320
*
321321
* @param[in] root_cert Trusted Root Certificate buffer
322322
*
323323
* @param[in] root_cert_length Trusted Root Certificate buffer length
324324
*
325-
* @retval true All cerificates was issued by the first certificate in X509Certchain.
325+
* @retval true All certificates was issued by the first certificate in X509Certchain.
326326
* @retval false Invalid certificate or the certificate was not issued by the given
327327
* trusted CA.
328328
**/
@@ -338,9 +338,9 @@ bool libspdm_x509_verify_cert_chain(const uint8_t *root_cert, size_t root_cert_l
338338
*
339339
* @param[in] cert_chain One or more ASN.1 DER-encoded X.509 certificates
340340
* where the first certificate is signed by the Root
341-
* Certificate or is the Root Cerificate itself. and
342-
* subsequent cerificate is signed by the preceding
343-
* cerificate.
341+
* Certificate or is the Root Certificate itself. and
342+
* subsequent certificate is signed by the preceding
343+
* certificate.
344344
* @param[in] cert_chain_length Total length of the certificate chain, in bytes.
345345
*
346346
* @param[in] cert_index index of certificate.

os_stub/cryptlib_openssl/pk/x509.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ libspdm_internal_x509_get_nid_name(X509_NAME *x509_name, const int32_t request_n
417417
}
418418

419419

420-
/* Retrive the string from X.509 Subject base on the request_nid*/
420+
/* Retrieve the string from X.509 Subject base on the request_nid*/
421421

422422
index = X509_NAME_get_index_by_NID(x509_name, request_nid, -1);
423423
if (index < 0) {
@@ -1996,16 +1996,16 @@ bool libspdm_x509_get_tbs_cert(const uint8_t *cert, size_t cert_size,
19961996
*
19971997
* @param[in] cert_chain One or more ASN.1 DER-encoded X.509 certificates
19981998
* where the first certificate is signed by the Root
1999-
* Certificate or is the Root Cerificate itself. and
2000-
* subsequent cerificate is signed by the preceding
2001-
* cerificate.
1999+
* Certificate or is the Root Certificate itself. and
2000+
* subsequent certificate is signed by the preceding
2001+
* certificate.
20022002
* @param[in] cert_chain_length Total length of the certificate chain, in bytes.
20032003
*
20042004
* @param[in] root_cert Trusted Root Certificate buffer
20052005
*
20062006
* @param[in] root_cert_length Trusted Root Certificate buffer length
20072007
*
2008-
* @retval true All cerificates was issued by the first certificate in X509Certchain.
2008+
* @retval true All certificates was issued by the first certificate in X509Certchain.
20092009
* @retval false Invalid certificate or the certificate was not issued by the given
20102010
* trusted CA.
20112011
**/
@@ -2113,9 +2113,9 @@ bool libspdm_x509_verify_cert_chain(const uint8_t *root_cert, size_t root_cert_l
21132113
*
21142114
* @param[in] cert_chain One or more ASN.1 DER-encoded X.509 certificates
21152115
* where the first certificate is signed by the Root
2116-
* Certificate or is the Root Cerificate itself. and
2117-
* subsequent cerificate is signed by the preceding
2118-
* cerificate.
2116+
* Certificate or is the Root Certificate itself. and
2117+
* subsequent certificate is signed by the preceding
2118+
* certificate.
21192119
* @param[in] cert_chain_length Total length of the certificate chain, in bytes.
21202120
*
21212121
* @param[in] cert_index index of certificate.
@@ -2354,7 +2354,7 @@ bool libspdm_set_attribute_for_req(X509_REQ *req, uint8_t *req_info, size_t req_
23542354

23552355
/*integer:version*/
23562356
ret = libspdm_asn1_get_tag(&ptr, end, &obj_len, LIBSPDM_CRYPTO_ASN1_INTEGER);
2357-
/*check req_info verson. spec PKCS#10: It shall be 0 for this version of the standard.*/
2357+
/*check req_info version. spec PKCS#10: It shall be 0 for this version of the standard.*/
23582358
if ((obj_len != 1) || (*ptr != 0)) {
23592359
return false;
23602360
}
@@ -2401,7 +2401,7 @@ bool libspdm_set_attribute_for_req(X509_REQ *req, uint8_t *req_info, size_t req_
24012401
LIBSPDM_CRYPTO_ASN1_SEQUENCE |
24022402
LIBSPDM_CRYPTO_ASN1_CONSTRUCTED);
24032403
if (ret) {
2404-
/*save old positon*/
2404+
/*save old position*/
24052405
ptr_old = ptr;
24062406

24072407
/*move to the next sequence*/

os_stub/debuglib/debuglib.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void libspdm_debug_print(size_t error_level, const char *format, ...)
7373
status = vsnprintf(buffer, sizeof(buffer), format, marker);
7474
va_end(marker);
7575

76-
/* If status is negative then an encoding error has ocurred. */
76+
/* If status is negative then an encoding error has occurred. */
7777
assert(status >= 0);
7878
/* If status is greater than or equal to the size of the buffer then the buffer is not
7979
* large enough to handle the formatted string. */

os_stub/mbedtlslib/include/mbedtls/libspdm_mbedtls_config.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@
11391139
* MBEDTLS_ECP_DP_SECP256R1_ENABLED
11401140
*
11411141
* \warning If SHA-256 is provided only by a PSA driver, you must call
1142-
* psa_crypto_init() before the first hanshake (even if
1142+
* psa_crypto_init() before the first handshake (even if
11431143
* MBEDTLS_USE_PSA_CRYPTO is disabled).
11441144
*
11451145
* This enables the following ciphersuites (if other requisites are
@@ -1633,7 +1633,7 @@
16331633
* functions mbedtls_ssl_context_save() and mbedtls_ssl_context_load().
16341634
*
16351635
* This pair of functions allows one side of a connection to serialize the
1636-
* context associated with the connection, then free or re-use that context
1636+
* context associated with the connection, then free or reuse that context
16371637
* while the serialized state is persisted elsewhere, and finally deserialize
16381638
* that state to a live context for resuming read/write operations on the
16391639
* connection. From a protocol perspective, the state of the connection is
@@ -2646,7 +2646,7 @@
26462646
* The CTR_DRBG generator uses AES-256 by default.
26472647
* To use AES-128 instead, enable \c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY above.
26482648
*
2649-
* AES support can either be achived through builtin (MBEDTLS_AES_C) or PSA.
2649+
* AES support can either be achieved through builtin (MBEDTLS_AES_C) or PSA.
26502650
* Builtin is the default option when MBEDTLS_AES_C is defined otherwise PSA
26512651
* is used.
26522652
*

os_stub/spdm_device_secret_lib_sample/read_special_cert.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ bool libspdm_read_responder_public_certificate_chain_by_size(
114114

115115
is_requester_cert = false;
116116

117-
/*defalut is true*/
117+
/*default is true*/
118118
is_device_cert_model = true;
119119

120120
*data = NULL;

unit_test/fuzzing/test_requester/test_spdm_requester_key_update/key_update.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ void libspdm_run_test_harness(void *test_buffer, size_t test_buffer_size)
322322
libspdm_test_requester_key_update_case1(&State);
323323
libspdm_unit_test_group_teardown(&State);
324324

325-
/* Sucessful response update all keys*/
325+
/* Successful response update all keys*/
326326
libspdm_unit_test_group_setup(&State);
327327
libspdm_test_requester_key_update_case2(&State);
328328
libspdm_unit_test_group_teardown(&State);

unit_test/fuzzing/test_responder/test_spdm_responder_algorithms/algorithms.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -476,32 +476,32 @@ void libspdm_run_test_harness(void *test_buffer, size_t test_buffer_size)
476476
libspdm_test_responder_algorithms_case2(&State);
477477
libspdm_unit_test_group_teardown(&State);
478478

479-
/* Support capablities flag: SPDM_GET_CAPABILITIES_REQUEST_FLAGS_MAC_CAP*/
479+
/* Support capabilities flag: SPDM_GET_CAPABILITIES_REQUEST_FLAGS_MAC_CAP*/
480480
libspdm_unit_test_group_setup(&State);
481481
libspdm_test_responder_algorithms_case3(&State);
482482
libspdm_unit_test_group_teardown(&State);
483483

484-
/* Support capablities flag */
484+
/* Support capabilities flag */
485485
libspdm_unit_test_group_setup(&State);
486486
libspdm_test_responder_algorithms_case4(&State);
487487
libspdm_unit_test_group_teardown(&State);
488488

489-
/* Support capablities flag: SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MUT_AUTH_CAP*/
489+
/* Support capabilities flag: SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MUT_AUTH_CAP*/
490490
libspdm_unit_test_group_setup(&State);
491491
libspdm_test_responder_algorithms_case5(&State);
492492
libspdm_unit_test_group_teardown(&State);
493493

494-
/* Support capablities flag: SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MUT_AUTH_CAP */
494+
/* Support capabilities flag: SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MUT_AUTH_CAP */
495495
libspdm_unit_test_group_setup(&State);
496496
libspdm_test_responder_algorithms_case6(&State);
497497
libspdm_unit_test_group_teardown(&State);
498498

499-
/* Support capablities flag: SPDM_GET_CAPABILITIES_REQUEST_FLAGS_KEY_EX_CAP*/
499+
/* Support capabilities flag: SPDM_GET_CAPABILITIES_REQUEST_FLAGS_KEY_EX_CAP*/
500500
libspdm_unit_test_group_setup(&State);
501501
libspdm_test_responder_algorithms_case7(&State);
502502
libspdm_unit_test_group_teardown(&State);
503503

504-
/* Support capablities flag: SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_PSK_CAP*/
504+
/* Support capabilities flag: SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_PSK_CAP*/
505505
libspdm_unit_test_group_setup(&State);
506506
libspdm_test_responder_algorithms_case8(&State);
507507
libspdm_unit_test_group_teardown(&State);
@@ -511,7 +511,7 @@ void libspdm_run_test_harness(void *test_buffer, size_t test_buffer_size)
511511
libspdm_test_responder_algorithms_case9(&State);
512512
libspdm_unit_test_group_teardown(&State);
513513

514-
/* capablities: SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MEAS_CAP */
514+
/* capabilities: SPDM_GET_CAPABILITIES_RESPONSE_FLAGS_MEAS_CAP */
515515
libspdm_unit_test_group_setup(&State);
516516
libspdm_test_responder_algorithms_case10(&State);
517517
libspdm_unit_test_group_teardown(&State);

unit_test/fuzzing/test_responder/test_spdm_responder_chunk_get/chunk_get.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ void libspdm_run_test_harness(void *test_buffer, size_t test_buffer_size)
325325
libspdm_test_responder_chunk_get_case3(&State);
326326
libspdm_unit_test_group_teardown(&State);
327327

328-
/* Succesful request of chunk, where size is exactly max chunk size */
328+
/* Successful request of chunk, where size is exactly max chunk size */
329329
libspdm_unit_test_group_setup(&State);
330330
libspdm_test_responder_chunk_get_case4(&State);
331331
libspdm_unit_test_group_teardown(&State);

unit_test/test_spdm_common/context_data.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ size_t libspdm_get_multi_element_opaque_data_supported_version_data_size(
103103
* On input, it means the size in bytes of data_out buffer.
104104
* On output, it means the size in bytes of copied data_out buffer if RETURN_SUCCESS is returned,
105105
* and means the size in bytes of desired data_out buffer if RETURN_BUFFER_TOO_SMALL is returned.
106-
* @param data_out[in] A pointer to the desination buffer to store the opaque data supported version.
106+
* @param data_out[in] A pointer to the destination buffer to store the opaque data supported version.
107107
* @param element_num[in] in this test function, the element number < 9 is right. because element id is changed with element_index
108108
*
109109
* @retval RETURN_SUCCESS The opaque data supported version is built successfully.
@@ -266,7 +266,7 @@ size_t libspdm_get_multi_element_opaque_data_version_selection_data_size(
266266
* On input, it means the size in bytes of data_out buffer.
267267
* On output, it means the size in bytes of copied data_out buffer if RETURN_SUCCESS is returned,
268268
* and means the size in bytes of desired data_out buffer if RETURN_BUFFER_TOO_SMALL is returned.
269-
* @param data_out[in] A pointer to the desination buffer to store the opaque data selection version.
269+
* @param data_out[in] A pointer to the destination buffer to store the opaque data selection version.
270270
* @param element_num[in] in this test function, the element number < 9 is right. because element id is changed with element_index
271271
*
272272
* @retval RETURN_SUCCESS The opaque data selection version is built successfully.

0 commit comments

Comments
 (0)