feat(libSceLibreSsl3): implement RSAPublicKey_dup #19024
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19024"
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 fishingpvalues on 2026-11-12T16:34:39Z.
What
RSAPublicKey_dupleaves the throwingAdditionalExports.cppstub and returns a new key holding only the public components, matchingASN1_item_dup(&RSAPublicKey_it, rsa)for this module's 152-byte RSA layout. A null source, or one without bothnande, returns null. Otherwise a zeroed guest-heap key withversion0 andreferences1, asRSA_newinitialises them, receives copies ofnandethroughBN_dupandRSA_set0_key;d,p,q,dmp1,dmq1andiqmpstay null. A failed duplicate or setter frees the partial key and returns null. The test covers the null and missing-component cases, distinct component allocations and limb arrays, the untouched source, and a balanced guest-heap block count.Tested
Linux x86-64 (Debian 13, glibc 2.41, GCC 14.2.0), Release,
BUILD_TESTING=ON, basemainf9c2d92b91:cmake --build build --target guest_libressl3_rsa_public_key_dup_tests --parallel 8: passed.ctest --test-dir build -R '^guest_libressl3_rsa_public_key_dup$' --output-on-failure: 1/1 passed.python3 tools/check_conventions.py --base origin/main: all checks passed.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 repositorySummary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T07:32:06Z.
Review: COMMENTED
Reviewed RSAPublicKey_dup (PR 19024) — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
a102003454c5d3ce9a0687c5603fe8104ce4326e, basemain. I read the diff and the head source through the reader. I did not build or run any test.Results
check_conventions.pyFindings
Blocking
None.
Non-blocking
core/libs/prx/libSceLibreSsl3/src/RsaPublicKeyDup.cpp:31:RSA_set0_key_nid_postfixcannot return 0 here. Its early return (core/libs/prx/libSceLibreSsl3/src/RsaSetters.cpp:103) needs the copy's component and the argument to both be null, andnandeare non-null at this point. Failure throws instead (RsaSetters.cpp:100and:104), which skips the cleanup and leakscopy,nande. So the description's "a failed setter frees the partial key" does not hold. Smallest fix: drop the!RSA_set0_keybranch and note the throw path, or free the three blocks in a guard that covers the throw.core/libs/prx/libSceLibreSsl3/src/RsaPublicKeyDup.cpp:21and:26: the failure branches of the twoBN_dupcalls are not exercised.tests/RsaPublicKeyDup.cppcovers the null source, a missingn, a missingeand the success path. An allocator that fails on the Nth call would cover them and check that the live-block count returns to zero.Not verified
ctestforguest_libressl3_rsa_public_key_dup, andcheck_conventions.py. These are author-reported only, on Debian 13, glibc 2.41, GCC 14.2.0, basef9c2d92b91.RSAPublicKey_dup, including the claim that it matchesASN1_item_dup. The debt entry itself says this is unmeasured.RSA_newinitialisation (version0,references1, zeroed fields). The description says the copy follows it. I did not opencore/libs/prx/libSceLibreSsl3/src/RsaCrypto.cpp:1821.rsa->nandrsa->eare read directly on the caller's pointer (RsaPublicKeyDup.cpp:15).RSA_set0_keyreads its key through copy-in helpers. I did not confirm that direct reads match the other RSA exports.Duplicate_nid_no_patchcastsLibreSsl3Bignum*toBignum*(RsaPublicKeyDup.cpp:7). Both structs are 24 bytes withflagsat offset 20 (core/libs/prx/libSceLibreSsl3/include/Key.hpp:6-15andcore/libs/prx/libSceLibreSsl/include/Api.hpp:139-145). Nothing in this change asserts that they stay in step.Sources
Files read and excluded
AdditionalExports.cpp,CMakeLists.txt,include/Api.hpp,src/RsaPublicKeyDup.cpp,tests/RsaPublicKeyDup.cpp,docs/dev/debt/libSceLibreSsl3.md. Full file text was not opened.To get this to a good state
Nothing is required. The non-blocking points above are optional.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T01:39:41Z.
Review: APPROVED
Reviewed — looks good
The change implements public RSA key duplication with copied public components and adds a focused test; the inspected code shows no verified blocking defect.
What I ran
Reviewed head
975fdcff8aacbd670f784ab6e41b2b0562869dc0. Read the prepared diff and all six changed files listed as reviewed in the manifest, plus targeted definitions forBN_dup_nid_postfix,RSA_set0_key_nid_postfix, and RSA freeing. No commands or tests were run in this review; the description reports Linux x86-64 build, test, and convention checks as passed.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Did not run the build, tests, convention checker, Windows checks, or console behavior. No changed files were excluded; the manifest lists all six changed files as included and reviewed.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T22:02:32Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and its ownership behavior are supported by the source reviewed.
What I ran
Reviewed head
ba79b3fb438ede11c97882903cbce4550091ea4eusing the prepared diff and the pinned repository reader. No commands or tests were run by me. The description reports its Linux build, targeted test and convention check as passed; I did not independently run them.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read all six changed files listed as reviewed:
AdditionalExports.cpp,CMakeLists.txt,include/Api.hpp,src/RsaPublicKeyDup.cpp,tests/RsaPublicKeyDup.cpp, anddocs/dev/debt/changes/feat-libressl3-rsa-public-key-dup.md. The review manifest lists no excluded changed files. I did not run the reported checks or verify Windows, console, or title behavior.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T15:45:00Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
de12183bf2f8ca74e3966de6730e3a9b74a4e7a2. I did not run commands; build and test results below are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read all changed files listed in the manifest:
AdditionalExports.cpp,CMakeLists.txt,include/Api.hpp,src/RsaPublicKeyDup.cpp,tests/RsaPublicKeyDup.cpp, and the debt change fragment. No files were excluded in the manifest. I did not run the reported checks or verify Windows or console behavior.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-26T21:32:06Z.
Review: COMMENTED
Actionable comments posted: 1
25396089-7a30-48ab-8a12-dcf26383ef5eReviewing files that changed from the base of the PR and between
ac75555824and3fea631964.core/libs/prx/libSceLibreSsl3/AdditionalExports.cppcore/libs/prx/libSceLibreSsl3/CMakeLists.txtcore/libs/prx/libSceLibreSsl3/include/Api.hppcore/libs/prx/libSceLibreSsl3/src/RsaPublicKeyDup.cppcore/libs/prx/libSceLibreSsl3/tests/RsaPublicKeyDup.cppdocs/dev/debt/changes/feat-libressl3-rsa-public-key-dup.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T21:47:07Z.
Review: COMMENTED
Reviewed — no blocking findings
The implementation and all six changed files were reviewed at head
3fea6319646d1d4dfa9a78a123edc3d55e0cb6e7; no blocking defect was verified, but the reported checks were not run during this review.What I ran
No commands or tests were run. I inspected the prepared diff and targeted source at the stated head using
repo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
Build and test results, including the Linux run described by the author, were not independently verified. Windows, console, and title behavior were not tested. The diff excluded no changed files; all six changed files listed in the manifest were read.
To get this to a good state
Nothing is required. The author-reported checks are optional context; no commands need to be rerun based on this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T07:01:55Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and its focused test support merging.
What I ran
Reviewed head
4849d864876df037941959822d5ace3827b67bc1. I read the prepared description, commit list, manifest, diff, and all six changed files listed in the manifest. I also read the relevant BIGNUM duplication implementation, RSA layout, and related declarations. I did not run commands or tests; the build and test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the reported build, CTest, or conventions check. Windows, console, and title behavior were not verified. No files were excluded in the manifest;
files.jsonwas not available through the review reader, so any additional exclusion list could not be confirmed.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T11:54:19Z.
Review: COMMENTED
Compiled the changed RSA wrapper with
RsaPublicKeyDupagainst the existing Linux PRXs. The fixture passed its modulus and exponent copy checks, source preservation checks, and final allocation accounting.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:17:14Z.
Review: COMMENTED
I trial-merged the updated head
b569ee553ecleanly ontoa1b75b0947. The wrapper and fixture files are byte-for-byte identical to the revision covered by my prior Linux execution. The linkage should still be checked in the full current build because the surrounding LibreSSL exports and library have changed. The fixture checks allocations on the success path. If adding a cleanup regression, the failure of exponent duplication after a successful modulus duplication is the partial-allocation case worth exercising.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T22:49:13Z.
Review: COMMENTED
Reviewed — no blocking findings
The prepared diff covers six changed files and shows no verified blocking defect, but source context could not be confirmed because the pinned reader could not complete its lookup in the read-only workspace.
What I ran
Reviewed head
b569ee553eedf818cae8b68a7001a9f8e2c259c2using the prepared description, commits, manifest, diff, and included file snapshots. No merged-preview check or tests were run. I attempted a pinned source lookup withrepo_read.py; it failed when the reader tried to write its call log.Results
Negative control
Not run.
Findings
Blocking
None verified.
Non-blocking
The implementation’s calls into the existing BIGNUM and RSA helpers could not be checked against their definitions, so the review is incomplete.
Sources
Changed implementation at the reviewed head.
Not verified
Read the prepared diff hunks for all six changed paths and the full included text of the new source, test, and debt fragment.
files.jsonlists no excluded files. The full context of the existingAdditionalExports.cpp,CMakeLists.txt, andApi.hppfiles was not read. The definitions and behavior ofBN_dup_nid_postfix,RSA_set0_key_nid_postfix, and cleanup helpers remain unverified. Author-reported checks were not run during this review.To get this to a good state
Nothing is required. Optionally, repeat the pinned source lookup in a writable review context to confirm the helper behavior.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.