From 205a7413076d7402e3d7bb1668f1a8e49c634292 Mon Sep 17 00:00:00 2001 From: Jerry Yu Date: Wed, 15 Mar 2023 18:58:51 +0800 Subject: [PATCH] change the clock source to MONOTONIC We need a non-settable source to avoid security issues. Signed-off-by: Jerry Yu --- library/platform_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/platform_util.c b/library/platform_util.c index 2b48f4f6a5..d8d9708379 100644 --- a/library/platform_util.c +++ b/library/platform_util.c @@ -181,7 +181,7 @@ mbedtls_ms_time_t mbedtls_ms_time(void) struct timespec tv; mbedtls_ms_time_t current_ms; - ret = clock_gettime(CLOCK_REALTIME, &tv); + ret = clock_gettime(CLOCK_MONOTONIC, &tv); if (ret) { return time(NULL) * 1000; }