mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-06 02:30:50 +02:00
Don't declare WC_ALLOC_DO_ON_FAILURE by default
This commit is contained in:
@@ -34,6 +34,8 @@
|
|||||||
#include <tests/api/api.h>
|
#include <tests/api/api.h>
|
||||||
#include <tests/api/test_aes.h>
|
#include <tests/api/test_aes.h>
|
||||||
|
|
||||||
|
#define WC_ALLOC_DO_ON_FAILURE() WC_DO_NOTHING
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* AES
|
* AES
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|||||||
@@ -334,8 +334,10 @@ int test_wc_Chacha_Process_Chunking(void)
|
|||||||
0x0c, 0xb3, 0xc9, 0x39, 0x0f, 0x1f, 0x51, 0x9d
|
0x0c, 0xb3, 0xc9, 0x39, 0x0f, 0x1f, 0x51, 0x9d
|
||||||
};
|
};
|
||||||
|
|
||||||
WC_ALLOC_VAR(plain, byte, CHACHA_LEN, NULL);
|
WC_ALLOC_VAR_EX(plain, byte, CHACHA_LEN, NULL, DYNAMIC_TYPE_TMP_BUFFER,
|
||||||
WC_ALLOC_VAR(cipher, byte, CHACHA_LEN, NULL);
|
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);
|
XMEMSET(plain, 0xa5, CHACHA_LEN);
|
||||||
for (i = 0; i < (int)sizeof(key); i++) {
|
for (i = 0; i < (int)sizeof(key); i++) {
|
||||||
@@ -360,8 +362,11 @@ int test_wc_Chacha_Process_Chunking(void)
|
|||||||
ExpectBufEQ(cipher, expected, (int)sizeof(expected));
|
ExpectBufEQ(cipher, expected, (int)sizeof(expected));
|
||||||
}
|
}
|
||||||
|
|
||||||
WC_FREE_VAR(plain, NULL);
|
#ifdef WC_DECLARE_VAR_IS_HEAP_ALLOC
|
||||||
WC_FREE_VAR(cipher, NULL);
|
cleanup:
|
||||||
|
#endif
|
||||||
|
WC_FREE_VAR_EX(plain, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
|
WC_FREE_VAR_EX(cipher, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
#endif
|
#endif
|
||||||
return EXPECT_RESULT();
|
return EXPECT_RESULT();
|
||||||
} /* END test_wc_Chacha_Process */
|
} /* END test_wc_Chacha_Process */
|
||||||
|
|||||||
@@ -33,6 +33,8 @@
|
|||||||
#include <tests/api/api.h>
|
#include <tests/api/api.h>
|
||||||
#include <tests/api/test_rsa.h>
|
#include <tests/api/test_rsa.h>
|
||||||
|
|
||||||
|
#define WC_ALLOC_DO_ON_FAILURE() WC_DO_NOTHING
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Testing wc_Init RsaKey()
|
* Testing wc_Init RsaKey()
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1872,6 +1872,8 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t nist_sp80056c_twostep_cmac(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define WC_ALLOC_DO_ON_FAILURE() WC_DO_NOTHING
|
||||||
|
|
||||||
#ifdef TEST_ALWAYS_RUN_TO_END
|
#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)
|
#define TEST_FAIL(msg, retval) do { last_failed_test_ret = (retval); wc_test_render_error_message(msg, retval); } while (0)
|
||||||
#elif !defined(TEST_FAIL)
|
#elif !defined(TEST_FAIL)
|
||||||
|
|||||||
@@ -808,9 +808,6 @@ enum {
|
|||||||
#include <wolfssl/wolfcrypt/memory.h>
|
#include <wolfssl/wolfcrypt/memory.h>
|
||||||
|
|
||||||
/* declare/free variable handling for async and smallstack */
|
/* 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) \
|
#define WC_DECLARE_HEAP_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
|
||||||
VAR_TYPE* VAR_NAME[VAR_ITEMS] = { NULL, }; \
|
VAR_TYPE* VAR_NAME[VAR_ITEMS] = { NULL, }; \
|
||||||
|
|||||||
Reference in New Issue
Block a user