Skip to content

Commit 0a1781a

Browse files
committed
stm32h5-tz-wolfhsm: bind NSC transport via WH_TRANSPORT_NSC_*_CB macros
1 parent 51140c1 commit 0a1781a

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

port/stmicro/stm32h5-tz-wolfhsm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ the comments at the top to see exactly what the client side has to do:
451451

452452
1. Allocate a static `whTransportNscClientContext`.
453453
2. Fill in `whCommClientConfig` with the NSC transport callbacks
454-
(`whTransportNscClient_Cb` from
454+
(`WH_TRANSPORT_NSC_CLIENT_CB` from
455455
`lib/wolfHSM/port/armv8m-tz/wh_transport_nsc.h`).
456456
3. Wrap that in a `whClientConfig`.
457457
4. Call `whTest_ClientConfig(&clientCfg)` (from wolfHSM's test

port/stmicro/stm32h5-tz-wolfhsm/demo-app/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,14 @@ static int wolfhsm_demo_run(void)
8383
whCommClientConfig comm;
8484
whClientConfig cfg;
8585
int rc;
86+
static const whTransportClientCb nsc_cb = WH_TRANSPORT_NSC_CLIENT_CB;
8687

8788
memset(&s_nsc_ctx, 0, sizeof(s_nsc_ctx));
8889
memset(&s_nsc_cfg, 0, sizeof(s_nsc_cfg));
8990
memset(&comm, 0, sizeof(comm));
9091
memset(&cfg, 0, sizeof(cfg));
9192

92-
comm.transport_cb = &whTransportNscClient_Cb;
93+
comm.transport_cb = &nsc_cb;
9394
comm.transport_context = &s_nsc_ctx;
9495
comm.transport_config = &s_nsc_cfg;
9596
comm.client_id = WOLFHSM_DEMO_CLIENT_ID;

src/wolfhsm_callable.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ static whNvmConfig g_nvm_cfg = {
7272
static whServerCryptoContext g_crypto_ctx;
7373
static whTransportNscServerContext g_srv_tx_ctx;
7474
static whTransportNscServerConfig g_srv_tx_cfg = { 0 };
75+
static const whTransportServerCb g_srv_tx_cb = WH_TRANSPORT_NSC_SERVER_CB;
7576
static whCommServerConfig g_comm_cfg = {
7677
.transport_context = &g_srv_tx_ctx,
77-
.transport_cb = &whTransportNscServer_Cb,
78+
.transport_cb = &g_srv_tx_cb,
7879
.transport_config = &g_srv_tx_cfg,
7980
.server_id = WCS_WOLFHSM_SERVER_ID,
8081
};

test-app/wcs/wolfhsm_test.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ extern whTransportNscClientContext g_wolfhsm_nsc_client_ctx;
3535
int cmd_wolfhsm_test(const char *args)
3636
{
3737
static const whTransportNscClientConfig nsc_cfg = { 0 };
38+
static const whTransportClientCb nsc_cb = WH_TRANSPORT_NSC_CLIENT_CB;
3839
whCommClientConfig comm_cfg;
3940
whClientConfig cfg;
4041
int rc;
4142

4243
(void)args;
4344

4445
memset(&comm_cfg, 0, sizeof(comm_cfg));
45-
comm_cfg.transport_cb = &whTransportNscClient_Cb;
46+
comm_cfg.transport_cb = &nsc_cb;
4647
comm_cfg.transport_context = &g_wolfhsm_nsc_client_ctx;
4748
comm_cfg.transport_config = &nsc_cfg;
4849
comm_cfg.client_id = WCS_WOLFHSM_CLIENT_ID;

0 commit comments

Comments
 (0)