|
30 | 30 | #include "wolfssl/wolfcrypt/settings.h" |
31 | 31 | #include "wolfssl/wolfcrypt/cryptocb.h" |
32 | 32 |
|
33 | | -/* Shared memory configuration - must match the posix server with --type dma */ |
34 | | -#define WH_SERVER_SHARED_MEMORY_NAME "wh_example_shm" |
35 | | -#define WH_SERVER_CLIENT_ID 1 |
36 | | -#define WH_SERVER_REQ_SIZE 2048 |
37 | | -#define WH_SERVER_RESP_SIZE 2048 |
38 | | -#define WH_SERVER_DMA_SIZE 8000 |
| 33 | +/* Shared POSIX example configuration */ |
| 34 | +#include "examples/posix/wh_posix_cfg.h" |
39 | 35 |
|
40 | 36 | /* Global wolfHSM client context */ |
41 | 37 | static whClientContext g_client[1] = {{0}}; |
@@ -68,16 +64,16 @@ static int connect_to_hsm_server(void) |
68 | 64 | memset(&g_client_config, 0, sizeof(g_client_config)); |
69 | 65 |
|
70 | 66 | /* Configure shared memory transport with DMA */ |
71 | | - g_shm_config.name = WH_SERVER_SHARED_MEMORY_NAME; |
72 | | - g_shm_config.req_size = WH_SERVER_REQ_SIZE; |
73 | | - g_shm_config.resp_size = WH_SERVER_RESP_SIZE; |
74 | | - g_shm_config.dma_size = WH_SERVER_DMA_SIZE; |
| 67 | + g_shm_config.name = WH_POSIX_SHARED_MEMORY_NAME; |
| 68 | + g_shm_config.req_size = WH_POSIX_REQ_SIZE; |
| 69 | + g_shm_config.resp_size = WH_POSIX_RESP_SIZE; |
| 70 | + g_shm_config.dma_size = WH_POSIX_DMA_SIZE; |
75 | 71 |
|
76 | 72 | /* Configure comm layer */ |
77 | 73 | g_comm_config.transport_cb = &shm_cb; |
78 | 74 | g_comm_config.transport_context = (void*)&g_shm_client_ctx; |
79 | 75 | g_comm_config.transport_config = (void*)&g_shm_config; |
80 | | - g_comm_config.client_id = WH_SERVER_CLIENT_ID; |
| 76 | + g_comm_config.client_id = WH_POSIX_CLIENT_ID; |
81 | 77 |
|
82 | 78 | #ifdef WOLFHSM_CFG_DMA |
83 | 79 | /* Configure DMA callbacks for static memory operations */ |
@@ -145,12 +141,6 @@ static void disconnect_from_hsm_server(void) |
145 | 141 | wh_Client_Cleanup(g_client); |
146 | 142 | } |
147 | 143 |
|
148 | | -/* Get the wolfHSM client context for crypto operations */ |
149 | | -whClientContext* get_wolfhsm_client(void) |
150 | | -{ |
151 | | - return g_client; |
152 | | -} |
153 | | - |
154 | 144 | /* Print usage information */ |
155 | 145 | static void print_usage(const char* progname) |
156 | 146 | { |
|
0 commit comments