fix: NTP syncs as soon as DHCP has a lease, random origin cookie instead of the unsynced local clock, TLS validates certificates against UTC

This commit is contained in:
daniel committed 2026-10-26 08:19:48 +01:00
1 parent 1d00c1c016
commit 7e036c94e7
13 files changed
+51 -59

No files matched your search

+3 -1
View File
@@ -37,7 +37,9 @@ static int64_t DateToEpoch(int year, int month, int day, int hour, int minute, i
static Timekeeping::DateTime EpochToDate(int64_t epoch) {
Timekeeping::DateTime dt = {};
int64_t rem = epoch;
/* Before the first NTP sync on a board with no RTC the clock sits near
the epoch, and a negative time zone pushes local time before it. */
int64_t rem = epoch < 0 ? 0 : epoch;
int year = 1970;
while (true) {
int64_t daysInYear = IsLeapYear(year) ? 366 : 365;