[BUG] Setting correct UTC time is rejected #28629
Labels
bug
Something isn't working
needs triage
spec
Mismatch between spec and implementation
time sync
Implementation of the Time Synchronization cluster
Reproduction steps
Assuming Thread firmware development environment but the bug is not platform specific.
After building and flashing new firmware, setting the correct UTC time by the controller is rejected for "GMT offset" hours. Example for CET timezone, build made at 10:25:15 local time which is 08:25:15 UTC time:
The strange problem is caused by the SDK setting the build time to local time (the
__TIME__
macro gives local time), then during runtime the same integer gets compared with an actual incoming UTC time and ends up with the command being rejected for 2 hours.This can be a silent error (current commissioners ignore failure if setting the time fails, despite it being a possible security issue) or a functional error (e.g. in CET timezone TC-TIMESYNC-2.2 fails for 2 hours after firmware build, then it works).
Regarding comparing incoming time with current time and enforcing it to be greater can also be misused: if controller A sets UTC time to e.g. year 2033 (which is incorrect) no other controllers will be able to set it correctly afterwards. An attribute that cannot be corrected.
Bug prevalence
always
GitHub hash of the SDK that was being used
ba490f6
Platform
nrf
Platform Version(s)
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: