mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-05 13:44:41 +02:00
fixes for Freescale MQX, CodeWarrior GCC
This commit is contained in:
@@ -98,9 +98,8 @@
|
|||||||
#define XGMTIME(c) gmtime((c))
|
#define XGMTIME(c) gmtime((c))
|
||||||
#define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t))
|
#define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t))
|
||||||
#elif defined(FREESCALE_MQX)
|
#elif defined(FREESCALE_MQX)
|
||||||
#include <time.h>
|
#define XTIME(t1) mqx_time((t1))
|
||||||
#define XTIME(t1) mqx_time((t1))
|
#define XGMTIME(c) mqx_gmtime((c))
|
||||||
#define XGMTIME(c) gmtime((c))
|
|
||||||
#define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t))
|
#define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t))
|
||||||
#elif defined(CYASSL_MDK_ARM)
|
#elif defined(CYASSL_MDK_ARM)
|
||||||
#if defined(CYASSL_MDK5)
|
#if defined(CYASSL_MDK5)
|
||||||
@@ -315,6 +314,14 @@ time_t mqx_time(time_t* timer)
|
|||||||
return *timer;
|
return *timer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* CodeWarrior GCC toolchain only has gmtime_r(), no gmtime() */
|
||||||
|
struct tm* mqx_gmtime(const time_t* clock)
|
||||||
|
{
|
||||||
|
struct tm tmpTime;
|
||||||
|
|
||||||
|
return gmtime_r(clock, &tmpTime);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* FREESCALE_MQX */
|
#endif /* FREESCALE_MQX */
|
||||||
|
|
||||||
#ifdef CYASSL_TIRTOS
|
#ifdef CYASSL_TIRTOS
|
||||||
@@ -2316,12 +2323,13 @@ int ValidateDate(const byte* date, byte format, int dateType)
|
|||||||
certTime.tm_year += btoi(date[i++]) * 100;
|
certTime.tm_year += btoi(date[i++]) * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
GetTime(&certTime.tm_year, date, &i); certTime.tm_year -= 1900; /* adjust */
|
/* adjust tm_year, tm_mon */
|
||||||
GetTime(&certTime.tm_mon, date, &i); certTime.tm_mon -= 1; /* adjust */
|
GetTime((int*)&certTime.tm_year, date, &i); certTime.tm_year -= 1900;
|
||||||
GetTime(&certTime.tm_mday, date, &i);
|
GetTime((int*)&certTime.tm_mon, date, &i); certTime.tm_mon -= 1;
|
||||||
GetTime(&certTime.tm_hour, date, &i);
|
GetTime((int*)&certTime.tm_mday, date, &i);
|
||||||
GetTime(&certTime.tm_min, date, &i);
|
GetTime((int*)&certTime.tm_hour, date, &i);
|
||||||
GetTime(&certTime.tm_sec, date, &i);
|
GetTime((int*)&certTime.tm_min, date, &i);
|
||||||
|
GetTime((int*)&certTime.tm_sec, date, &i);
|
||||||
|
|
||||||
if (date[i] != 'Z') { /* only Zulu supported for this profile */
|
if (date[i] != 'Z') { /* only Zulu supported for this profile */
|
||||||
CYASSL_MSG("Only Zulu time supported for this profile");
|
CYASSL_MSG("Only Zulu time supported for this profile");
|
||||||
|
@@ -3846,7 +3846,7 @@ int rsa_test(void)
|
|||||||
|
|
||||||
#if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048)
|
#if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048)
|
||||||
#ifdef FREESCALE_MQX
|
#ifdef FREESCALE_MQX
|
||||||
static const char* dhKey = "a:\certs\\dh2048.der";
|
static const char* dhKey = "a:\\certs\\dh2048.der";
|
||||||
#else
|
#else
|
||||||
static const char* dhKey = "./certs/dh2048.der";
|
static const char* dhKey = "./certs/dh2048.der";
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user