mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +02:00
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:
@@ -60077,6 +60077,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cryptocb_test(void)
|
|||||||
/* set devId to something other than INVALID_DEVID */
|
/* set devId to something other than INVALID_DEVID */
|
||||||
devId = 1;
|
devId = 1;
|
||||||
ret = wc_CryptoCb_RegisterDevice(devId, myCryptoDevCb, &myCtx);
|
ret = wc_CryptoCb_RegisterDevice(devId, myCryptoDevCb, &myCtx);
|
||||||
|
if (ret != 0)
|
||||||
|
ret = WC_TEST_RET_ENC_EC(ret);
|
||||||
#ifdef WOLF_CRYPTO_CB_FIND
|
#ifdef WOLF_CRYPTO_CB_FIND
|
||||||
wc_CryptoCb_SetDeviceFindCb(myCryptoCbFind);
|
wc_CryptoCb_SetDeviceFindCb(myCryptoCbFind);
|
||||||
#endif /* WOLF_CRYPTO_CB_FIND */
|
#endif /* WOLF_CRYPTO_CB_FIND */
|
||||||
@@ -60187,6 +60189,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cryptocb_test(void)
|
|||||||
ret = cmac_test();
|
ret = cmac_test();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
wc_CryptoCb_UnRegisterDevice(devId);
|
||||||
|
|
||||||
/* restore devId */
|
/* restore devId */
|
||||||
devId = origDevId;
|
devId = origDevId;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user