Update key-init.sh year sanity check for 2026#2162
Conversation
Signed-off-by: PeonyThePeon <github-peon@runbox.com>
|
@PeonyThePeon, first, thank you for your contribution. The goal of the check for 2024 (year check was implemented) was to check if CMOS battery was disconnected, which resets RTC system clock to take time of build in combination to CONFIG_USE_PC_CMOS_ALTCENTURY bit (#2087), so key-init.sh checks system clock < date and guide user into configuring date+time in UTC/GMT as guided. Changing the date in code to 2026 has no impact on this; any date > 1970 (timeless build) will trip the condition and guide user with https://github.com/linuxboot/heads/blob/master/initrd/bin/change-time.sh depending on platform, with CONFIG_USE_PC_CMOS_ALTCENTURY, date can be either 1900 or 2000 (the century bit). Again, emphasizing here on the role of the check; time drift is common in all systems not syncing clock through ntp (which most OSes do silently through different mechanisms). This is also why Heads shows date+time averywhere (?) with timezone (UTC/GMT) so user can check the time; since a time drift of only a couple of seconds will not generate the same TOTP code on phone vs Heads. As doc says (?) if TOTP is wrong, do not type any secret, and then GUI proposes to change time too under Settings and TOTP/HOTP mismatch, also guiding user to actually launch TLDR: Maybe the code comments could be clearer here, but changing 2024 to 2026 is not a needed fix. |
|
Recent validation #2133 (comment) |
No description provided.