Skip to content

Commit 9682aa6

Browse files
author
Ruby Martin
committed
addressed broken links, grammar changes, and other suggestions
1 parent 0ed14cc commit 9682aa6

File tree

5 files changed

+22
-50
lines changed

5 files changed

+22
-50
lines changed

wolfHSM/src/chapter03.md

+12-40
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The most common use case for wolfHSM is adding HSM-enabled functionality to an e
44

55
The first step required to run wolfHSM on a device is to follow the steps in the specific wolfHSM port to get the reference server running on the HSM core. Once the wolfHSM server app is loaded on the device and boots, client applications can link against the wolfHSM client library, configure an instance of the wolfHSM client structure, and interact with the HSM through the wolfHSM client API and through the wolfCrypt API.
66

7-
Each wolfHSM port contains a client demo app showing how to set up the default communication channel and interact with the server. The server reference implementation can also be customized through [server callbacks](./chapter07-customizing-wolfHSM.md) to extend its functionality, which can be invoked through client requests.
7+
Each wolfHSM port contains a client demo app showing how to set up the default communication channel and interact with the server. The server reference implementation can also be customized through [server callbacks](./chapter07.md) to extend its functionality, which can be invoked through client requests.
88

99
## Basic Client Configuration
1010

@@ -79,60 +79,32 @@ if ((recvLen != sendLen ) ||
7979
}
8080
```
8181

82-
While there are indeed a large number of nested configurations and structures to set up, designing wolfHSM this way allowed for different transport implementations to be swapped in and out easily without changing the client code. For example, in order to switch from the shared memory transport to a TCP transport, only the transport configuration and callback structures need to be changed, and the rest of the client code remains the same (everything after step 2 in the sequence above).
83-
84-
```c
85-
#include <string.h> /* for memcmp() */
86-
#include "wolfhsm/client.h" /* Client API (includes comm config) */
87-
#include "port/posix_transport_tcp.h" /* transport implementation */
88-
89-
/* Step 1: Allocate and initialize the posix TCP transport configuration */
90-
/* Client configuration/contexts */
91-
whTransportClientCb posixTransportTcpCb = {PTT_CLIENT_CB};
92-
posixTransportTcpClientContext posixTranportTcpCtx = {0};
93-
posixTransportTcpConfig posixTransportTcpCfg = {
94-
/* IP and port configuration */
95-
};
96-
97-
/* Step 2: Allocate client comm configuration and bind to the transport */
98-
/* Configure the client comms to use the selected transport configuration */
99-
whCommClientConfig commClientCfg = {
100-
.transport_cb = posixTransportTcpCb,
101-
.transport_context = (void*)posixTransportTcpCtx,
102-
.transport_config = (void*)posixTransportTcpCfg,
103-
.client_id = 123, /* unique client identifier */
104-
};
105-
106-
/* Subsequent steps remain the same... */
107-
```
108-
109-
Note that the echo request in step 6 is just a simple usage example. Once the connection to the server is set up, any of the client APIs are available for use.
82+
For more information, refer to [Chapter 5: Client Library](./chapter05.md).
11083

11184
## Basic Server Configuration
11285

113-
*Note: A wolfHSM port comes with a referenc
114-
e server application that is already configured to run on the HSM core and so manual server configuration is not required.*
86+
*Note: A wolfHSM port comes with a reference server application that is already configured to run on the HSM core and so manual server configuration is not required.*
11587

11688
Configuring a wolfHSM server involves allocating a server context structure and initializing it with a valid client configuration that enables it to perform the requested operations. These operations usually include client communication, cryptographic operations, managing keys, and non-volatile object storage. Depending on the required functionality, not all of these configuration components need to be initialized.
11789

11890

11991
The steps required to configure a server that supports client communication, NVM object storage using the NVM flash configuration, and local crypto (software only) are:
12092

121-
1. Initialize the server comms configuration
122-
1. Allocate and initialize a transport configuration structure, context, and callback implementation for the desired transport
123-
2. Allocate and initialize a comm server configuration structure using the transport configuration from step 1.1
124-
2. Initialize the server NVM context
125-
1. Allocate and initialize a config, context, and callback structure for the low-level flash storage drivers (the implementation of these structures is provided by the port)
126-
2. Allocate and initialize an NVM flash config, context, and callback strucure and bind the port flash configuration from step 2.1 to them
127-
3. Allocate an NVM context structure and initialize it with the configuration from step 2.2 using `wh_Nvm_Init()`
93+
1. Initialize the server comms configuration
94+
1\. Allocate and initialize a transport configuration structure, context, and callback implementation for the desired transport
95+
2\. Allocate and initialize a comm server configuration structure using the transport configuration from step 1.1
96+
2. Initialize the server NVM context
97+
1\. Allocate and initialize a config, context, and callback structure for the low-level flash storage drivers (the implementation of these structures is provided by the port)
98+
2\. Allocate and initialize an NVM flash config, context, and callback strucure and bind the port flash configuration from step 2.1 to them
99+
3\. Allocate an NVM context structure and initialize it with the configuration from step 2.2 using `wh_Nvm_Init()`
128100
3. Allocate and initialize a crypto context structure for the server
129101
4. Initialize wolfCrypt (before initializing the server)
130102
5. Allocate and initialize a server config structure and bind the comm server configuration, NVM context, and crypto context to it
131103
6. Allocate a server context structure and initialize it with the server configuration using `wh_Server_Init()`
132-
7. Set the server connection state to connected using `wh_Server_SetConnected()` when the underlying transport is ready to be used for client communication (see [TODO](todo) for more information)
104+
7. Set the server connection state to connected using `wh_Server_SetConnected()` when the underlying transport is ready to be used for client communication (see [wolfHSM Examples](https://github.com/wolfSSL/wolfHSM-examples) for more information)
133105
8. Process client requests using `wh_Server_HandleRequestMessage()`
134106

135-
The server may be configured to support NVM object storage using NVM flash configuration. Include the steps to [initialize NVM](./chapter04-functional-components.md#NVM-Architecture) on the server after step 1.
107+
The server may be configured to support NVM object storage using NVM flash configuration. Include the steps to [initialize NVM](./chapter04.md#NVM-Architecture) on the server after step 1.
136108

137109
```c
138110
#include <string.h> /* for memcmp() */

