Skip to content

Commit c7ca035

Browse files
committed
Cleanup WOLFSL_STSAFE and fix issue with multi-test macros
1 parent a4c2398 commit c7ca035

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

.wolfssl_known_macro_extras

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,6 @@ SQRTMOD_USE_MOD_EXP
513513
SSL_SNIFFER_EXPORTS
514514
SSN_BUILDING_LIBYASSL
515515
STATIC_CHUNKS_ONLY
516-
STSAFE_HOST_KEY_CIPHER
517-
STSAFE_HOST_KEY_MAC
518-
STSAFE_I2C_BUS
519516
STM32F107xC
520517
STM32F207xx
521518
STM32F217xx
@@ -548,6 +545,9 @@ STM32WL55xx
548545
STM32_AESGCM_PARTIAL
549546
STM32_HW_CLOCK_AUTO
550547
STM32_NUTTX_RNG
548+
STSAFE_HOST_KEY_CIPHER
549+
STSAFE_HOST_KEY_MAC
550+
STSAFE_I2C_BUS
551551
TASK_EXTRA_STACK_SIZE
552552
TCP_NODELAY
553553
TFM_ALREADY_SET

wolfcrypt/src/wc_port.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#if defined(WOLFSSL_RENESAS_RX64_HASH)
6969
#include <wolfssl/wolfcrypt/port/Renesas/renesas-rx64-hw-crypt.h>
7070
#endif
71-
#if defined(WOLFSSL_STSAFEA100) || defined(WOLFSSL_STSAFEA120)
71+
#ifdef WOLFSSL_STSAFE
7272
#include <wolfssl/wolfcrypt/port/st/stsafe.h>
7373
#endif
7474

@@ -303,7 +303,7 @@ int wolfCrypt_Init(void)
303303
return ret;
304304
}
305305
#endif
306-
#if defined(WOLFSSL_STSAFEA100) || defined(WOLFSSL_STSAFEA120)
306+
#ifdef WOLFSSL_STSAFE
307307
ret = stsafe_interface_init();
308308
if (ret != 0) {
309309
WOLFSSL_MSG("STSAFE init failed");

wolfssl/wolfcrypt/port/st/stsafe.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@
3535
#include <wolfssl/ssl.h>
3636
#endif
3737

38-
/* Combined STSAFE macro - enables when either A100 or A120 is defined */
39-
#if defined(WOLFSSL_STSAFEA100) || defined(WOLFSSL_STSAFEA120)
40-
#undef WOLFSSL_STSAFE
41-
#define WOLFSSL_STSAFE
42-
#endif
43-
4438
#ifdef WOLFSSL_STSAFE
4539

4640
/* -------------------------------------------------------------------------- */
@@ -52,7 +46,7 @@
5246
* This maintains backwards compatibility with older integrations that
5347
* used a separate interface file.
5448
*
55-
* When NOT defined (default): All code is self-contained in stsafe.c using
49+
* When NOT set (the default): All code is self-contained in stsafe.c using
5650
* the appropriate SDK (STSELib for A120, STSAFE-A1xx SDK for A100/A110).
5751
*
5852
* When defined: Include customer-provided stsafe_interface.h which must define:

wolfssl/wolfcrypt/settings.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,6 +2139,12 @@ extern void uITRON4_free(void *p) ;
21392139

21402140
#endif /* WOLFSSL_MAXQ1065 || WOLFSSL_MAXQ108X */
21412141

2142+
/* Combined STSAFE macro - enables when either A100 or A120 is defined */
2143+
#if defined(WOLFSSL_STSAFEA100) || defined(WOLFSSL_STSAFEA120)
2144+
#undef WOLFSSL_STSAFE
2145+
#define WOLFSSL_STSAFE
2146+
#endif
2147+
21422148
#if defined(WOLFSSL_STM32F2) || defined(WOLFSSL_STM32F4) || \
21432149
defined(WOLFSSL_STM32F7) || defined(WOLFSSL_STM32F1) || \
21442150
defined(WOLFSSL_STM32L4) || defined(WOLFSSL_STM32L5) || \

0 commit comments

Comments
 (0)