feat(libSceLibreSsl3): implement EVP_get_digestbyname #16258
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16258"
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 Ducengarth on 2026-11-06T01:19:18Z.
What
Implement
EVP_get_digestbyname(Wm24hhTLqWM) inlibSceLibreSsl3, replacing its parameterless throwing placeholder inAdditionalExports.cpp. Source: LibreSSL 4.0.0 atce488b78, the revision the library's debt file already uses:evp_names.c(digest_names[],digest_cmp,EVP_get_digestbyname).bsearchandstrcmp, not the old dynamicOBJ_NAMEtable, so there is no registration step (OpenSSL_add_all_digests) to depend on.digest_names[]. TheSN_*andLN_*macros were resolved to strings from the same revision'sobjects/objects.txt. Their order is checked at compile time by astatic_assertthat the names strictly increase understrcmp, the propertyregress/lib/libcrypto/evp/evp_test.cchecks. 44 of the names also appear in libSceLibreSsl's 2.5.4ObjectTable.cpp; the other 47 belong to objects added after 2.5.4 or are plain aliases such asrmd160andssl3-sha1.SHA256,sha256,RSA-SHA256andssl3-sha1match,Sha256,SHA-256andsha256do not. A null or unknown name returns null.EVP_md5,EVP_sha1,EVP_sha224,EVP_sha256,EVP_sha384andEVP_sha512. The lookup returns the same pointer those functions return, so the result works with the forwardedEVP_Digest*functions.NotImplemented_nid_no_patch, with the missing getter in the message, instead of returning null, which would tell the caller the name is unknown. When a digest lands (#15625 addsEVP_sha512_256), its case inResolvebecomes a return.OPENSSL_init_crypto(0, NULL)first and returns null if it fails. It only fails afterOPENSSL_cleanup, which neitherlibSceLibreSsl3norlibSceLibreSslexports, so the call is left out.The gap is recorded in
docs/dev/debt/libSceLibreSsl3.md, and the export inventory is updated (170 exports, 160 named).No title's trace or disassembly was used, and the export was not measured on a PS5.
pr_overlapreports no pull request with the same exports or new files. The "same exports" it lists (Allocate,Align,Calloc,Free,PosixAlign,Realign,Reallocate) are the test's file-local guest-heap callbacks, which other tests also define. It could not compare 53 pull requests that conflict withmainand shareAdditionalExports.cpp,CMakeLists.txt,include/Api.hppor the debt file. I checked their diffs by hand: none addsEVP_get_digestbyname, its NID or a digest name table. Line conflicts to expect:EVP_sha512_256) removes the placeholder right after this one inAdditionalExports.cppand the declaration after it inApi.hpp. If it merges first, theSha512_256case inResolveshould returnEVP_sha512_256and the test's available count goes from 43 to 47; I will rebase and do that.CMakeLists.txt.I scanned the
libSceLibreSsl3andlibSceLibreSsldiffs of all 1888 open pull requests forEVP_get_digestbyname, and none adds it.Tested
Windows 11, MinGW-w64 GCC (WinLibs), Release build. No title or homebrew, and not built on Linux or macOS.
guest_libressl3_digest_names(new) passes:EVP_Digestwith the result matches mbedtls. Each of the 48 others throws and names its getter.sha,sha2560), case and spacing variants, other spellings (SHA-256,SHA512/256), digests 4.0.0 does not list (md2,whirlpool,blake2b512), cipher names and non-digest object names all return null.guest_libressl*andguest_crypto_memcmptests pass.tools/check_test_registration.pypasses.objdump -ponlibSceLibreSsl3.prxlistsEVP_get_digestbyname_nid_postfixand nombedtls_*symbol.python3 tools/check_conventions.py --base upstream/mainpasses.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)🤖 Generated with Claude Code