Skip to content

Commit 21137af

Browse files
author
MorganaFuture
committed
tls: Use real timestamp functions in process context
Fix x509_get_current_time() and ttls_tickets_configure() to use tfw_current_timestamp_real() instead of cached softirq-only functions.
1 parent c575685 commit 21137af

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tls/tls_ticket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ ttls_tickets_configure(TlsPeerCfg *cfg, unsigned long lifetime,
357357
}
358358

359359
timer_setup(&tcfg->timer, ttls_ticket_rotate_keys, 0);
360-
tfw_current_timestamp_ts64(&ts);
360+
tfw_current_timestamp_real(&ts);
361361
secs = tcfg->lifetime - (ts.tv_sec % tcfg->lifetime);
362362
mod_timer(&tcfg->timer, jiffies + msecs_to_jiffies(secs * 1000));
363363

tls/x509.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,10 @@ static void
709709
x509_get_current_time(ttls_x509_time *now)
710710
{
711711
struct tm t;
712+
struct timespec64 ts;
712713

713-
time64_to_tm(tfw_current_timestamp(), 0, &t);
714+
tfw_current_timestamp_real(&ts);
715+
time64_to_tm(ts.tv_sec, 0, &t);
714716

715717
now->year = t.tm_year + 1900;
716718
now->mon = t.tm_mon + 1;

0 commit comments

Comments
 (0)