mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 19:54:40 +02:00
Minor STM32F1 fixes
* Not all STM32 RTCs support subseconds in the time struct, so this is now ifdef'd using the only obvious define which exists when subseconds exist. * Let wc_GenerateSeed detect STM32's without RNG correctly. * wolfCrypt test was attempting to use variables that don't exist when both WOLFSSL_SMALL_STACK and WC_NO_RNG is defined.
This commit is contained in:
@@ -1496,12 +1496,15 @@ double current_time(void)
|
||||
{
|
||||
RTC_TimeTypeDef time;
|
||||
RTC_DateTypeDef date;
|
||||
uint32_t subsec;
|
||||
uint32_t subsec = 0;
|
||||
|
||||
/* must get time and date here due to STM32 HW bug */
|
||||
HAL_RTC_GetTime(&hrtc, &time, FORMAT_BIN);
|
||||
HAL_RTC_GetDate(&hrtc, &date, FORMAT_BIN);
|
||||
/* Not all STM32 RTCs have subseconds in the struct */
|
||||
#ifdef RTC_ALARMSUBSECONDMASK_ALL
|
||||
subsec = (255 - time.SubSeconds) * 1000 / 255;
|
||||
#endif
|
||||
|
||||
(void) date;
|
||||
|
||||
|
@@ -2522,7 +2522,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
#elif defined(WOLFSSL_SAFERTOS) || defined(WOLFSSL_LEANPSK) || \
|
||||
defined(WOLFSSL_IAR_ARM) || defined(WOLFSSL_MDK_ARM) || \
|
||||
defined(WOLFSSL_uITRON4) || defined(WOLFSSL_uTKERNEL2) || \
|
||||
defined(WOLFSSL_LPC43xx) || defined(WOLFSSL_STM32F2xx) || \
|
||||
defined(WOLFSSL_LPC43xx) || defined(NO_STM32_RNG) || \
|
||||
defined(MBED) || defined(WOLFSSL_EMBOS) || \
|
||||
defined(WOLFSSL_GENSEED_FORTEST) || defined(WOLFSSL_CHIBIOS) || \
|
||||
defined(WOLFSSL_CONTIKI) || defined(WOLFSSL_AZSPHERE)
|
||||
|
@@ -16343,7 +16343,7 @@ static int dh_ffdhe_test(WC_RNG *rng, const DhParams* params)
|
||||
|
||||
done:
|
||||
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
#if defined(WOLFSSL_SMALL_STACK) && !defined(WC_NO_RNG)
|
||||
if (priv)
|
||||
XFREE(priv, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if (pub)
|
||||
|
Reference in New Issue
Block a user