Repository navigation
feat(libSceLibreSsl3): implement MD5 and SHA1 - #9043
oneandonlydean merged 3 commits into
Conversation
Progress report (950388b → 71ce2fe)📈 System libraries: 42.29% (+0.19%, +21 implemented functions) ✅ 21 implemented
|
|
Support triage — overlap note: this PR's |
MD4, MD5, SHA1, SHA224, SHA256, SHA384 and SHA512 Init/Update/Final and the SHA256 one-shot threw. They now hash as LibreSSL does, on the caller's MD4_CTX, MD5_CTX, SHA_CTX, SHA256_CTX and SHA512_CTX laid out as in LibreSSL's md4.h, md5.h and sha.h, so a context copied or inspected by the title stays valid: the bit count in Nl/Nh, the partial block in data with its length in num, and md_len selecting the truncated digest. Final pads and clears the buffer as LibreSSL's sources do. Cases that differ between LibreSSL versions throw: SHA256 with a null digest buffer and SHA512_Final with the SHA-512/224 or SHA-512/256 length. The test checks the RFC 1320, RFC 1321 and FIPS 180 vectors over several chunk sizes, the context fields, copied contexts and those cases. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Both one-shots threw. They run Init, Update and Final through libSceLibreSsl's MD5_* and SHA1_*, which libSceLibreSsl3 now links, and return the digest buffer. A null digest buffer throws, since LibreSSL up to 3.8 hashes into a static buffer and later versions do not check it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Windows run of 352eae4 merged onto Built |
352eae4 to
71ce2fe
Compare
|
@blawesom Thanks for the note. #8956 is older, so it goes first. I have removed @ycbuzi Thanks for validating the Windows build and confirming |
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_*(feat(libSceLibreSsl): implement the MD4, MD5, SHA-1 and SHA-2 digests #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 feat(libressl3): implement CRYPTO_memcmp #8956 adds now also buildssrc/Digest.cpp, links libSceLibreSsl and adds the new test next to feat(libressl3): implement CRYPTO_memcmp #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 feat(libressl3): implement CRYPTO_memcmp #8956),guest_libressl_digest(from feat(libSceLibreSsl): implement the MD4, MD5, SHA-1 and SHA-2 digests #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)