mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 03:05:44 +01:00
x509_get_current_time() uses localtime_r() to prevent thread issues
This commit is contained in:
parent
4c284c9141
commit
5fff23b92a
@ -59,6 +59,7 @@ Bugfix
|
|||||||
* ssl_handshake_init() was leaving dirty pointers in subcontexts if malloc
|
* ssl_handshake_init() was leaving dirty pointers in subcontexts if malloc
|
||||||
of one of them failed
|
of one of them failed
|
||||||
* Fix typo in rsa_copy() that impacted PKCS#1 v2 contexts
|
* Fix typo in rsa_copy() that impacted PKCS#1 v2 contexts
|
||||||
|
* x509_get_current_time() uses localtime_r() to prevent thread issues
|
||||||
|
|
||||||
= PolarSSL 1.3.4 released on 2014-01-27
|
= PolarSSL 1.3.4 released on 2014-01-27
|
||||||
Features
|
Features
|
||||||
|
@ -636,18 +636,18 @@ static void x509_get_current_time( x509_time *now )
|
|||||||
now->min = st.wMinute;
|
now->min = st.wMinute;
|
||||||
now->sec = st.wSecond;
|
now->sec = st.wSecond;
|
||||||
#else
|
#else
|
||||||
struct tm *lt;
|
struct tm lt;
|
||||||
time_t tt;
|
time_t tt;
|
||||||
|
|
||||||
tt = time( NULL );
|
tt = time( NULL );
|
||||||
lt = localtime( &tt );
|
localtime_r( &tt, < );
|
||||||
|
|
||||||
now->year = lt->tm_year + 1900;
|
now->year = lt.tm_year + 1900;
|
||||||
now->mon = lt->tm_mon + 1;
|
now->mon = lt.tm_mon + 1;
|
||||||
now->day = lt->tm_mday;
|
now->day = lt.tm_mday;
|
||||||
now->hour = lt->tm_hour;
|
now->hour = lt.tm_hour;
|
||||||
now->min = lt->tm_min;
|
now->min = lt.tm_min;
|
||||||
now->sec = lt->tm_sec;
|
now->sec = lt.tm_sec;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user