Skip to content

Commit cd5abfe

Browse files
committed
review feedback
1 parent 7493afc commit cd5abfe

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/test-cryptocb-simulator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [ 'master', 'main', 'release/**' ]
66
pull_request:
7-
branches: [ '*' ]
7+
branches: [ '**' ]
88

99
jobs:
1010
cryptocb_simulator_tests:

hal/sim.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -502,17 +502,18 @@ void hal_init(void)
502502
#if defined(WOLFBOOT_TEST_SIM_CRYPTOCB) && defined(__WOLFBOOT)
503503
{
504504
int cb_ret;
505-
/* wolfCrypt_Init() must be called before RegisterDevice —
506-
* it initializes CryptoDev[] slots to INVALID_DEVID via
507-
* wc_CryptoCb_Init(). Ref-counted, safe to call multiple times. */
508505
wolfCrypt_Init();
509-
cb_ret = wc_CryptoCb_RegisterDevice(0xCB, sim_cryptocb, NULL);
506+
/* simulator WOLFBOOT_DEVID_XXX are all the same, only need to register
507+
* one of them for the sim test - chose hash. */
508+
cb_ret = wc_CryptoCb_RegisterDevice(WOLFBOOT_DEVID_HASH,
509+
sim_cryptocb, NULL);
510510
if (cb_ret != 0) {
511511
wolfBoot_printf("Failed to register sim crypto callback: %d\n",
512512
cb_ret);
513513
exit(-1);
514514
}
515-
wolfBoot_printf("Registered sim_cryptocb with devId 0xCB\n");
515+
wolfBoot_printf("Registered sim_cryptocb with devId %d\n",
516+
WOLFBOOT_DEVID_HASH);
516517
}
517518
#endif
518519
}

tools/unit-tests/unit-image.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ uint16_t wolfBoot_find_header(uint8_t *haystack, uint16_t type, uint8_t **ptr)
360360
}
361361
}
362362

363-
#if defined(WOLFBOOT_SIGN_ECC256)
363+
#if defined(WOLFBOOT_SIGN_ECC256) || defined(WOLFBOOT_SIGN_ECC384) || \
364+
defined(WOLFBOOT_SIGN_ECC521)
364365
int wc_ecc_init_ex(ecc_key* key, void* heap, int devId) {
365366
(void)heap;
366367
(void)devId;

0 commit comments

Comments
 (0)