diff --git a/benchmark/config/user_settings.h b/benchmark/config/user_settings.h index 859ea062..23fe9088 100644 --- a/benchmark/config/user_settings.h +++ b/benchmark/config/user_settings.h @@ -49,7 +49,7 @@ extern "C" { /* For cert manager */ #define NO_TLS -/* Elminates need for IO layer since we only use CM */ +/* Eliminates need for IO layer since we only use CM */ #define WOLFSSL_USER_IO /* For ACert support (also requires WOLFSSL_ASN_TEMPLATE) */ #define WOLFSSL_ACERT @@ -69,7 +69,7 @@ extern "C" { #define NO_MAIN_DRIVER #define NO_WRITE_TEMP_FILES /* Cert buffers required for wolfCrypt tests to not need to run in the wolfSSL - * root directory in conjuction with filesystem usage */ + * root directory in conjunction with filesystem usage */ #define USE_CERT_BUFFERS_256 #define USE_CERT_BUFFERS_1024 #define USE_CERT_BUFFERS_2048 @@ -88,7 +88,7 @@ extern "C" { * client cryptoCb when using non-devId APIs */ #define WC_NO_DEFAULT_DEVID -/** Remove unneded namespace */ +/** Remove unneeded namespace */ #define NO_OLD_RNGNAME #define NO_OLD_WC_NAMES #define NO_OLD_SSL_NAMES diff --git a/examples/README.md b/examples/README.md index 3e85d9db..4973a900 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,6 +1,6 @@ # examples -This directory contains examples code demonstrating how to use various wolfHSM features. The examples provided are split between port-agnostic demo code, and port-specific server/client applications that use the aformentioned demo code. +This directory contains examples code demonstrating how to use various wolfHSM features. The examples provided are split between port-agnostic demo code, and port-specific server/client applications that use the aforementioned demo code. - `demo/`: port-agnostic demonstration code (`demo/`). This code is intended to be used as a reference for how to use wolfHSM features, and are organized by high-level wolfHSM feature. - `port/`: Example server and client applications for each port. These applications initialize the server and client context and then run the demo code. diff --git a/port/README.md b/port/README.md index 3dc4222f..57c2fe01 100644 --- a/port/README.md +++ b/port/README.md @@ -1,5 +1,5 @@ # wolfHSM Ports -Each of the implemented port-specific code and resources are kept in port directories organized first by platform vendor and possibly further by product. Each of the ports is expected to provide the glue logic between wolfHSM abtractions (transport, NVM objects, flash, and cryptocb) and the native or vendor-provided libraries. +Each of the implemented port-specific code and resources are kept in port directories organized first by platform vendor and possibly further by product. Each of the ports is expected to provide the glue logic between wolfHSM abstractions (transport, NVM objects, flash, and cryptocb) and the native or vendor-provided libraries. Due to the sensitive nature of some platform code, not all of the source and glue logic can be provided in this public repo, but the base directories of these ports are listed here with any public interfaces that can be provided and additional contact information. diff --git a/src/wh_nvm.c b/src/wh_nvm.c index b1f3934b..ae6c662d 100644 --- a/src/wh_nvm.c +++ b/src/wh_nvm.c @@ -199,7 +199,7 @@ int wh_Nvm_Read(whNvmContext* context, whNvmId id, whNvmSize offset, return WH_ERROR_BADARGS; } - /* No callcack? Return ABORTED */ + /* No callback? Return ABORTED */ if (context->cb->Read == NULL) { return WH_ERROR_ABORTED; } diff --git a/src/wh_server_customcb.c b/src/wh_server_customcb.c index 8fec3cd5..5e6e3d02 100644 --- a/src/wh_server_customcb.c +++ b/src/wh_server_customcb.c @@ -85,11 +85,11 @@ int wh_Server_HandleCustomCbRequest(whServerContext* server, uint16_t magic, if (server->customHandlerTable[action] != NULL) { /* If this isn't a query to check if the callback exists, invoke the - * registered callback, storing the return value in the reponse */ + * registered callback, storing the return value in the response */ if (req.type != WH_MESSAGE_CUSTOM_CB_TYPE_QUERY) { resp.rc = server->customHandlerTable[action](server, &req, &resp); } - /* TODO: propagate other wolfHSM error codes (requires modifiying caller + /* TODO: propagate other wolfHSM error codes (requires modifying caller * function) once generic server code supports it */ resp.err = WH_ERROR_OK; } @@ -113,4 +113,4 @@ int wh_Server_HandleCustomCbRequest(whServerContext* server, uint16_t magic, return WH_ERROR_OK; } -#endif /* WOLFHSM_CFG_ENABLE_SERVER */ \ No newline at end of file +#endif /* WOLFHSM_CFG_ENABLE_SERVER */ diff --git a/src/wh_server_she.c b/src/wh_server_she.c index 761697e6..eaecd816 100644 --- a/src/wh_server_she.c +++ b/src/wh_server_she.c @@ -1687,7 +1687,7 @@ int wh_Server_HandleSheRequest(whServerContext* server, uint16_t magic, server->she->cmacKeyFound = 0; } - /* Unconditionaly return success so response message is sent, propagating + /* Unconditionally return success so response message is sent, propagating * the error code to the client */ /* TODO: Are there any fatal server errors that should be handled here? */ return 0; diff --git a/test/config/user_settings.h b/test/config/user_settings.h index d494458e..01867a92 100644 --- a/test/config/user_settings.h +++ b/test/config/user_settings.h @@ -49,7 +49,7 @@ extern "C" { /* For cert manager */ #define NO_TLS -/* Elminates need for IO layer since we only use CM */ +/* Eliminates need for IO layer since we only use CM */ #define WOLFSSL_USER_IO /* For ACert support (also requires WOLFSSL_ASN_TEMPLATE) */ #define WOLFSSL_ACERT @@ -70,7 +70,7 @@ extern "C" { #define NO_MAIN_DRIVER #define NO_WRITE_TEMP_FILES /* Cert buffers required for wolfCrypt tests to not need to run in the wolfSSL - * root directory in conjuction with filesystem usage */ + * root directory in conjunction with filesystem usage */ #define USE_CERT_BUFFERS_256 #define USE_CERT_BUFFERS_1024 #define USE_CERT_BUFFERS_2048 @@ -89,7 +89,7 @@ extern "C" { * client cryptoCb when using non-devId APIs */ #define WC_NO_DEFAULT_DEVID -/** Remove unneded namespace */ +/** Remove unneeded namespace */ #define NO_OLD_RNGNAME #define NO_OLD_WC_NAMES #define NO_OLD_SSL_NAMES diff --git a/test/wh_test_clientserver.c b/test/wh_test_clientserver.c index 1a365750..9e218eda 100644 --- a/test/wh_test_clientserver.c +++ b/test/wh_test_clientserver.c @@ -210,7 +210,7 @@ static int _customServerDmaCb(struct whServerContext_t* server, (void)server; (void)flags; - /* remapped "client" address, a.k.a. arbitary "server" buffer */ + /* remapped "client" address, a.k.a. arbitrary "server" buffer */ void* srvTmpBuf = (void*)(clientAddr + (offsetof(TestMemory, srvRemapBufAllow) - offsetof(TestMemory, cliBuf))); diff --git a/test/wh_test_she.c b/test/wh_test_she.c index b1a5cab4..171de40f 100644 --- a/test/wh_test_she.c +++ b/test/wh_test_she.c @@ -251,7 +251,7 @@ int whTest_SheClientConfig(whClientConfig* config) goto exit; } printf("SHE secure boot SUCCESS\n"); - /* load the secret key using pre progam */ + /* load the secret key using pre program */ if ((ret = wh_Client_ShePreProgramKey(client, WH_SHE_SECRET_KEY_ID, 0, secretKey, sizeof(secretKey))) != 0) { WH_ERROR_PRINT("Failed to wh_Client_ShePreProgramKey %d\n", ret); goto exit; diff --git a/tools/whnvmtool/README.md b/tools/whnvmtool/README.md index a131e815..a53454e5 100644 --- a/tools/whnvmtool/README.md +++ b/tools/whnvmtool/README.md @@ -80,7 +80,7 @@ key 1 1 0x0001 0x0000 "My Key" "path/to/key.bin" ## Generated NVM Image -The generated NVM image is a binary file that can be used to initialize an instance of `whNvmFlash` or loaded directly into device memory at a device-specific address. In order for a generated NVM image to be compatible with a wolfHSM server implemenation, the following must be true: +The generated NVM image is a binary file that can be used to initialize an instance of `whNvmFlash` or loaded directly into device memory at a device-specific address. In order for a generated NVM image to be compatible with a wolfHSM server implementation, the following must be true: 1. `whnvmtool` must be compiled against the same version of wolfHSM as the server, and be compiled to use the same value of `WOLFHSM_CFG_NVM_OBJECT_COUNT` 2. The partition size specified for the NVM image must match that of the server's `whNvmFlash` provider diff --git a/tools/whnvmtool/user_settings.h b/tools/whnvmtool/user_settings.h index 150dc409..af8c8e7a 100644 --- a/tools/whnvmtool/user_settings.h +++ b/tools/whnvmtool/user_settings.h @@ -69,7 +69,7 @@ extern "C" { #define WOLFSSL_NO_TLS12 #define NO_DO178 -/** Remove unneded namespace */ +/** Remove unneeded namespace */ #define NO_OLD_RNGNAME #define NO_OLD_WC_NAMES #define NO_OLD_SSL_NAMES diff --git a/wolfhsm/wh_client.h b/wolfhsm/wh_client.h index 9d82169b..42e0beff 100644 --- a/wolfhsm/wh_client.h +++ b/wolfhsm/wh_client.h @@ -235,7 +235,7 @@ int wh_Client_CommInfoRequest(whClientContext* c); * Growth: * @param[out] out_debug_state Pointer to store the server's current debug state * @param[out] out_boot_state Pointer to store the server's current boot state - * @param[out] out_lifecycle_state Pointer to store the server's lifecyle state + * @param[out] out_lifecycle_state Pointer to store the server's lifecycle state * @param[out] out_nvm_state Pointer to store the server's current nvm state * * @return int Returns 0 on success, or a negative error code on failure. @@ -285,7 +285,7 @@ int wh_Client_CommInfoResponse(whClientContext* c, * Growth: * @param[out] out_debug_state Pointer to store the server's current debug state * @param[out] out_boot_state Pointer to store the server's current boot state - * @param[out] out_lifecycle_state Pointer to store the server's lifecyle state + * @param[out] out_lifecycle_state Pointer to store the server's lifecycle state * @param[out] out_nvm_state Pointer to store the server's current nvm state * * @return int Returns 0 on success, or a negative error code on failure. @@ -347,7 +347,7 @@ int wh_Client_DisableCancel(whClientContext* c); * * This function sends a cancellation request to the server to cancel the * previous request made. Does not wait for the response which must be handled - * seperately + * separately * * @param[in] c Pointer to the client context. * @return int Returns 0 on success, or a negative error code on failure. diff --git a/wolfhsm/wh_client_crypto.h b/wolfhsm/wh_client_crypto.h index c6083574..fc5dba09 100644 --- a/wolfhsm/wh_client_crypto.h +++ b/wolfhsm/wh_client_crypto.h @@ -116,7 +116,7 @@ int wh_Client_Curve25519ImportKey(whClientContext* ctx, curve25519_key* key, * and decodes it into the wolfCrypt curve25519 key structure. * * This function exports the specified key from wolfHSM server key cache as a - * serailized byte array and decodes the key into the wolfCrypt curve25519_key + * serialized byte array and decodes the key into the wolfCrypt curve25519_key * structure, optionally copying out the associated label as well. * * @param[in] ctx Pointer to the wolfHSM client structure. diff --git a/wolfhsm/wh_comm.h b/wolfhsm/wh_comm.h index c549834e..4b77d58f 100644 --- a/wolfhsm/wh_comm.h +++ b/wolfhsm/wh_comm.h @@ -26,7 +26,7 @@ * size and provide the number of bytes received. * * Note: Multibyte data will be passed in native order, which means clients and - * servers must be the SAME endianess or will be required to translate data + * servers must be the SAME endianness or will be required to translate data * elements in messages. Translate helper functions are provided here and used * to interpret header fields. * diff --git a/wolfhsm/wh_crypto.h b/wolfhsm/wh_crypto.h index c6419a05..497f0044 100644 --- a/wolfhsm/wh_crypto.h +++ b/wolfhsm/wh_crypto.h @@ -68,7 +68,7 @@ int wh_Crypto_EccDeserializeKeyDer(const uint8_t* buffer, uint16_t pub_size, ecc_key* key); /* Helper to update an ECC private-only key with the corresponding public key, - * similiar to wc_ecc_make_pub(). The incoming byte array of the public key is + * similar to wc_ecc_make_pub(). The incoming byte array of the public key is * expected to have been exported using wc_EccPublicKeyToDer(). */ int wh_Crypto_EccUpdatePrivateOnlyKeyDer(ecc_key* key, uint16_t pub_size, diff --git a/wolfhsm/wh_message_customcb.h b/wolfhsm/wh_message_customcb.h index 9ca1460e..6bfbb078 100644 --- a/wolfhsm/wh_message_customcb.h +++ b/wolfhsm/wh_message_customcb.h @@ -70,14 +70,14 @@ typedef union { /* request message to the custom server callback */ typedef struct { - uint32_t id; /* indentifier of registered callback */ + uint32_t id; /* identifier of registered callback */ uint32_t type; /* whMessageCustomCb_Type */ whMessageCustomCb_Data data; } whMessageCustomCb_Request; /* response message from the custom server callback */ typedef struct { - uint32_t id; /* indentifier of registered callback */ + uint32_t id; /* identifier of registered callback */ uint32_t type; /* whMessageCustomCb_Type */ int32_t rc; /* Return code from custom callback. Invalid if err != 0 */ int32_t err; /* wolfHSM-specific error. If err != 0, rc is invalid */ diff --git a/wolfhsm/wh_settings.h b/wolfhsm/wh_settings.h index f84674bb..f02d501b 100644 --- a/wolfhsm/wh_settings.h +++ b/wolfhsm/wh_settings.h @@ -83,14 +83,14 @@ * XCACHELINE - Size in bytes of a cache line * Default: 32 * - * #ifndef XCACHEFLUSH(ptr) - Flush the cache line uncluding ptr + * #ifndef XCACHEFLUSH(ptr) - Flush the cache line including ptr * DefaultL (void)(ptr) * * #ifndef XCACHEFLUSHBLK(ptr, n) - Flush the cache lines starting at ptr for * at least n bytes * DefaultL wh_Utils_CacheFlush(ptr, n) * - * #ifndef XCACHEINVLD(ptr) - Invalidate the cache line uncluding ptr + * #ifndef XCACHEINVLD(ptr) - Invalidate the cache line including ptr * DefaultL (void)(ptr) * * #ifndef XCACHEINVLDBLK(ptr, n) - Invalidate the cache lines starting at ptr