Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/api/test_aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#include <tests/api/api.h>
#include <tests/api/test_aes.h>

#define WC_ALLOC_DO_ON_FAILURE() WC_DO_NOTHING

/*******************************************************************************
* AES
******************************************************************************/
Expand Down
13 changes: 9 additions & 4 deletions tests/api/test_chacha.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,10 @@ int test_wc_Chacha_Process_Chunking(void)
0x0c, 0xb3, 0xc9, 0x39, 0x0f, 0x1f, 0x51, 0x9d
};

WC_ALLOC_VAR(plain, byte, CHACHA_LEN, NULL);
WC_ALLOC_VAR(cipher, byte, CHACHA_LEN, NULL);
WC_ALLOC_VAR_EX(plain, byte, CHACHA_LEN, NULL, DYNAMIC_TYPE_TMP_BUFFER,
ExpectNotNull(plain); goto cleanup);
WC_ALLOC_VAR_EX(cipher, byte, CHACHA_LEN, NULL, DYNAMIC_TYPE_TMP_BUFFER,
ExpectNotNull(cipher); goto cleanup);

XMEMSET(plain, 0xa5, CHACHA_LEN);
for (i = 0; i < (int)sizeof(key); i++) {
Expand All @@ -360,8 +362,11 @@ int test_wc_Chacha_Process_Chunking(void)
ExpectBufEQ(cipher, expected, (int)sizeof(expected));
}

WC_FREE_VAR(plain, NULL);
WC_FREE_VAR(cipher, NULL);
#ifdef WC_DECLARE_VAR_IS_HEAP_ALLOC
cleanup:
#endif
WC_FREE_VAR_EX(plain, NULL, DYNAMIC_TYPE_TMP_BUFFER);
WC_FREE_VAR_EX(cipher, NULL, DYNAMIC_TYPE_TMP_BUFFER);
#endif
return EXPECT_RESULT();
} /* END test_wc_Chacha_Process */
Expand Down
2 changes: 2 additions & 0 deletions tests/api/test_rsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include <tests/api/api.h>
#include <tests/api/test_rsa.h>

#define WC_ALLOC_DO_ON_FAILURE() WC_DO_NOTHING

/*
* Testing wc_Init RsaKey()
*/
Expand Down
2 changes: 2 additions & 0 deletions wolfcrypt/test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1872,6 +1872,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t nist_sp80056c_twostep_cmac(void)
}
#endif

#define WC_ALLOC_DO_ON_FAILURE() WC_DO_NOTHING

#ifdef TEST_ALWAYS_RUN_TO_END
#define TEST_FAIL(msg, retval) do { last_failed_test_ret = (retval); wc_test_render_error_message(msg, retval); } while (0)
#elif !defined(TEST_FAIL)
Expand Down
3 changes: 0 additions & 3 deletions wolfssl/wolfcrypt/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -808,9 +808,6 @@ enum {
#include <wolfssl/wolfcrypt/memory.h>

/* declare/free variable handling for async and smallstack */
#ifndef WC_ALLOC_DO_ON_FAILURE
#define WC_ALLOC_DO_ON_FAILURE() WC_DO_NOTHING
#endif

#define WC_DECLARE_HEAP_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
VAR_TYPE* VAR_NAME[VAR_ITEMS] = { NULL, }; \
Expand Down