mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +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 */
|
||||
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;
|
||||
|
||||
|
Reference in New Issue
Block a user