wolfcrypt/test/test.c: in cryptocb_test(), fix error code from

wc_CryptoCb_RegisterDevice(), and call wc_CryptoCb_UnRegisterDevice() at
  cleanup.
This commit is contained in:
Daniel Pouzzner
2025-03-11 14:51:25 -05:00
parent 2a4dbbf545
commit 2de3d46971

View File

@@ -60077,6 +60077,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cryptocb_test(void)
/* set devId to something other than INVALID_DEVID */
devId = 1;
ret = wc_CryptoCb_RegisterDevice(devId, myCryptoDevCb, &myCtx);
if (ret != 0)
ret = WC_TEST_RET_ENC_EC(ret);
#ifdef WOLF_CRYPTO_CB_FIND
wc_CryptoCb_SetDeviceFindCb(myCryptoCbFind);
#endif /* WOLF_CRYPTO_CB_FIND */
@@ -60187,6 +60189,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cryptocb_test(void)
ret = cmac_test();
#endif
wc_CryptoCb_UnRegisterDevice(devId);
/* restore devId */
devId = origDevId;