feat(libSceLibreSsl3): implement RSA_get0_factors and RSA_get0_crt_params #14366
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14366"
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 AlexWhitehouse on 2026-11-01T10:35:18Z.
What
Implements
RSA_get0_factors(PcUZS7XHwHk) andRSA_get0_crt_params(eyrIagsax0w) in libSceLibreSsl3, which throw onmainsince #13831 named them. Both are ported from LibreSSL 4.0.0rsa_lib.c, the version the debt file already targets:They read the existing 152-byte
LibreSsl3Rsa.Key.hppnow pinsp,q,dmp1,dmq1andiqmpat offsets 48, 56, 64, 72 and 80. Those offsets matchstruct rsa_stin LibreSSL 4.0.0rsa_local.h, checked by compiling both declarations side by side.The debt file gets a Functional entry and drops the two inventory rows. The inventory sentence now also counts the names #13831 added: 174 callable exports, 164 named and 10 known only by NID. On
mainit still says 50 named and 126 unknown.Tested
guest_libressl3_rsa_getters. It resolves both exports by NID from the patchedlibSceLibreSsl3.prx. It covers:main(a644edf30c) the test fails withRSA_get0_factors threw: RSA_get0_factors_nid_postfix not implementedandRSA_get0_crt_params threw: RSA_get0_crt_params_nid_postfix not implemented. On this branch it passes.ctest --test-dir build-full -R 'guest_libressl3|guest_crypto_memcmp|public_headers': 75/75 passed.python3 tools/check_conventions.py --base origin/main: all conventions checks passed.python3 tools/pr_overlap.py --branch feat/libressl3-rsa-get0-factors-crt: no PR shares these exports. #10960 and #12945 only add lines next to these inKey.hpp,Key.cppand the debt file. The tool could not compare 11 open libSceLibreSsl3 PRs that conflict withmain(#9970, #10452, #10461, #10490, #10491, #10493, #10557, #10631, #11146, #12754, #14212), so I grepped their diffs: none adds either export or NID. #10490 implementsRSA_get0_keyand the DH and DSA accessors.guest_libressl_protocol_nid.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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T10:45:55Z.
Review: COMMENTED
Reviewed — no blocking findings
The two getters match the null handling and output order of LibreSSL 4.0.0
RSA_get0_factorsandRSA_get0_crt_params, and the new RSA field offsets match upstreamrsa_ston LP64; I did not build or run the new test, and hosted checks were still pending when I checked.What I ran
Exact head
c947e1d29833f36b204ed802763adb69ef3ba4ba, baseba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4(currentmain, the PR base). Environment: Debian 12, Linux x86-64, Python 3.11.2, GCC 12.2.0 driver (no compile).The precheck ran its conventions, diff and live stack checks and passed them. Its ABI audit and test-quality steps reported failure only because
tools/pr_abi_audit.pyandtools/pr_test_quality.pyare absent from the head tree; I ran both by hand as shown above.Results
git diff --check(precheck)RSA_get0_factors(NIDPcUZS7XHwHk) andRSA_get0_crt_params(NIDeyrIagsax0w) each have one declaration and one definition.RsaGetters.cpp. False positive: the file is registered atcore/libs/prx/libSceLibreSsl3/CMakeLists.txtline 27.rsa_lib.catce488b78.LibreSsl3Rsap=48, q=56, dmp1=64, dmq1=72, iqmp=80 agree withstruct rsa_stinrsa_local.hatce488b78on LP64:padint at 0,versionat 8,methat 16, n at 24, e at 32, d at 40.AdditionalExports.cppand 10unknownrows in the debt table, so 164 named. This matches the new sentence.Unedited ABI audit output (filtered to the two changed getters)
Negative control
Not exercised by me. The author reports that the new test fails on
mainat its first sanity call (RSA_get0_factors threw: ... not implemented).Findings
Blocking: None.
Non-blocking: That base failure comes from the missing-implementation throw, not from an assertion about field reads or write order, so it does not show that
Runwould catch a wrong field. A small mutation (for example swappingdmp1anddmq1inKey.cpp) would show whether the assertions catch it. This is optional.Sources
RSA_get0_factorsandRSA_get0_crt_params, LibreSSL 4.0.0struct rsa_st, LibreSSL 4.0.0Not verified
guest_libressl3_rsa_getterswas not built or run. The author reports a 75/75 focused CTest run on Ubuntu 26.04 with GCC 15.2; I did not reproduce it.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T11:12:08Z.
Review: COMMENTED
Re-checked — new head, no blocking findings
The new head only adds the upstream copyright and licence header to
Key.cpp, and its first 58 lines match the citedrsa_lib.catce488b78byte for byte.What I ran
Exact head
1f2f909a26fbf51c5b768f021e561464caa2c62f, previously reviewed headc947e1d29833f36b204ed802763adb69ef3ba4ba, PR baseba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4. Environment: Debian 12, Python 3.11.2, git 2.39.5. No build, no compiler, no CTest.The precheck's ABI and test-quality helpers could not find their scripts in its isolated head tree, so I ran the ABI audit by hand as listed.
Results
c947e1d298core/libs/prx/libSceLibreSsl3/src/Key.cpp, 58 insertions and no deletions. No code or test change.Key.cppare identical to lines 1-58 ofrsa_lib.catce488b78.pr_abi_audit.py(by hand)RSA_get0_factors_nid_postfixandRSA_get0_crt_params_nid_postfixare declared inApi.hppand defined inKey.cpp.guest_libressl3_rsa_gettersc947e1d298.Findings
Blocking: None.
Non-blocking: None.
Sources
rsa_lib.cat the pinned commitKey.cppat the new headNot verified
guest_libressl3_rsa_getterstest were not run at this head. The mutation controls in the author's comment were run onc947e1d298, and I did not re-run them.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T14:22:35Z.
Review: COMMENTED
Reviewed — no blocking findings
RSA_get0_factorsandRSA_get0_crt_paramsmatch LibreSSL 4.0.0'srsa_lib.cline for line, and the struct offsets they read (p48,q56,dmp164,dmq172,iqmp80) match LibreSSL 4.0.0'srsa_st; the only difference is the explicit throw for a null key when an output is requested, which the PR documents.What I ran
2296f722a66def671a483d7406159f8f155337f5, baseba8dcc6ae8(the precheck base)./usr/bin/python33.11.2, no build.python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14366 --output-dir /dev/shm/reviewer-run/precheck/14366python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base ba8dcc6ae8 --head 2296f722a66def671a483d7406159f8f155337f5 --json(exit 0;passed; 0 findings; 270 symbols).core/libs/prx/libSceLibreSsl3/tests/RsaGetters.cppfrom a head extract: one literal-path registration heuristic.src/lib/libcrypto/rsa/rsa_lib.catce488b78e0bd994780569df718596b9776ff681a(lines 265-274 and 303-309), fetched withgh api. The port's bodies match those lines.src/lib/libcrypto/rsa/rsa_local.hat the same commit (struct rsa_st, lines 100-122) counted for LP64:pad0,version8,meth16,n24,e32,d40,p48,q56,dmp164,dmq172,iqmp80. The repository'sLibreSsl3Rsa(include/Key.hpp) has the same fields at the same offsets.Results
Precheck report, checks table, unedited (
/dev/shm/reviewer-run/precheck/14366/report.md):The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4...2296f722a66def671a483d7406159f8f155337f5/usr/bin/python3 tools/check_conventions.py --base ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4 --head 2296f722a66def671a483d7406159f8f155337f5 --title feat(libSceLibreSsl3): implement RSA_get0_factors and RSA_get0_crt_params --body /dev/shm/reviewer-run/precheck/14366/pr-body.md/usr/bin/python3 tools/pr_abi_audit.py --base ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4 --head 2296f722a66def671a483d7406159f8f155337f5 --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14366 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14366/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./usr/bin/python3 /dev/shm/reviewer-run/precheck/14366/head-2296f722a66d-0b7adab3/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14366/head-2296f722a66d-0b7adab3 --json core/libs/prx/libSceLibreSsl3/AdditionalExports.cpp core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/prx/libSceLibreSsl3/include/Api.hpp core/libs/prx/libSceLibreSsl3/include/Key.hpp core/libs/prx/libSceLibreSsl3/src/Key.cpp core/libs/prx/libSceLibreSsl3/tests/RsaGetters.cpp docs/dev/debt/libSceLibreSsl3.mdNo changed Python test module in tools/ can be run as a no-build base-source control.Negative control
Not run here. The test loads the patched
libSceLibreSsl3.prxfromPATCHED_DIR, which needs a build.Findings
Blocking: none.
Non-blocking:
Key.cppcarries the LibreSSL/SSLeay licence block, including the advertising-clause acknowledgement. That is the same maintainer question as in #14431 about copied licence text in source files.LibreSsl3layouts make; the console's revision is not recorded in the debt entry.Sources
github.com/libressl/openbsd@ce488b78e0/src/lib/libcrypto/rsa/rsa_lib.c (L265-L309)struct rsa_st(commit-pinned):github.com/libressl/openbsd@ce488b78e0/src/lib/libcrypto/rsa/rsa_local.h (L100-L122)github.com/boykopovar/AnyPS5@2296f722a6/core/libs/prx/libSceLibreSsl3/src/Key.cppNot verified
guest_libressl3_rsa_getterswas not built or run; it needs the patched library.conventions,eligibility,labels,library-portabilityandreportsucceeded;linux,register-context,relinker,relinker-asanandwrite-watchwere skipped.