wolfHSM/src/chapter04.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ The communication layer of wolfHSM is designed to provide reliable, bidirectiona
7575
- Comms layer: Defines the format and structure of messages exchanged between clients and servers, and provides an abstract interface to the underlying transport layer implementation, exposing a consistent interface for sending and receiving messages.
7676
- Transport Layer: Concrete implementations of the underlying transport. Defines how data is actually transported between client and server.
7777
78-
### Client/Server APIs:
78+
### Client/Server APIs
7979
80-
High level client and server APIs (defined in [wh_client.h](wolfhsm/wh_client.h) and [wh_server.h](wolfhsm/wh_server.h)) are the primary interface for communication. These functions abstract the low level communications details from the caller, providing a simple split transaction interface for logical operations.
80+
High-level client and server APIs (defined in `wolfhsm/wh_client.h` and `wolfhsm/wh_server.h`) are the primary interface for communication. These functions abstract the low level communications details from the caller, providing a simple split transaction interface for logical operations.
8181
8282
For example, using the client API to send an echo request to the server:
8383
@@ -247,7 +247,7 @@ Currently, wolfHSM only supports one NVM back-end provider: the NVM flash module
247247

248248
## Key Management
249249

250-
The wolfHSM library provides comprehensive key management capabilities, including storing, loading, and exporting keys from non-volatile memory, caching of frequently used keys in RAM for fast access, and interacting with hardware-exclusive device keys. Keys are stored in non-volatile memory along side other NVM objects with corresponding access protections. wolfHSM will automatically load keys into the necessary cryptographic hardware when the key is selected for use with a specific consumer. More information on the key management API can be found in the [client library](./chapter05-client-library.md) and [API documentation](./appendix01-api-reference.md) sections.
250+
The wolfHSM library provides comprehensive key management capabilities, including storing, loading, and exporting keys from non-volatile memory, caching of frequently used keys in RAM for fast access, and interacting with hardware-exclusive device keys. Keys are stored in non-volatile memory along side other NVM objects with corresponding access protections. wolfHSM will automatically load keys into the necessary cryptographic hardware when the key is selected for use with a specific consumer. More information on the key management API can be found in the [client library](./chapter05.md) and [API documentation](./appendix01.md) sections.
251251

