Skip to content

Commit f0b7110

Browse files
committed
wolfssl/wolfcrypt/types.h: restore WC_ALLOC_DO_ON_FAILURE fallback definition from 760178c -- reversion in part of 5f4d499. fixes optest build failures in all-crypto-only-intelasm-fips-v5-linuxkm-next-insmod-optest, all-crypto-only-intelasm-fips-v6-linuxkm-next-insmod-optest, and all-crypto-only-intelasm-fips-dev-linuxkm-next-insmod-optest.
1 parent 292ea54 commit f0b7110

5 files changed

Lines changed: 4 additions & 6 deletions

File tree

tests/api/test_aes.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
#include <tests/api/api.h>
3535
#include <tests/api/test_aes.h>
3636

37-
#define WC_ALLOC_DO_ON_FAILURE() WC_DO_NOTHING
38-
3937
/*******************************************************************************
4038
* AES
4139
******************************************************************************/

tests/api/test_rsa.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
#include <tests/api/api.h>
3434
#include <tests/api/test_rsa.h>
3535

36-
#define WC_ALLOC_DO_ON_FAILURE() WC_DO_NOTHING
37-
3836
/*
3937
* Testing wc_Init RsaKey()
4038
*/

wolfcrypt/benchmark/benchmark.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
/* Macro to disable benchmark */
7070
#ifndef NO_CRYPT_BENCHMARK
7171

72+
#undef WC_ALLOC_DO_ON_FAILURE
7273
#define WC_ALLOC_DO_ON_FAILURE() do { printf("out of memory at benchmark.c L %d\n", __LINE__); ret = MEMORY_E; goto exit; } while (0)
7374

7475
#include <wolfssl/wolfcrypt/types.h>

wolfcrypt/test/test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,8 +1896,6 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t nist_sp80056c_twostep_cmac(void)
18961896
}
18971897
#endif
18981898

1899-
#define WC_ALLOC_DO_ON_FAILURE() WC_DO_NOTHING
1900-
19011899
#ifdef TEST_ALWAYS_RUN_TO_END
19021900
#define TEST_FAIL(msg, retval) do { last_failed_test_ret = (retval); wc_test_render_error_message(msg, retval); } while (0)
19031901
#elif !defined(TEST_FAIL)

wolfssl/wolfcrypt/types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,9 @@ enum {
825825
#include <wolfssl/wolfcrypt/memory.h>
826826

827827
/* declare/free variable handling for async and smallstack */
828+
#ifndef WC_ALLOC_DO_ON_FAILURE
829+
#define WC_ALLOC_DO_ON_FAILURE() WC_DO_NOTHING
830+
#endif
828831

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

0 commit comments

Comments
 (0)