Improve some of the build cases around crypto callback only

This commit is contained in:
David Garske
2025-08-13 21:58:34 +01:00
parent 22b221a8be
commit d79ca8a746
3 changed files with 15 additions and 12 deletions

View File

@@ -85,12 +85,12 @@ Or
#define SINGLE_THREADED
#endif
#endif
/* Conversely, if both server and client are enabled, we must require pthreads */
/* If both client and server are enabled and single threaded, just disable this example */
#if !defined(NO_WOLFSSL_CLIENT) && !defined(NO_WOLFSSL_SERVER) \
&& defined(SINGLE_THREADED)
#error "threads must be enabled if building benchmark suite \
to run both client and server. Please define HAVE_PTHREAD if your \
platform supports it"
#undef NO_TLS
#define NO_TLS
#endif
#if 0

View File

@@ -1360,7 +1360,7 @@ int test_wc_ecc_pointFns(void)
EXPECT_DECLS;
#if defined(HAVE_ECC) && defined(HAVE_ECC_KEY_EXPORT) && \
!defined(WC_NO_RNG) && !defined(WOLFSSL_ATECC508A) && \
!defined(WOLFSSL_ATECC608A)
!defined(WOLFSSL_ATECC608A) && !defined(WOLF_CRYPTO_CB_ONLY_ECC)
ecc_key key;
WC_RNG rng;
int ret;
@@ -1465,7 +1465,7 @@ int test_wc_ecc_shared_secret_ssh(void)
#if defined(HAVE_ECC) && defined(HAVE_ECC_DHE) && \
!defined(WC_NO_RNG) && !defined(WOLFSSL_ATECC508A) && \
!defined(WOLFSSL_ATECC608A) && !defined(PLUTON_CRYPTO_ECC) && \
!defined(WOLFSSL_CRYPTOCELL)
!defined(WOLFSSL_CRYPTOCELL) && !defined(WOLF_CRYPTO_CB_ONLY_ECC)
ecc_key key;
ecc_key key2;
WC_RNG rng;
@@ -1639,7 +1639,8 @@ int test_wc_ecc_mulmod(void)
EXPECT_DECLS;
#if defined(HAVE_ECC) && !defined(WC_NO_RNG) && \
!(defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A) || \
defined(WOLFSSL_VALIDATE_ECC_IMPORT))
defined(WOLFSSL_VALIDATE_ECC_IMPORT)) && \
!defined(WOLF_CRYPTO_CB_ONLY_ECC)
ecc_key key1;
ecc_key key2;
ecc_key key3;

View File

@@ -31175,6 +31175,7 @@ done:
#else
wc_ecc_free(key);
#endif
(void)tmpSz;
return ret;
}
@@ -59585,12 +59586,11 @@ static wc_test_ret_t ecc_onlycb_test(myCryptoDevCtx *ctx)
wc_test_ret_t ret = 0;
#if defined(HAVE_ECC)
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
ecc_key* key = (ecc_key *)XMALLOC(sizeof *key,
ecc_key* key = (ecc_key *)XMALLOC(sizeof(*key),
HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);
ecc_key* pub = (ecc_key *)XMALLOC(sizeof *pub,
HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);
byte* out = (byte*)XMALLOC(sizeof(byte),
ecc_key* pub = (ecc_key *)XMALLOC(sizeof(*pub),
HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);
byte* out = (byte*)XMALLOC(256, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);
#if !defined(WOLFCRYPT_ONLY) && defined(OPENSSL_EXTRA)
byte* check = (byte*)XMALLOC(256, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);
#endif
@@ -59599,6 +59599,9 @@ static wc_test_ret_t ecc_onlycb_test(myCryptoDevCtx *ctx)
#ifdef HAVE_ECC_DHE
ecc_key pub[1];
#endif
#if defined(HAVE_ECC_SIGN) && defined(HAVE_ECC_VERIFY)
byte out[256];
#endif
#if !defined(WOLFCRYPT_ONLY) && defined(OPENSSL_EXTRA)
byte check[256];
#endif
@@ -59654,7 +59657,6 @@ static wc_test_ret_t ecc_onlycb_test(myCryptoDevCtx *ctx)
#if defined(HAVE_ECC_SIGN) && defined(HAVE_ECC_VERIFY)
byte in[] = "Everyone gets Friday off. ecc p";
word32 inLen = (word32)XSTRLEN((char*)in);
byte out[256];
word32 outLen;
int verify;
#endif