Skip to content

Commit 8d33277

Browse files
committed
wolfcrypt/test/test.c: in ed25519_test(), fix RARE_ED_BAD_ENC_E and RARE_ED_BAD_SIG_E macros to use WC_NO_ERR_TRACE() safely;
.github/workflows/trackmemory.yml: add --enable-debug-trace-errcodes to a couple scenarios.
1 parent 3c2a92d commit 8d33277

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

.github/workflows/trackmemory.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
matrix:
1919
config: [
2020
# Add new configs here
21-
'--enable-all CFLAGS="-DWC_RNG_SEED_CB -DWOLFSSL_TRACK_MEMORY -DWOLFSSL_DEBUG_MEMORY"',
21+
'--enable-all --enable-debug-trace-errcodes CFLAGS="-DWC_RNG_SEED_CB -DWOLFSSL_TRACK_MEMORY -DWOLFSSL_DEBUG_MEMORY"',
2222
'--enable-smallstack --enable-all CFLAGS="-DWC_RNG_SEED_CB -DWOLFSSL_TRACK_MEMORY -DWOLFSSL_DEBUG_MEMORY"',
23-
'--enable-smallstackcache --enable-smallstack --enable-all CFLAGS="-DWC_RNG_SEED_CB -DWOLFSSL_TRACK_MEMORY -DWOLFSSL_DEBUG_MEMORY"',
23+
'--enable-smallstackcache --enable-smallstack --enable-all --enable-debug-trace-errcodes CFLAGS="-DWC_RNG_SEED_CB -DWOLFSSL_TRACK_MEMORY -DWOLFSSL_DEBUG_MEMORY"',
2424
# Note the below smallstackcache tests are crucial coverage for the Linux kernel
2525
# module, when targeting a kernel with the randomness patch (linuxkm/patches/)
2626
# applied.

wolfcrypt/test/test.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41506,31 +41506,31 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ed25519_test(void)
4150641506
ERROR_OUT(WC_TEST_RET_ENC_EC(ret), cleanup);
4150741507

4150841508
#ifdef WOLFSSL_SE050
41509-
#define RARE_ED_BAD_ENC_E WC_HW_E
41510-
#define RARE_ED_BAD_SIG_E WC_HW_E
41509+
#define RARE_ED_BAD_ENC_E WC_NO_ERR_TRACE(WC_HW_E)
41510+
#define RARE_ED_BAD_SIG_E WC_NO_ERR_TRACE(WC_HW_E)
4151141511
#else
41512-
#define RARE_ED_BAD_ENC_E BAD_FUNC_ARG
41513-
#define RARE_ED_BAD_SIG_E SIG_VERIFY_E
41512+
#define RARE_ED_BAD_ENC_E WC_NO_ERR_TRACE(BAD_FUNC_ARG)
41513+
#define RARE_ED_BAD_SIG_E WC_NO_ERR_TRACE(SIG_VERIFY_E)
4151441514
#endif
4151541515

4151641516
ret = wc_ed25519_verify_msg(rareEd1, sizeof(rareEd1), msgs[0], msgSz[0],
4151741517
&verify, key);
41518-
if (ret != WC_NO_ERR_TRACE(RARE_ED_BAD_ENC_E))
41518+
if (ret != RARE_ED_BAD_ENC_E)
4151941519
ERROR_OUT(WC_TEST_RET_ENC_EC(ret), cleanup);
4152041520

4152141521
ret = wc_ed25519_verify_msg(rareEd2, sizeof(rareEd2), msgs[0], msgSz[0],
4152241522
&verify, key);
41523-
if (ret != WC_NO_ERR_TRACE(RARE_ED_BAD_ENC_E))
41523+
if (ret != RARE_ED_BAD_ENC_E)
4152441524
ERROR_OUT(WC_TEST_RET_ENC_EC(ret), cleanup);
4152541525

4152641526
ret = wc_ed25519_verify_msg(rareEd3, sizeof(rareEd3), msgs[0], msgSz[0],
4152741527
&verify, key);
41528-
if (ret != WC_NO_ERR_TRACE(RARE_ED_BAD_ENC_E))
41528+
if (ret != RARE_ED_BAD_ENC_E)
4152941529
ERROR_OUT(WC_TEST_RET_ENC_EC(ret), cleanup);
4153041530

4153141531
ret = wc_ed25519_verify_msg(rareEd4, sizeof(rareEd4), msgs[0], msgSz[0],
4153241532
&verify, key);
41533-
if (ret != WC_NO_ERR_TRACE(RARE_ED_BAD_SIG_E))
41533+
if (ret != RARE_ED_BAD_SIG_E)
4153441534
ERROR_OUT(WC_TEST_RET_ENC_EC(ret), cleanup);
4153541535

4153641536
#undef RARE_ED_BAD_ENC_E

0 commit comments

Comments
 (0)