feat(libSceLibreSsl3): implement PKCS5_PBKDF2_HMAC #15622
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15622"
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 alvaroelpob on 2026-11-03T22:11:39Z.
What
Implements
PKCS5_PBKDF2_HMACin libSceLibreSsl3: RFC 8018 PBKDF2 over libSceLibreSsl's HMAC, with the argument handling of LibreSSL 4.0.0evp_pbe.c: a null digest queuesEVP_R_MESSAGE_DIGEST_IS_NULLand returns 0, a password length of -1 meansstrlen, a null password or a negative length makes the HMAC key setup fail, so it returns 0, and a key length of 0 then returns 1. Inputs LibreSSL would overrun throw, checked in the same order.Tested
Linux x86-64 (WSL2), Release: the full build passes and
ctest --test-dir build -j16passes 3829 of 3829 tests, including the newguest_libressl3_pbkdf2, at head 7c4c98f872. The test reads the null-digest error back withERR_get_errorand fails against the previous head.python3 tools/check_conventions.py --base upstream/mainpasses. Not run on a console or in a title.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 BunnyFl on 2026-11-04T11:49:06Z.
Review: APPROVED
@alvaroelpob thanks for folding both differences in. At
7c4c98f872the function follows LibreSSL 4.0.0 at the commit you cite:EVP_MD_sizereportsEVP_R_MESSAGE_DIGEST_IS_NULLand returns -1 for a null digest (evp_digest.cL478-L485), andPKCS5_PBKDF2_HMACthen returns 0 (evp_pbe.cL338-L340). The code you queue matches: reason 159 (EVP_R_MESSAGE_DIGEST_IS_NULL,evp.hline 1251), library 6 (ERR_LIB_EVP,err.hline 153), function0xfffas the*errormacros use.while (tkeylen)loop (L349-L353). The host-safety throws now come only after both.What I ran: head
7c4c98f872merged ontomainb11c7bf84f, Windows 11, WinLibs GCC, Release:guest_libressl3_pbkdf2andpublic_headerspass (2 of 2);Pbkdf2.cppfrom the previous headc3bcda3c3fwith the new test kept:guest_libressl3_pbkdf2fails;LibreSslPutError_nid_no_patchcall removed: the test fails;if (keyLength == 0) return 1;moved after the salt check: the test fails;tools/check_conventions.py --base upstream/mainon the head: all checks passed;tools/pr_overlap.py --branch: besides #15624, no open PR addsPKCS5_PBKDF2_HMAC. I searched the open PRs and checked the diffs of #10960, #12315, #15163 and #15544, which share files without a comparison. #15514 leaves it as a placeholder.Approving.