mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-04 05:04:41 +02:00
wolfssl/wolfcrypt/types.h: make DECLARE_VAR() et al use heap allocation not only when WOLFSSL_ASYNC_CRYPT but also when WOLFSSL_SMALL_STACK.
This commit is contained in:
@@ -18897,6 +18897,19 @@ static int ecc_test_curve_size(WC_RNG* rng, int keySize, int testVerifyCount,
|
||||
ecc_key userA, userB, pubKey;
|
||||
int curveSize;
|
||||
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
#if (defined(HAVE_ECC_DHE) || defined(HAVE_ECC_CDH)) && \
|
||||
!defined(WOLFSSL_ATECC508A) && !defined(WOLFSSL_ATECC608A)
|
||||
if ((sharedA == NULL) || (sharedB == NULL))
|
||||
ERROR_OUT(-9652, done);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ECC_SIGN
|
||||
if ((sig == NULL) || (digest == NULL))
|
||||
ERROR_OUT(-9653, done);
|
||||
#endif
|
||||
#endif /* WOLFSSL_SMALL_STACK */
|
||||
|
||||
(void)testVerifyCount;
|
||||
(void)dp;
|
||||
(void)x;
|
||||
|
@@ -396,7 +396,7 @@ decouple library dependencies with standard string, memory and so on.
|
||||
#endif
|
||||
|
||||
/* declare/free variable handling for async */
|
||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||
#if defined(WOLFSSL_ASYNC_CRYPT) || defined(WOLFSSL_SMALL_STACK)
|
||||
#define DECLARE_VAR(VAR_NAME, VAR_TYPE, VAR_SIZE, HEAP) \
|
||||
VAR_TYPE* VAR_NAME = (VAR_TYPE*)XMALLOC(sizeof(VAR_TYPE) * VAR_SIZE, (HEAP), DYNAMIC_TYPE_WOLF_BIGINT);
|
||||
#define DECLARE_VAR_INIT(VAR_NAME, VAR_TYPE, VAR_SIZE, INIT_VALUE, HEAP) \
|
||||
|
Reference in New Issue
Block a user