fix: Strip uint256 zero padding before rendering EIP-712 datetime values
ui_712_format_datetime() decoded the timestamp with u64_from_BE(data, length), which reads at most 8 bytes from the start of the buffer. EIP-712 typically declares timestamps as uint256, so a host-supplied 32-byte value carries its trailing 8 bytes as the meaningful payload and zero-pads the first 24. The formatter therefore read 8 bytes of padding, displayed 1970-01-01, and let the user sign a hash computed over the actual timestamp. Detect that the buffer is wider than uint64_t, verify the leading bytes are zero, and advance the data pointer past the padding so the decoded timestamp matches what is being hashed. Non-zero leading bytes mean the value cannot fit a time_t — refuse the screen in that case rather than wrap to an arbitrary date. (cherry picked from commit c09c0e48492646a7087e533c254c8846f92e1148)
C
Charles-Edouard de la Vergne committed
1150dd5a69fb39e01034c1b613a5833a3b23f64e
Parent: e1a550a
Committed by Alexandre Paillier <alexandre.paillier@ledger.fr>
on 8/25/2026, 3:04:01 PM