252252
## Cryptographic Operations
253253

wolfHSM/src/chapter05.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# wolfHSM Client Library
22

3-
The client library API is the primary mechanism through which users will interact with wolfHSM. Refer to the [API documentation](appendix01-api-reference.md) for a full list of available functions and their descriptions.
3+
The client library API is the primary mechanism through which users will interact with wolfHSM. Refer to the [API documentation](appendix01.md) for a full list of available functions and their descriptions.
44

55
## Table of Contents
66

@@ -196,7 +196,7 @@ byte myUpdate[] = “This is my update.”
196196
whClient_NvmAddObject(&clientCtx, &myMeta, sizeof(myUpdate), myUpdate);
197197
```
198198

199-
For objects that should not be copied and sent over the transport, there exist DMA versions of the `NvmAddObject` functions. These pass the data to the server by reference rather than by value, allowing the server to access the data in memory directly. Note that if your platform requires custom address translation or cache invalidation before the server may access client addresses, you will need to implement a [DMA callback](TODO).
199+
For objects that should not be copied and sent over the transport, there exist DMA versions of the `NvmAddObject` functions. These pass the data to the server by reference rather than by value, allowing the server to access the data in memory directly. Note that if your platform requires custom address translation or cache invalidation before the server may access client addresses, you will need to implement a [DMA callback](./chapter07#DMA-Callbacks).
200200

201201
```
202202
whNvmMetadata myMeta = {
@@ -248,7 +248,7 @@ int wh_Client_NvmList(whClientContext* c,
248248
int32_t *out_rc, whNvmId *out_count, whNvmId *out_id);
249249
```
250250
251-
For a full description of all the NVM API functions, please refer to the [API documentation](todo).
251+
For a full description of all the NVM API functions, please refer to the [API documentation](./appendix01.md).
252252
253253
## Key Management
254254

wolfHSM/src/chapter07.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The wolfHSM library has a number of build options that can be turned on or off t
1313

1414
An example `wh_config.h` is distributed with every wolfHSM port providing a known good configuration.
1515

16-
For a full list of wolfHSM configuration settings that can be defined in `wh_config.h`, refer to the [API documentation](appendix01-api-reference.md).
16+
For a full list of wolfHSM configuration settings that can be defined in `wh_config.h`, refer to the [API documentation](appendix01.md).
1717

1818
## DMA Callbacks
1919

wolfHSM/src/chapter08.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ ST SPC58NN
4646
- 1x 100MHz e200z0 PowerPC HSM core with NVM
4747
- Crypto offload: TRNG, AES128
4848

49-
### Posix
49+
### POSIX
5050

51-
The Posix port provides multiple and fully functional implementations of different wolfHSM abstractions that can be used to better understand the exact functionality expected for different hardware abstractions.
51+
The POSIX port provides multiple and fully functional implementations of different wolfHSM abstractions that can be used to better understand the exact functionality expected for different hardware abstractions.
5252

53-
The Posix port provides:
53+
The POSIX port provides:
5454
- Memory buffer transport
5555
- TCP transport
5656
- Unix domain transport

0 commit comments

Comments
 (0)