Skip to content
Merged
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
6 changes: 3 additions & 3 deletions benchmark/config/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion port/README.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion src/wh_nvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions src/wh_server_customcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -113,4 +113,4 @@ int wh_Server_HandleCustomCbRequest(whServerContext* server, uint16_t magic,
return WH_ERROR_OK;
}

#endif /* WOLFHSM_CFG_ENABLE_SERVER */
#endif /* WOLFHSM_CFG_ENABLE_SERVER */
2 changes: 1 addition & 1 deletion src/wh_server_she.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions test/config/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/wh_test_clientserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
2 changes: 1 addition & 1 deletion test/wh_test_she.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tools/whnvmtool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/whnvmtool/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions wolfhsm/wh_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion wolfhsm/wh_client_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion wolfhsm/wh_comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion wolfhsm/wh_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions wolfhsm/wh_message_customcb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions wolfhsm/wh_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down