From 2de3d469719171832a30200157e4b035b7ebe159 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Tue, 11 Mar 2025 14:51:25 -0500 Subject: [PATCH] wolfcrypt/test/test.c: in cryptocb_test(), fix error code from wc_CryptoCb_RegisterDevice(), and call wc_CryptoCb_UnRegisterDevice() at cleanup. --- wolfcrypt/test/test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index c80aef60e..b12279292 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -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;