diff --git a/.github/workflows/test-cryptocb-simulator.yml b/.github/workflows/test-cryptocb-simulator.yml index 64b2f156..b3c0d3aa 100644 --- a/.github/workflows/test-cryptocb-simulator.yml +++ b/.github/workflows/test-cryptocb-simulator.yml @@ -4,7 +4,7 @@ on: push: branches: [ 'master', 'main', 'release/**' ] pull_request: - branches: [ '*' ] + branches: [ '**' ] jobs: cryptocb_simulator_tests: diff --git a/hal/sim.c b/hal/sim.c index caac7af9..702f3810 100644 --- a/hal/sim.c +++ b/hal/sim.c @@ -502,17 +502,18 @@ void hal_init(void) #if defined(WOLFBOOT_TEST_SIM_CRYPTOCB) && defined(__WOLFBOOT) { int cb_ret; - /* wolfCrypt_Init() must be called before RegisterDevice — - * it initializes CryptoDev[] slots to INVALID_DEVID via - * wc_CryptoCb_Init(). Ref-counted, safe to call multiple times. */ wolfCrypt_Init(); - cb_ret = wc_CryptoCb_RegisterDevice(0xCB, sim_cryptocb, NULL); + /* simulator WOLFBOOT_DEVID_XXX are all the same, only need to register + * one of them for the sim test - chose hash. */ + cb_ret = wc_CryptoCb_RegisterDevice(WOLFBOOT_DEVID_HASH, + sim_cryptocb, NULL); if (cb_ret != 0) { wolfBoot_printf("Failed to register sim crypto callback: %d\n", cb_ret); exit(-1); } - wolfBoot_printf("Registered sim_cryptocb with devId 0xCB\n"); + wolfBoot_printf("Registered sim_cryptocb with devId %d\n", + WOLFBOOT_DEVID_HASH); } #endif } diff --git a/tools/unit-tests/unit-image.c b/tools/unit-tests/unit-image.c index 02f9f94f..b2efa296 100644 --- a/tools/unit-tests/unit-image.c +++ b/tools/unit-tests/unit-image.c @@ -360,7 +360,8 @@ uint16_t wolfBoot_find_header(uint8_t *haystack, uint16_t type, uint8_t **ptr) } } -#if defined(WOLFBOOT_SIGN_ECC256) +#if defined(WOLFBOOT_SIGN_ECC256) || defined(WOLFBOOT_SIGN_ECC384) || \ + defined(WOLFBOOT_SIGN_ECC521) int wc_ecc_init_ex(ecc_key* key, void* heap, int devId) { (void)heap; (void)devId;