diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index a02dbbd85..63ba52da0 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -13634,9 +13634,9 @@ int GetFormattedTime(void* currTime, byte* buf, word32 len) #if defined(NEED_TMP_TIME) struct tm tmpTimeStorage; tmpTime = &tmpTimeStorage; -#else - (void)tmpTime; #endif + /* Needed in case XGMTIME does not use the tmpTime argument. */ + (void)tmpTime; WOLFSSL_ENTER("GetFormattedTime"); diff --git a/wolfcrypt/src/port/caam/caam_qnx.c b/wolfcrypt/src/port/caam/caam_qnx.c index a3cd6b33c..3ce8e74bc 100644 --- a/wolfcrypt/src/port/caam/caam_qnx.c +++ b/wolfcrypt/src/port/caam/caam_qnx.c @@ -26,6 +26,7 @@ /* settings.h is only included for wolfSSL version and IAR build warnings * wolfssl/wolfcrypt/- path includes other than * wolfssl/wolfcrypt/port/caam/caam_* should be avoided!! */ +#undef WC_NO_HARDEN #define WC_NO_HARDEN /* silence warning, it is irrelavent here */ #include diff --git a/wolfcrypt/src/port/st/stsafe.c b/wolfcrypt/src/port/st/stsafe.c index 0841abafa..4625496d0 100644 --- a/wolfcrypt/src/port/st/stsafe.c +++ b/wolfcrypt/src/port/st/stsafe.c @@ -249,7 +249,7 @@ int SSL_STSAFE_SharedSecretCb(WOLFSSL* ssl, ecc_key* otherKey, word32 otherKeyX_len = sizeof(otherKeyX); word32 otherKeyY_len = sizeof(otherKeyY); byte pubKeyRaw[STSAFE_MAX_PUBKEY_RAW_LEN]; - StSafeA_KeySlotNumber slot; + StSafeA_KeySlotNumber slot = STSAFE_A_SLOT_0; StSafeA_CurveId curve_id; ecc_key tmpKey; int ecc_curve; @@ -322,7 +322,11 @@ int SSL_STSAFE_SharedSecretCb(WOLFSSL* ssl, ecc_key* otherKey, } /* Compute shared secret */ - err = stsafe_interface_shared_secret(curve_id, &otherKeyX[0], &otherKeyY[0], + err = stsafe_interface_shared_secret( +#ifdef WOLFSSL_STSAFE_TAKES_SLOT + slot, +#endif + curve_id, &otherKeyX[0], &otherKeyY[0], out, (int32_t*)outlen); if (err != STSAFE_A_OK) { #ifdef USE_STSAFE_VERBOSE @@ -535,7 +539,11 @@ int wolfSSL_STSAFE_CryptoDevCb(int devId, wc_CryptoInfo* info, void* ctx) if (rc == 0) { /* Compute shared secret */ *info->pk.ecdh.outlen = 0; - rc = stsafe_interface_shared_secret(curve_id, + rc = stsafe_interface_shared_secret( + #ifdef WOLFSSL_STSAFE_TAKES_SLOT + STSAFE_A_SLOT_0, + #endif + curve_id, otherKeyX, otherKeyY, info->pk.ecdh.out, (int32_t*)info->pk.ecdh.outlen); if (rc != STSAFE_A_OK) { diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index 78da614af..31eeda136 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -3028,7 +3028,7 @@ time_t stm32_hal_time(time_t *t1) RTC_TimeTypeDef time; RTC_DateTypeDef date; - XMEMSET(tm_time, 0, sizeof(struct tm)); + XMEMSET(&tm_time, 0, sizeof(struct tm)); /* order of GetTime followed by GetDate required here due to STM32 HW * requirement */ diff --git a/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h b/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h index 72b16d8be..56f16449c 100644 --- a/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h +++ b/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h @@ -53,6 +53,8 @@ #if ESP_IDF_VERSION_MAJOR >= 4 #include +#elif defined(CONFIG_IDF_TARGET_ESP32S3) + #include #else #include #endif @@ -69,6 +71,8 @@ int esp_CryptHwMutexUnLock(wolfSSL_Mutex* mutex); #if ESP_IDF_VERSION_MAJOR >= 4 #include "esp32/rom/aes.h" + #elif defined(CONFIG_IDF_TARGET_ESP32S3) + #include "esp32s3/rom/aes.h" #else #include "rom/aes.h" #endif @@ -105,6 +109,8 @@ int esp_CryptHwMutexUnLock(wolfSSL_Mutex* mutex); #if ESP_IDF_VERSION_MAJOR >= 4 #include "esp32/rom/sha.h" + #elif defined(CONFIG_IDF_TARGET_ESP32S3) + #include "esp32s3/rom/sha.h" #else #include "rom/sha.h" #endif @@ -127,7 +133,13 @@ int esp_CryptHwMutexUnLock(wolfSSL_Mutex* mutex); * actual enable/disable only occurs for ref_counts[periph] == 0 */ int lockDepth; /* see ref_counts[periph] in periph_ctrl.c */ + /* ESP32S3 defines SHA_TYPE to enum, all other ESP32s define it to + typedef enum. */ + #if defined(CONFIG_IDF_TARGET_ESP32S3) + SHA_TYPE sha_type; + #else enum SHA_TYPE sha_type; + #endif } WC_ESP32SHA; int esp_sha_try_hw_lock(WC_ESP32SHA* ctx);