mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-02-03 23:55:05 +01:00
Fix for Zephyr TimeNowInMilliseconds. Resolves issue with TLS v1.3 server and session tickets time (uptime in sim < 1000 ms was being made 0).
This commit is contained in:
@@ -9768,7 +9768,12 @@ ProtocolVersion MakeDTLSv1_3(void)
|
||||
|
||||
word32 LowResTimer(void)
|
||||
{
|
||||
return k_uptime_get() / 1000;
|
||||
int64_t t;
|
||||
#if defined(CONFIG_ARCH_POSIX)
|
||||
k_cpu_idle();
|
||||
#endif
|
||||
t = k_uptime_get(); /* returns current uptime in milliseconds */
|
||||
return (word32)(t / 1000);
|
||||
}
|
||||
|
||||
#elif defined(WOLFSSL_LINUXKM)
|
||||
|
||||
@@ -1910,10 +1910,12 @@ end:
|
||||
#elif defined(WOLFSSL_ZEPHYR)
|
||||
word32 TimeNowInMilliseconds(void)
|
||||
{
|
||||
int64_t t;
|
||||
#if defined(CONFIG_ARCH_POSIX)
|
||||
k_cpu_idle();
|
||||
#endif
|
||||
return (word32)k_uptime_get() / 1000;
|
||||
t = k_uptime_get(); /* returns current uptime in milliseconds */
|
||||
return (word32)t;
|
||||
}
|
||||
|
||||
#else
|
||||
@@ -2201,10 +2203,12 @@ end:
|
||||
#elif defined(WOLFSSL_ZEPHYR)
|
||||
sword64 TimeNowInMilliseconds(void)
|
||||
{
|
||||
int64_t t;
|
||||
#if defined(CONFIG_ARCH_POSIX)
|
||||
k_cpu_idle();
|
||||
#endif
|
||||
return (sword64)k_uptime_get() / 1000;
|
||||
t = k_uptime_get(); /* returns current uptime in milliseconds */
|
||||
return (sword64)t;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user