feat(libSceLibreSsl3): implement X509_VERIFY_PARAM_set_flags #13662
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13662"
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-10-30T22:11:27Z.
What
Implements
X509_VERIFY_PARAM_set_flagsin libSceLibreSsl3, an additional export (13.60 table) that threw and was declared without parameters.The signature is
int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM*, unsigned long). LibreSSL 2.5.4 and 4.0.0x509_vpm.cboth OR the flags intoflagsand return 1, and that is what this does.The two versions differ in one case:
EXPLICIT_POLICY,INHIBIT_ANYorINHIBIT_MAPis set whilePOLICY_CHECKis neither already set nor requested. Then 2.5.4 also addsPOLICY_CHECK(they are part ofX509_V_FLAG_POLICY_MASK) and 4.0.0 does not. Which one the console follows is not established, so that case throws throughNotImplemented_nid_no_patchand leaves the parameters unchanged. In every other case, including policy flags requested together withPOLICY_CHECKor set when it is already set, both versions give the same result.It takes libSceLibreSsl's
LibreSslX509VerifyParam, the 2.5.4 parameters that the forwardedX509_STOREandX509_VERIFY_PARAM_*exports use.flagsis at offset 24 there and in 4.0.0'sx509_local.h; astatic_assertchecks it. LibreSSL dereferences the parameters without checking them, so null parameters throw.The debt entry records the version difference, the source and what is unverified. The additional-export inventory loses the function's row and its count drops from 177 to 176.
Tested
Ubuntu 26.04 (WSL2, kernel 6.18), GCC 15.2.0, Release, full build with
BUILD_TESTING=ON, rebased onmain474030e584(after #13659 and #13663).guest_libressl3_x509_verify_paramtest, with parameters filled with 0x5A and guarded by 16 bytes on each side:POLICY_CHECKalone,POLICY_CHECK | EXPLICIT_POLICY, and policy variables over an existingPOLICY_CHECK,X509_VERIFY_PARAM_set_flagsreturns 1, ORs the flags intoflagsand changes no other byte.EXPLICIT_POLICY,INHIBIT_ANY,INHIBIT_MAPandEXPLICIT_POLICY | PARTIAL_CHAINover 0,PARTIAL_CHAINandEXPLICIT_POLICYthrow the not-implemented error without changing any byte.std::invalid_argument.ctest -j16on head0736525cac: 3062/3062 pass.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T22:20:19Z.
Review: COMMENTED
Reviewed — approval withheld pending test-report clarification
The implementation matches the cited LibreSSL flag update, but the PR’s test section both reports and denies a full-suite run on this head.
What I ran
Reviewed head
a6007ddfc3693473f34091736588b23026cab2aaagainst base9605300f293b88295e223a27ff8cfecf24d7ab2a; the individual merge preview is clean. Environment: Debian Linux x86-64, Python 3.11.2; GCC 12.2.0 available but not invoked. No local build or C++ test was run.The declared predecessor is #13659. I also applied the #13659 and #13662 GitHub diff patches in that order with
git apply --3wayin a temporary worktree at the base. The second patch conflicted in shared CMake and debt files; I did not resolve the conflict or claim a completed integration test.Results
CMakeLists.txtanddocs/dev/debt/libSceLibreSsl3.md. This needs a refresh after #13659 lands; I am not asking for a premature rebase.9E9Gr4FLIE4.X509VerifyParam.cpp; this is a false positive.a6007ddfc3, then says the full suite on this branch is “not tested yet.” I did not independently run the suite.Unedited outputs from checks
git diff --checkproduced no output and exited 0.Negative control
I did not build the test executable or run a local negative control. The reported baseline and PR test runs were not independently reproduced here.
Findings
Blocking
No implementation defect was confirmed. I am withholding approval until the test report clarifies whether the claimed 3029-case run covered this exact head.
Non-blocking
Source inspection confirms the code throws for null parameters, ORs the requested flags into the field at offset 24, and returns 1; the test checks surrounding bytes and policy-flag behavior. The sequential dependency conflict should be revisited after #13659 lands.
Sources
Not verified
No local build, C++ test, Windows/macOS runtime, console behavior, or title test was run. The author-reported full-suite result was not independently reproduced, and the dependency-composed branch was not completed because the sequential patch check conflicted.
To get this to a good state
Please clarify whether
ctest -j16ran on heada6007ddfc3693473f34091736588b23026cab2aaand remove or correct the contradictory “Not tested yet” statement. After #13659 lands, refresh this branch, resolve the shared-file conflicts, and rerun the relevant checks on the resulting head; I will reassess that update.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T23:17:31Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The test pins a LibreSSL 4.0.0 policy-flag behavior that is version-sensitive and has not been established for this PS5 export.
What I ran
Reviewed head
a6007ddfc3693473f34091736588b23026cab2aaagainst PR base9605300f293b88295e223a27ff8cfecf24d7ab2a. The individual merge preview was clean against currentmain06f47c0e81076834a0aaeca0ec9affad7d5fafd9; the declared #13659 dependency head is not included, so this was not a combined-stack preview. Environment: Linux x86_64, Python 3.11.2; GCC 12.2.0 was available but not invoked.Results
git diff --checkUnedited command output
pr_precheck.py:Missing helper errors from its isolated checkout:
Filtered direct ABI audit output:
Hosted-check command output:
Negative control
EXPLICIT_POLICYleavesPOLICY_CHECKclearFindings
Blocking
EXPLICIT_POLICYbehavior is version-dependent and unverified for the target export. This head ORs the supplied flags directly and its test asserts thatEXPLICIT_POLICYdoes not setPOLICY_CHECK. In pinned LibreSSL 2.5.4 and 3.0.2,EXPLICIT_POLICYis included inX509_V_FLAG_POLICY_MASK, andX509_VERIFY_PARAM_set_flagssetsPOLICY_CHECKfor a policy-mask flag. LibreSSL 4.0.0 no longer has that side effect. The PR states that PS5 behavior has not been checked on console, and it uses the 2.5.4 parameter layout while selecting 4.0.0 flag semantics. Please provide pinned firmware/source evidence or a console result establishing the target behavior; otherwise implement and test the behavior supported by the target version. I will rerun the same checks on the new head.Sources
Not verified
I did not build locally, run CTest, or test the export on a PS5/title. The target firmware's exact version behavior remains unknown. The author's test report also contains the full-suite inconsistency already raised in my earlier review. The combined landing of #13659 followed by #13662 was not repeated in this session; the prior review recorded conflicts, and no premature rebase is requested while the dependency remains open.
To get this to a good state
Establish the target's policy-flag behavior with firmware-pinned source or a console result, then align the implementation and regression assertion with that evidence. Also resolve the already-raised test-report inconsistency. I will rerun the same checks on the new head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T16:57:32Z.
Review: APPROVED
Re-checked — new head, looks good
The updated implementation follows the shared behavior of the cited LibreSSL versions and leaves their version-dependent policy-flag case unmodified until console behavior is known.
What I ran
Reviewed head
0736525caca1e4c43ad49ada59e253da81cf0a07against base474030e58424fefdb65e5df9f3820810fbb4553c; the exact-head merge preview is clean against currentmain. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5. I did not invoke a compiler or build locally.I inspected the exact implementation, guarded-parameter tests, CMake/CTest registration, debt note, and the author’s update. The declared earlier dependencies have merged; the current head has no declared dependencies.
Results
9E9Gr4FLIE4and declaration/definition are present. This lexical audit does not prove binary ABI correctness or firmware version behavior.mainat474030e58424fefdb65e5df9f3820810fbb4553cctest -j16passing 3,062/3,062 on this exact head in Ubuntu 26.04 under WSL2 with GCC 15.2.0. I did not independently reproduce it.conventions,library-portability,eligibility, andreportpassed;labelsandwindowswere pending at the final snapshot. Linux, register-context, relinker, relinker-asan, and write-watch were skipped.Unedited local check output
Conventions stdout:
Filtered ABI audit output:
Current hosted-check output:
The precheck’s ABI and test-quality helper invocations could not run in its isolated checkout because those workspace-only scripts are absent there. I ran the ABI audit directly above; I manually inspected the tests. The precheck recorded the diff, conventions, and live mergeability checks as passed.
Findings
Blocking
None found in the updated head.
Non-blocking
The console’s behavior for the policy-flag combination that differs between LibreSSL 2.5.4 and 4.0.0 remains unknown. The PR records this in the debt entry and safely leaves those parameters unchanged by throwing rather than asserting either version’s behavior.
Sources
X509_VERIFY_PARAM_set_flagsX509_VERIFY_PARAM_set_flagsNot verified