feat(libSceLibreSsl3): implement X509_gmtime_adj #17242
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17242"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by fishingpvalues on 2026-11-08T16:05:33Z.
What
feat(libSceLibreSsl3): implement X509_gmtime_adj. The implementation and its technical-debt entry are in this branch; the export leaves
AdditionalExports.cppand gains its real signature ininclude/Api.hpp.Tested
Linux x86-64 (CachyOS, GCC 16.2.1), Release,
BUILD_TESTING=ON, basemain828e44310e:cmake --build build --target guest_libressl3_x509_gmtime_adj_tests --parallel 6: passed.ctest --test-dir build -R '^guest_libressl3_x509_gmtime_adj$' --output-on-failure: 1/1 passed.python3 tools/check_conventions.py --base origin/main: passed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T16:27:24Z.
Review: COMMENTED
Read against the LibreSSL in
3rdparty/libressl-openbsd(078b3d1d), which is what this module follows. I haven't built or run this branch. One host check was run on Windows, below.Host
gmtimerange on Windows. The new time is formatted withstd::gmtime. With WinLibs GCC 15.2 (UCRT, 64-bittime_t),gmtimereturns NULL for 1940-01-01 (-946080000) and for 3000-01-01 or later. I checked the second at32538240000. LibreSSL formats any year from 1950 to 9999 (asn1/a_time_tm.c).So on Windows, an adjustment that lands in 1950-1969 or in 3000-9999 returns null here, which is a valid time in LibreSSL. A calendar conversion that doesn't depend on the host (days-from-civil) would avoid both the range limit and the non-reentrant
gmtime.Null
s.X509_gmtime_adj(NULL, adj)allocates a newASN1_TIMEin LibreSSL (x509_vfy.c→ASN1_TIME_adj). Here it returns null.Years outside 1950-9999. These are accepted and printed with
%04dhere. LibreSSL rejects them withASN1_R_ILLEGAL_TIME_VALUE.now + adjustmentcan also overflowint64.The signature uses
std::int64_tfor the guestlong, which is right for LLP64 Windows.Debt file: compared with
main, this branch'sdocs/dev/debt/libSceLibreSsl3.mddrops aBIO_methline thatmainnow has (src/BioMethod.cpp, #15761), and it repeats the new bullet on two consecutive lines. It looks rebased from an older copy of the file.Pull request closed