Skip to content

openpgp: improve time_t overflow test on 32-bit platforms.

Daniel Kahn Gillmor requested to merge dkg/sequoia:32bit-time_t-test into main

on Debian GNU/Linux systems, time_t is 4 octets for i386 (rust calls this platform target_arch "x86"), armel ("arm"), armhf ("arm"), and mipsel ("mips"). I've pulled these arch names from platforms [0].

[0] https://github.com/RustSec/platforms-crate/blob/main/src/target/arch.rs

There are likely other platforms that have a 32-bit time_t (and indeed, some variants of 32-bit platforms like musl may have a 64-bit time_t [1]), so this gating mechanism still isn't quite right. But it's an improvement over the status quo of just gating on target_arch = "x86".

[1] https://musl.libc.org/time64.html

We also correct an assert into an assert_eq as noted by @nwalfield in #697 (closed).

Edited by Daniel Kahn Gillmor

Merge request reports