feat(libSceLibreSsl3): implement EVP_CIPHER_nid, BN_is_negative and RSA_bits #14008
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14008"
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 Appelschorle187 on 2026-10-31T15:41:32Z.
What
Names and implements three libSceLibreSsl3 exports that were placeholders known only by NID. Each name was matched with
compute_nidfromtools/nid_names.py. The behaviour follows LibreSSL 4.0.0:EVP_CIPHER_nid(aLdgrI2jAF0) returnsnidat offset 0 of the 80-byteEVP_CIPHER.BN_is_negative(AiNud8LR8B4) returnsneg != 0from the 24-byteBIGNUM. The newinclude/Bignum.hppdefinesLibreSsl3Bignum.RSA_bits(3KZ-L4y1gak) returnsBN_num_bits(n), readingnat offset 24 of the module's existing 152-byteLibreSsl3Rsalayout.A null argument throws, as do malformed bignums: negative
top, nulld, or a bit count aboveINT_MAX. The additional-export inventory goes from 177 entries (126 known only by NID) to 174 (123). Debt entries record that none of this is checked on the console. They also record that the console's RSA layout (offset 24 here, 32 in libSceLibreSsl'sLibreSslRsa) is unverified.Tested
Linux x86-64 (GCC). Built the libSceLibreSsl3 test targets and ran
ctest -R "guest_libressl3|guest_crypto_memcmp": 9 of 9 passed, including the newguest_libressl3_bignumandguest_libressl3_rsa, andguest_libressl3_cipher, which now coversEVP_CIPHER_nid.tools/check_conventions.py --base origin/mainandtest_public_headers.py --audit-onlypass.nm -Don the builtlibSceLibreSsl3.prxshowsEVP_CIPHER_nid_nid_postfix,BN_is_negative_nid_postfixandRSA_bits_nid_postfix. No title, Windows or console testing.The
INT_MAXcase intests/Rsa.cppcomputes adpointer throughuintptr_tso thatd[top - 1]lands on one stack word instead of allocating 256 MiB. This is implementation-defined but holds on flat x86-64 address spaces.tools/pr_overlap.pylists #10461, #10557, #10631, #10960, #12754, #12928, #12945 and #13662. They share files (Api.hpp,CMakeLists.txt,Key.hpp,AdditionalExports.cpp, the debt file) but none implements these exports.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
https://claude.ai/code/session_013rhFWQL7oZRJSiGdkL5Gkn
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T15:49:03Z.
Review: COMMENTED
Tests run and reviewed — approval withheld pending PS5 RSA layout evidence
The implementations match the pinned LibreSSL source model, but the PR leaves the
RSA.nlayout unverified for the console module andRSA_bitsdereferences that field.What I ran
Reviewed head
c6ee4cf150339432043d141947c859c3fd034099against base474030e58424fefdb65e5df9f3820810fbb4553c; the exact head has a clean individual merge preview. Environment: Debian Linux 6.1 x86_64, Python 3.11.2, GCC 12.2.0. No project build or C++ test run.I also inspected the exact CMake test registration and the pinned LibreSSL source files cited by the PR.
Results
tools/nid_names.py.Unknown_*placeholders removed as the same NIDs are renamed by this PR.${CMAKE_CURRENT_SOURCE_DIR}paths.pr_abi_audit.pyandpr_test_quality.py, so the precheck could not invoke those helpers from that checkout. I ran the current local helpers against the exact PR commits instead.Unedited relevant output
NID mapping:
ABI audit, filtered to the three new symbols and its findings:
Test-quality heuristic:
LibreSSL source lookup:
Negative control
Findings
Blocking
None confirmed from the inspected source and checks.
Non-blocking
RSA_bitsreadsrsa->nat offset 24. The cited LibreSSL 4.0.0rsa_local.hhas that layout, but the PR's debt entry explicitly says the PS5 console layout is unverified; the other AnyPS5LibreSslRsamodel placesnat offset 32 because it includes anenginefield. This is a material ABI uncertainty, so I am withholding approval rather than treating the upstream layout as console evidence. Please provide evidence that the exactlibSceLibreSsl3RSA object uses offset 24, or keepRSA_bitsthrowing until that layout is established.RSA_bitsbehavior torsa_lib.c, but the function body is in the pinned LibreSSLrsa_eay.c;rsa_lib.conly callsRSA_bitsfromRSA_security_bits. Please correct the source link.Sources
nafterenginelibSceLibreSsl3model placesnat offset 24RSA_bitsimplementationBN_is_negativeimplementationEVP_CIPHER_nidimplementationNot verified
I did not build the PR or run its C++ tests, Windows tests, a title, or console behavior. The 9/9 test result is author-reported. In particular, I could not verify that the console's
libSceLibreSsl3RSA object matches the upstream structure at offset 24.To get this to a good state
Add evidence for the console RSA layout at offset 24 (or leave that export throwing), and correct the
RSA_bitssource link. I will reassess the same checks on the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T15:49:16Z.
Review: COMMENTED
Tests run and reviewed — approval withheld pending PS5 RSA layout evidence
The implementations match the pinned LibreSSL source model, but the PR leaves the
RSA.nlayout unverified for the console module andRSA_bitsdereferences that field.What I ran
Reviewed head
c6ee4cf150339432043d141947c859c3fd034099against base474030e58424fefdb65e5df9f3820810fbb4553c; the exact head has a clean individual merge preview. Environment: Debian Linux 6.1 x86_64, Python 3.11.2, GCC 12.2.0. No project build or C++ test run.I also inspected the exact CMake test registration and the pinned LibreSSL source files cited by the PR.
Results
tools/nid_names.py.Unknown_*placeholders removed as the same NIDs are renamed by this PR.${CMAKE_CURRENT_SOURCE_DIR}paths.pr_abi_audit.pyandpr_test_quality.py, so the precheck could not invoke those helpers from that checkout. I ran the current local helpers against the exact PR commits instead.Unedited relevant output
NID mapping:
ABI audit, filtered to the three new symbols and its findings:
Test-quality heuristic:
LibreSSL source lookup:
Negative control
Findings
Blocking
None confirmed from the inspected source and checks.
Non-blocking
RSA_bitsreadsrsa->nat offset 24. The cited LibreSSL 4.0.0rsa_local.hhas that layout, but the PR's debt entry explicitly says the PS5 console layout is unverified; the other AnyPS5LibreSslRsamodel placesnat offset 32 because it includes anenginefield. This is a material ABI uncertainty, so I am withholding approval rather than treating the upstream layout as console evidence. Please provide evidence that the exactlibSceLibreSsl3RSA object uses offset 24, or keepRSA_bitsthrowing until that layout is established.RSA_bitsbehavior torsa_lib.c, but the function body is in the pinned LibreSSLrsa_eay.c;rsa_lib.conly callsRSA_bitsfromRSA_security_bits. Please correct the source link.Sources
nafterenginelibSceLibreSsl3model placesnat offset 24RSA_bitsimplementationBN_is_negativeimplementationEVP_CIPHER_nidimplementationNot verified
I did not build the PR or run its C++ tests, Windows tests, a title, or console behavior. The 9/9 test result is author-reported. In particular, I could not verify that the console's
libSceLibreSsl3RSA object matches the upstream structure at offset 24.To get this to a good state
Add evidence for the console RSA layout at offset 24 (or leave that export throwing), and correct the
RSA_bitssource link. I will reassess the same checks on the updated head.Pull request closed