From c7ca035baf65eb11336732cff60f240378890ed3 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 6 Jan 2026 14:55:59 -0800 Subject: [PATCH] Cleanup WOLFSL_STSAFE and fix issue with multi-test macros --- .wolfssl_known_macro_extras | 6 +++--- wolfcrypt/src/wc_port.c | 4 ++-- wolfssl/wolfcrypt/port/st/stsafe.h | 8 +------- wolfssl/wolfcrypt/settings.h | 6 ++++++ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.wolfssl_known_macro_extras b/.wolfssl_known_macro_extras index d11b35a04..01d989177 100644 --- a/.wolfssl_known_macro_extras +++ b/.wolfssl_known_macro_extras @@ -513,9 +513,6 @@ SQRTMOD_USE_MOD_EXP SSL_SNIFFER_EXPORTS SSN_BUILDING_LIBYASSL STATIC_CHUNKS_ONLY -STSAFE_HOST_KEY_CIPHER -STSAFE_HOST_KEY_MAC -STSAFE_I2C_BUS STM32F107xC STM32F207xx STM32F217xx @@ -548,6 +545,9 @@ STM32WL55xx STM32_AESGCM_PARTIAL STM32_HW_CLOCK_AUTO STM32_NUTTX_RNG +STSAFE_HOST_KEY_CIPHER +STSAFE_HOST_KEY_MAC +STSAFE_I2C_BUS TASK_EXTRA_STACK_SIZE TCP_NODELAY TFM_ALREADY_SET diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index 08838cdce..4bc487e75 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -68,7 +68,7 @@ #if defined(WOLFSSL_RENESAS_RX64_HASH) #include #endif -#if defined(WOLFSSL_STSAFEA100) || defined(WOLFSSL_STSAFEA120) +#ifdef WOLFSSL_STSAFE #include #endif @@ -303,7 +303,7 @@ int wolfCrypt_Init(void) return ret; } #endif - #if defined(WOLFSSL_STSAFEA100) || defined(WOLFSSL_STSAFEA120) + #ifdef WOLFSSL_STSAFE ret = stsafe_interface_init(); if (ret != 0) { WOLFSSL_MSG("STSAFE init failed"); diff --git a/wolfssl/wolfcrypt/port/st/stsafe.h b/wolfssl/wolfcrypt/port/st/stsafe.h index 452298115..83b02c605 100644 --- a/wolfssl/wolfcrypt/port/st/stsafe.h +++ b/wolfssl/wolfcrypt/port/st/stsafe.h @@ -35,12 +35,6 @@ #include #endif -/* Combined STSAFE macro - enables when either A100 or A120 is defined */ -#if defined(WOLFSSL_STSAFEA100) || defined(WOLFSSL_STSAFEA120) - #undef WOLFSSL_STSAFE - #define WOLFSSL_STSAFE -#endif - #ifdef WOLFSSL_STSAFE /* -------------------------------------------------------------------------- */ @@ -52,7 +46,7 @@ * This maintains backwards compatibility with older integrations that * used a separate interface file. * - * When NOT defined (default): All code is self-contained in stsafe.c using + * When NOT set (the default): All code is self-contained in stsafe.c using * the appropriate SDK (STSELib for A120, STSAFE-A1xx SDK for A100/A110). * * When defined: Include customer-provided stsafe_interface.h which must define: diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 3b2ebf72e..ac334105a 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -2139,6 +2139,12 @@ extern void uITRON4_free(void *p) ; #endif /* WOLFSSL_MAXQ1065 || WOLFSSL_MAXQ108X */ +/* Combined STSAFE macro - enables when either A100 or A120 is defined */ +#if defined(WOLFSSL_STSAFEA100) || defined(WOLFSSL_STSAFEA120) + #undef WOLFSSL_STSAFE + #define WOLFSSL_STSAFE +#endif + #if defined(WOLFSSL_STM32F2) || defined(WOLFSSL_STM32F4) || \ defined(WOLFSSL_STM32F7) || defined(WOLFSSL_STM32F1) || \ defined(WOLFSSL_STM32L4) || defined(WOLFSSL_STM32L5) || \