diff options
author | John Baldwin <jhb@FreeBSD.org> | 2022-02-23 17:18:22 -0800 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2022-03-03 13:33:12 +0000 |
commit | 0176fc78d090210cd7e231a7c2c4564464509506 (patch) | |
tree | 85360e6ebe63834bdc2bef7511ae4385118aed88 /apps | |
parent | 065442165a3d339a7de469b4cd18a3f902c73443 (diff) |
asn1_string_to_time_t: Use timegm on FreeBSD.
FreeBSD does not provide a global timezone variable containing the
offset to UTC. Instead, FreeBSD's libc includes a legacy timezone
function dating back to Version 7 AT&T UNIX. As a result,
asn1_string_to_time_t currently fails to compile on FreeBSD as it
subtracts a function from a time_t value:
../crypto/asn1/a_time.c:625:37: error: invalid operands to binary expression ('time_t' (aka 'long') and 'char *(int, int)')
timestamp_utc = timestamp_local - timezone;
~~~~~~~~~~~~~~~ ^ ~~~~~~~~
1 error generated.
However, FreeBSD's libc does include a non-standard (but widely
available) timegm function which converts a struct tm directly to a
UTC time_t value. Use this on FreeBSD instead of mktime.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17765)
Diffstat (limited to 'apps')
0 files changed, 0 insertions, 0 deletions