Skip to content

Commit 2de3d46

Browse files
committed
wolfcrypt/test/test.c: in cryptocb_test(), fix error code from
wc_CryptoCb_RegisterDevice(), and call wc_CryptoCb_UnRegisterDevice() at cleanup.
1 parent 2a4dbbf commit 2de3d46

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

wolfcrypt/test/test.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60077,6 +60077,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cryptocb_test(void)
6007760077
/* set devId to something other than INVALID_DEVID */
6007860078
devId = 1;
6007960079
ret = wc_CryptoCb_RegisterDevice(devId, myCryptoDevCb, &myCtx);
60080+
if (ret != 0)
60081+
ret = WC_TEST_RET_ENC_EC(ret);
6008060082
#ifdef WOLF_CRYPTO_CB_FIND
6008160083
wc_CryptoCb_SetDeviceFindCb(myCryptoCbFind);
6008260084
#endif /* WOLF_CRYPTO_CB_FIND */
@@ -60187,6 +60189,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cryptocb_test(void)
6018760189
ret = cmac_test();
6018860190
#endif
6018960191

60192+
wc_CryptoCb_UnRegisterDevice(devId);
60193+
6019060194
/* restore devId */
6019160195
devId = origDevId;
6019260196

0 commit comments

Comments
 (0)