[php-src] PR #24058: Fix GH-21545: openssl_x509_parse() validTo_time_t after the year 3000
| From: | bukka | Date: | Thu, 01 Oct 2026 20:20:05 +0000 |
| Subject: | [php-src] PR #24058: Fix GH-21545: openssl_x509_parse() validTo_time_t after the year 3000 | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-39054@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/24058
Author: bukka
The ASN.1 time was converted to a timestamp with mktime() and a manual time zone correction.
MSVC's 64-bit mktime() cannot represent dates after 23:59:59 on 31 December 3000 UTC and
returns -1, which then had the local time zone adjustment added to it, producing values like 7199 or
32399.
Decode the string with ASN1_TIME_to_tm() and compute the timestamp directly from the UTC civil date,
so the result no longer depends on the C library's mktime() range or on the local time zone.
Closes GH-21545