Merge pull request #1760 from dgarske/atmel_asf

Fixes for building with Atmel ASF (`WOLFSSL_ATMEL`)
This commit is contained in:
toddouska
2018-08-20 09:20:01 -07:00
committed by GitHub
3 changed files with 7 additions and 3 deletions

View File

@ -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);
}
#ifdef WOLFSSL_ATMEL
#ifdef WOLFSSL_ATMEL_TIME
extern struct rtc_module *_rtc_instance[RTC_INST_NUM];
#endif
long atmel_get_curr_time_and_date(long* tm)
{
(void)tm;
#ifdef WOLFSSL_ATMEL
#ifdef WOLFSSL_ATMEL_TIME
/* Get current time */
//struct rtc_calendar_time rtcTime;
//rtc_calendar_get_time(_rtc_instance[0], &rtcTime);
@ -250,7 +251,9 @@ void atmel_init(void)
void atmel_finish(void)
{
if (mAtcaInitDone) {
#ifdef WOLFSSL_ATECC508A
atcatls_finish();
#endif
mAtcaInitDone = 0;
}
}

2
wolfcrypt/src/random.c Normal file → Executable file
View File

@ -859,7 +859,7 @@ int wc_RNG_HealthTest_ex(int reseed, const byte* nonce, word32 nonceSz,
}
#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) {
return MEMORY_E;
}

1
wolfssl/wolfcrypt/wc_port.h Normal file → Executable file
View File

@ -436,6 +436,7 @@ WOLFSSL_API int wolfCrypt_Cleanup(void);
#define XGMTIME(c, t) gmtime((c))
#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 WOLFSSL_GMTIME
#define USE_WOLF_TM