Skip to content
Merged
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
6 changes: 2 additions & 4 deletions linuxkm/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@ ifeq "$(ENABLED_LINUXKM_PIE)" "yes"
$(obj)/linuxkm/module_hooks.o: ccflags-y += $(PIE_SUPPORT_FLAGS)
endif

ifeq "$(ENABLED_LINUXKM_BENCHMARKS)" "yes"
$(obj)/linuxkm/module_hooks.o: ccflags-y = $(WOLFSSL_CFLAGS) $(CFLAGS_FPU_ENABLE) $(CFLAGS_SIMD_ENABLE) $(PIE_SUPPORT_FLAGS)
$(obj)/linuxkm/module_hooks.o: asflags-y = $(WOLFSSL_ASFLAGS) $(ASFLAGS_FPU_ENABLE_SIMD_DISABLE)
endif
$(obj)/wolfcrypt/benchmark/benchmark.o: ccflags-y = $(WOLFSSL_CFLAGS) $(CFLAGS_FPU_ENABLE) $(CFLAGS_SIMD_ENABLE) $(PIE_SUPPORT_FLAGS) -DNO_MAIN_FUNCTION
$(obj)/wolfcrypt/benchmark/benchmark.o: asflags-y = $(WOLFSSL_ASFLAGS) $(ASFLAGS_FPU_ENABLE_SIMD_DISABLE)

asflags-y := $(WOLFSSL_ASFLAGS) $(ASFLAGS_FPUSIMD_DISABLE)

Expand Down
4 changes: 4 additions & 0 deletions linuxkm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ else
WOLFSSL_CFLAGS+=-DNO_CRYPT_TEST
endif

ifeq "$(ENABLED_LINUXKM_BENCHMARKS)" "yes"
WOLFSSL_OBJ_FILES+=wolfcrypt/benchmark/benchmark.o
endif

ifeq "$(ENABLED_LINUXKM_PIE)" "yes"
WOLFCRYPT_PIE_FILES := linuxkm/pie_first.o $(filter wolfcrypt/src/%,$(WOLFSSL_OBJ_FILES)) linuxkm/pie_redirect_table.o linuxkm/pie_last.o
WOLFSSL_OBJ_FILES := $(WOLFCRYPT_PIE_FILES) $(filter-out $(WOLFCRYPT_PIE_FILES),$(WOLFSSL_OBJ_FILES))
Expand Down
6 changes: 1 addition & 5 deletions linuxkm/module_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,7 @@ static int updateFipsHash(void);
#endif

#ifdef WOLFSSL_LINUXKM_BENCHMARKS
#define STRING_USER
#define NO_MAIN_FUNCTION
#define current_time benchmark_current_time
#define WOLFSSL_NO_FLOAT_FMT
#include "wolfcrypt/benchmark/benchmark.c"
extern int wolfcrypt_benchmark_main(int argc, char** argv);
#endif /* WOLFSSL_LINUXKM_BENCHMARKS */

#ifdef LINUXKM_LKCAPI_REGISTER
Expand Down
3 changes: 3 additions & 0 deletions src/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ int BuildTlsFinished(WOLFSSL* ssl, Hashes* hashes, const byte* sender)
byte handshake_hash[HSHASH_SZ];
#else
WC_DECLARE_VAR(handshake_hash, byte, HSHASH_SZ, ssl->heap);
WC_ALLOC_VAR(handshake_hash, byte, HSHASH_SZ, ssl->heap);
if (handshake_hash == NULL)
return MEMORY_E;
#endif
Expand Down Expand Up @@ -317,6 +318,7 @@ static int _DeriveTlsKeys(byte* key_dig, word32 key_dig_len,
int ret;
#if defined(WOLFSSL_ASYNC_CRYPT) && !defined(WC_ASYNC_NO_HASH)
WC_DECLARE_VAR(seed, byte, SEED_LEN, heap);
WC_ALLOC_VAR(seed, byte, SEED_LEN, heap);
if (seed == NULL)
return MEMORY_E;
#else
Expand Down Expand Up @@ -422,6 +424,7 @@ static int _MakeTlsMasterSecret(byte* ms, word32 msLen,
byte seed[SEED_LEN];
#else
WC_DECLARE_VAR(seed, byte, SEED_LEN, heap);
WC_ALLOC_VAR(seed, byte, SEED_LEN, heap);
if (seed == NULL)
return MEMORY_E;
#endif
Expand Down
12 changes: 12 additions & 0 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -19754,6 +19754,10 @@ static int test_wc_RsaPublicEncryptDecrypt(void)
WC_DECLARE_VAR(plain, byte, TEST_STRING_SZ, NULL);
WC_DECLARE_VAR(cipher, byte, TEST_RSA_BYTES, NULL);

WC_ALLOC_VAR(in, byte, TEST_STRING_SZ, NULL);
WC_ALLOC_VAR(plain, byte, TEST_STRING_SZ, NULL);
WC_ALLOC_VAR(cipher, byte, TEST_RSA_BYTES, NULL);

#ifdef WC_DECLARE_VAR_IS_HEAP_ALLOC
ExpectNotNull(in);
ExpectNotNull(plain);
Expand Down Expand Up @@ -19816,6 +19820,10 @@ static int test_wc_RsaPublicEncryptDecrypt_ex(void)
WC_DECLARE_VAR(plain, byte, TEST_STRING_SZ, NULL);
WC_DECLARE_VAR(cipher, byte, TEST_RSA_BYTES, NULL);

WC_ALLOC_VAR(in, byte, TEST_STRING_SZ, NULL);
WC_ALLOC_VAR(plain, byte, TEST_STRING_SZ, NULL);
WC_ALLOC_VAR(cipher, byte, TEST_RSA_BYTES, NULL);

#ifdef WC_DECLARE_VAR_IS_HEAP_ALLOC
ExpectNotNull(in);
ExpectNotNull(plain);
Expand Down Expand Up @@ -19881,6 +19889,10 @@ static int test_wc_RsaSSL_SignVerify(void)
WC_DECLARE_VAR(out, byte, TEST_RSA_BYTES, NULL);
WC_DECLARE_VAR(plain, byte, TEST_STRING_SZ, NULL);

WC_ALLOC_VAR(in, byte, TEST_STRING_SZ, NULL);
WC_ALLOC_VAR(out, byte, TEST_RSA_BYTES, NULL);
WC_ALLOC_VAR(plain, byte, TEST_STRING_SZ, NULL);

#ifdef WC_DECLARE_VAR_IS_HEAP_ALLOC
ExpectNotNull(in);
ExpectNotNull(out);
Expand Down
Loading