feat(libSceLibreSsl3): implement MD5 and SHA1 #9043
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9043"
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 HQasper on 2026-10-21T10:38:05Z.
What
All 87 libSceLibreSsl3 exports threw. This implements the
MD5andSHA1one-shots.CRYPTO_memcmpis left to #8956, which implements it first; this PR is built on top of it.MD5(d, n, md)andSHA1(d, n, md)runInit,UpdateandFinalthrough libSceLibreSsl'sMD5_*andSHA1_*(#9025), so there is a single digest implementation. They returnmd. libSceLibreSsl3 links libSceLibreSsl, and the patched module imports the six NIDs, which libSceLibreSsl exports.NotImplemented_nid_no_patch. LibreSSL up to 3.8 hashes into a static buffer and returns it, while later versions do not check the argument, and the console's version is unknown.CMakeLists.txtthat #8956 adds now also buildssrc/Digest.cpp, links libSceLibreSsl and adds the new test next to #8956's.Tested
Linux (Ubuntu 24.04.5 container, GCC 13.3, Release,
BUILD_TESTING=ON):guest_libressl3_digest: passed. It checksMD5andSHA1against the RFC 1321 and FIPS 180 values forabc, the empty string and one milliona, and that they write only the digest length and return the buffer. It also checks the throwing cases.guest_crypto_memcmp(from #8956),guest_libressl_digest(from #9025) andpatched_libraries: passed. The patchedlibSceLibreSsl3.prxneedslibSceLibreSsl.prx, and all six imported NIDs are defined there. Its export set is unchanged (87 names).python3 tools/check_conventions.py --base origin/main: passed.Note: until #8956 and #9025 merge, this PR also shows their commits. After they merge, I rebase it onto main so only its own commit is left.
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 repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T10:38:56Z.
Progress report (
950388b→71ce2fe)📈 System libraries: 42.29% (+0.19%, +21 implemented functions)
✅ 21 implemented
MD4_Final_nid_postfixMD4_Init_nid_postfixMD4_Update_nid_postfixMD5_Final_nid_postfixMD5_Init_nid_postfixMD5_Update_nid_postfixSHA1_Final_nid_postfixSHA1_Init_nid_postfixSHA1_Update_nid_postfixSHA224_Final_nid_postfixSHA224_Init_nid_postfixSHA224_Update_nid_postfixSHA256_Final_nid_postfixSHA256_Init_nid_postfixSHA256_Update_nid_postfixSHA384_Final_nid_postfixSHA384_Init_nid_postfixSHA384_Update_nid_postfixSHA512_Init_nid_postfixSHA512_Update_nid_postfixCRYPTO_memcmp_nid_postfixImported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-21T17:06:36Z.
Support triage — overlap note: this PR's
CRYPTO_memcmpforlibSceLibreSsl3(Export.cpp removal + Digest.cpp implementation, constant-time XOR fold) is the same function #8956 (ynkmyz233, opened earlier) implements inlibSceLibreSsl3/Export.cppwith its own test file. Whichever lands first will conflict the other inExport.cpp; please coordinate with the author of #8956 and declareDepends onon the checklist line. Note the two implementations differ subtly: #8956 reads throughvolatilepointers to defeat compiler optimization of the fold; this one does not — worth aligning on the constant-time property either way.Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T17:51:09Z.
Windows run of 352eae4f2a merged onto
main745b394629(650f732293, clean), the platform the description lists as not tested. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release,BUILD_TESTING=ON.Built
libSceLibreSsl,libSceLibreSsl3,guest_libressl_digest_testsandguest_libressl3_digest_testswith no errors or warnings.ctest --repeat until-fail:2onguest_libressl_digestandguest_libressl3_digest: both pass on both repeats. Not run: a title.Imported from boykopovar/AnyPS5. Originally posted by HQasper on 2026-10-21T18:05:33Z.
@blawesom Thanks for the note. #8956 is older, so it goes first. I have removed
CRYPTO_memcmpfrom this PR and rebuilt it on top of #8956, so it now only implementsMD5andSHA1and no longer conflicts with #8956. The checklist says Depends on: #8956, #9025. Until both merge, this PR also shows their commits, and I will rebase it ontomainafter they land.@ycbuzi Thanks for validating the Windows build and confirming
guest_libressl_digestandguest_libressl3_digestpass on repeated runs. Much appreciated.