mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Merge pull request #1760 from dgarske/atmel_asf
Fixes for building with Atmel ASF (`WOLFSSL_ATMEL`)
This commit is contained in:
@ -104,15 +104,16 @@ int atmel_get_random_block(unsigned char* output, unsigned int sz)
|
|||||||
return atmel_get_random_number((uint32_t)sz, (uint8_t*)output);
|
return atmel_get_random_number((uint32_t)sz, (uint8_t*)output);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WOLFSSL_ATMEL
|
#ifdef WOLFSSL_ATMEL_TIME
|
||||||
extern struct rtc_module *_rtc_instance[RTC_INST_NUM];
|
extern struct rtc_module *_rtc_instance[RTC_INST_NUM];
|
||||||
#endif
|
#endif
|
||||||
long atmel_get_curr_time_and_date(long* tm)
|
long atmel_get_curr_time_and_date(long* tm)
|
||||||
{
|
{
|
||||||
(void)tm;
|
(void)tm;
|
||||||
|
|
||||||
#ifdef WOLFSSL_ATMEL
|
#ifdef WOLFSSL_ATMEL_TIME
|
||||||
/* Get current time */
|
/* Get current time */
|
||||||
|
|
||||||
//struct rtc_calendar_time rtcTime;
|
//struct rtc_calendar_time rtcTime;
|
||||||
//rtc_calendar_get_time(_rtc_instance[0], &rtcTime);
|
//rtc_calendar_get_time(_rtc_instance[0], &rtcTime);
|
||||||
|
|
||||||
@ -250,7 +251,9 @@ void atmel_init(void)
|
|||||||
void atmel_finish(void)
|
void atmel_finish(void)
|
||||||
{
|
{
|
||||||
if (mAtcaInitDone) {
|
if (mAtcaInitDone) {
|
||||||
|
#ifdef WOLFSSL_ATECC508A
|
||||||
atcatls_finish();
|
atcatls_finish();
|
||||||
|
#endif
|
||||||
mAtcaInitDone = 0;
|
mAtcaInitDone = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
wolfcrypt/src/random.c
Normal file → Executable file
2
wolfcrypt/src/random.c
Normal file → Executable file
@ -859,7 +859,7 @@ int wc_RNG_HealthTest_ex(int reseed, const byte* nonce, word32 nonceSz,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WOLFSSL_SMALL_STACK
|
#ifdef WOLFSSL_SMALL_STACK
|
||||||
drbg = (struct DRBG*)XMALLOC(sizeof(DRBG), NULL, DYNAMIC_TYPE_RNG);
|
drbg = (DRBG*)XMALLOC(sizeof(DRBG), NULL, DYNAMIC_TYPE_RNG);
|
||||||
if (drbg == NULL) {
|
if (drbg == NULL) {
|
||||||
return MEMORY_E;
|
return MEMORY_E;
|
||||||
}
|
}
|
||||||
|
1
wolfssl/wolfcrypt/wc_port.h
Normal file → Executable file
1
wolfssl/wolfcrypt/wc_port.h
Normal file → Executable file
@ -436,6 +436,7 @@ WOLFSSL_API int wolfCrypt_Cleanup(void);
|
|||||||
#define XGMTIME(c, t) gmtime((c))
|
#define XGMTIME(c, t) gmtime((c))
|
||||||
|
|
||||||
#elif defined(WOLFSSL_ATMEL)
|
#elif defined(WOLFSSL_ATMEL)
|
||||||
|
extern long atmel_get_curr_time_and_date(long* tm);
|
||||||
#define XTIME(t1) atmel_get_curr_time_and_date((t1))
|
#define XTIME(t1) atmel_get_curr_time_and_date((t1))
|
||||||
#define WOLFSSL_GMTIME
|
#define WOLFSSL_GMTIME
|
||||||
#define USE_WOLF_TM
|
#define USE_WOLF_TM
|
||||||
|
Reference in New Issue
Block a user