feat(libSceLibreSsl3): implement AES_unwrap_key #14612

Merged
ahmadmuj merged 11 commits from upstream-pr/14612 into main 2026-11-08 10:53:45 +00:00
ahmadmuj commented 2026-11-01 16:23:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ahmadmuj on 2026-11-01T16:23:30Z.


What

AES_unwrap_key (JvoQz7GYOMo) in libSceLibreSsl3 was a throwing stub. This implements it as the RFC 3394 key unwrap from LibreSSL 4.0.0 aes.c (3.8.4 aes_wrap.c has the same body), on top of libSceLibreSsl's AES_decrypt. The prototype is the one in that version's aes.h.

  • A length that isn't a multiple of 8 or is under 24 returns -1 before any pointer is read.
  • An integrity mismatch zeroes the inlen - 8 output bytes and returns 0; success returns inlen - 8.
  • A null iv uses the default A6 IV. out == in works, as upstream.
  • A null key, input or output throws, where LibreSSL dereferences it.

The name only comes from the NID hash (tools/nid_names.py), so the debt entry says that and that nothing is checked on a console. The inventory row goes away. After merging main, the remaining inventory has 163 exports: 153 named and 10 known only by NID. AES_wrap_key stays an unknown row; I left it alone. I don't know of a title that calls this; it's coverage.

Tested

November 6 integration against 0fbe14c15361c420c65bc22cf2c3dc14cbda81d1:

  • Preserved main's changes and published history. Resolved inventory counts to 163 total / 153 named / 10 unknown, with 106/126 named NID entries.
  • The 106/126 subtotal comes from recounting the original NID-only rows. An older main merge undercounted them by one.
  • AES source and tests are unchanged from e7e69c303ffc.
  • Release focused build passes (386 steps). AES, comparison, and OBJ_cmp tests pass 4/4. Conventions and header audit pass (406 libraries / 30,660 exports).
  • Previous head e7e69c303ffc passes hosted Windows, conventions, and portability checks. Current-head CI is pending.
  • No new full build/full CTest, local Windows, console/dump, or timing run. Earlier evidence below remains tied to its tested head.

Current-main integration at f12bb19a681f, November 5:

  • Merged main at c4469b60daf23b849292256a65670a7a6b5527d4 without rewriting history. Resolved the shared inventory counters after the RSA getter changes.
  • AES source and tests are unchanged from ec9250fb3a6a.
  • Release build passes for AES, the comparison helper, and OBJ_cmp. Focused CTest passes 4/4. Current conventions and the public-header audit pass (406 libraries / 30,604 exports).
  • The earlier full build and algorithm checks below are from their stated head. This merge does not repeat full CTest, Windows, console, or timing runs.

November 5 update at ec9250fb3a6a, based on main at 4180951e90e6898c8eca3635d850cf4569305299:

  • Merged main without rewriting the published history.
  • The integrity comparison now uses the existing CRYPTO_memcmp_nid_postfix. The pinned LibreSSL source uses memcmp; this change accepts the review's hardening request.
  • Added rejection checks for each of the eight IV byte positions. Each checks the return value, cleared output, and guard bytes.
  • Fixed the loop increment that formed a pointer before the output array after each round.
  • Release build of the AES and comparison targets passes. guest_libressl3_aes, guest_libressl_aes, and guest_crypto_memcmp: 3/3 pass.
  • Current conventions and the public-header audit pass (406 libraries / 30,580 exports). The source license stays verbatim, including its trailing space on line 10.
  • Full Release build passes (7,603 steps). Full CTest, new Windows tests, and console tests were not run for this update.
  • No console tests or timing measurements. The new tests verify functional results, not constant timing.

Earlier November 1 results (before this update), Ubuntu 24.04 on WSL2, GCC 13.3, Release build:

  • New guest_libressl3_aes: aborts on main (the stub throws AES_unwrap_key_nid_postfix not implemented), passes with the fix.
  • It covers RFC 3394 4.1-4.6, a 48-block vector (counter past 0xff), an explicit IV, an IV mismatch, single-bit flips, a wrong KEK, bad lengths (0, 8, 16, 17, 20, 23, 25, 28, 31; also with null pointers), in-place unwrap, and null key/input/output. Guard bytes check that exactly inlen - 8 bytes are written or zeroed. All vectors match host OpenSSL 3.0.13 (cryptography 41.0.7).
  • Mutation check on the implementation: 14 mutants (counter direction, the > 0xff branch, zeroing extent, check order, ...), all caught.
  • Full build OK; full ctest 3155/3157; the 2 failures are guest_socket_options and guest_socket_read_write, which fail the same way on main on this WSL box (loopback). python3 tools/check_conventions.py --base origin/main: pass.
  • No console or dump test; nothing GPU related.

Overlap refreshed November 6 at 09:43 UTC: 1,855 open PRs across 19 complete REST pages. Checked all 44 PRs sharing the target paths, reusing unchanged head evidence. No other PR changes AES_unwrap_key or its test file. #15854 implements AES wrap and #16255 implements CCM in separate files. Shared inventory lines describe distinct exports.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5109231597 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14612). Originally posted by [ahmadmuj](https://github.com/ahmadmuj) on 2026-11-01T16:23:30Z. --- ### What `AES_unwrap_key` (`JvoQz7GYOMo`) in libSceLibreSsl3 was a throwing stub. This implements it as the RFC 3394 key unwrap from [LibreSSL 4.0.0 `aes.c`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/aes/aes.c#L190-L226) (3.8.4 `aes_wrap.c` has the same body), on top of libSceLibreSsl's `AES_decrypt`. The prototype is the one in that version's `aes.h`. - A length that isn't a multiple of 8 or is under 24 returns -1 before any pointer is read. - An integrity mismatch zeroes the `inlen - 8` output bytes and returns 0; success returns `inlen - 8`. - A null `iv` uses the default A6 IV. `out == in` works, as upstream. - A null key, input or output throws, where LibreSSL dereferences it. The name only comes from the NID hash (`tools/nid_names.py`), so the debt entry says that and that nothing is checked on a console. The inventory row goes away. After merging main, the remaining inventory has 163 exports: 153 named and 10 known only by NID. `AES_wrap_key` stays an `unknown` row; I left it alone. I don't know of a title that calls this; it's coverage. ### Tested November 6 integration against `0fbe14c15361c420c65bc22cf2c3dc14cbda81d1`: - Preserved main's changes and published history. Resolved inventory counts to 163 total / 153 named / 10 unknown, with 106/126 named NID entries. - The 106/126 subtotal comes from recounting the original NID-only rows. An older main merge undercounted them by one. - AES source and tests are unchanged from `e7e69c303ffc`. - Release focused build passes (386 steps). AES, comparison, and OBJ_cmp tests pass 4/4. Conventions and header audit pass (406 libraries / 30,660 exports). - Previous head `e7e69c303ffc` passes hosted Windows, conventions, and portability checks. Current-head CI is pending. - No new full build/full CTest, local Windows, console/dump, or timing run. Earlier evidence below remains tied to its tested head. Current-main integration at `f12bb19a681f`, November 5: - Merged `main` at `c4469b60daf23b849292256a65670a7a6b5527d4` without rewriting history. Resolved the shared inventory counters after the RSA getter changes. - AES source and tests are unchanged from `ec9250fb3a6a`. - Release build passes for AES, the comparison helper, and OBJ_cmp. Focused CTest passes 4/4. Current conventions and the public-header audit pass (406 libraries / 30,604 exports). - The earlier full build and algorithm checks below are from their stated head. This merge does not repeat full CTest, Windows, console, or timing runs. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> November 5 update at `ec9250fb3a6a`, based on `main` at `4180951e90e6898c8eca3635d850cf4569305299`: - Merged main without rewriting the published history. - The integrity comparison now uses the existing `CRYPTO_memcmp_nid_postfix`. The pinned LibreSSL source uses `memcmp`; this change accepts the review's hardening request. - Added rejection checks for each of the eight IV byte positions. Each checks the return value, cleared output, and guard bytes. - Fixed the loop increment that formed a pointer before the output array after each round. - Release build of the AES and comparison targets passes. `guest_libressl3_aes`, `guest_libressl_aes`, and `guest_crypto_memcmp`: 3/3 pass. - Current conventions and the public-header audit pass (406 libraries / 30,580 exports). The source license stays verbatim, including its trailing space on line 10. - Full Release build passes (7,603 steps). Full CTest, new Windows tests, and console tests were not run for this update. - No console tests or timing measurements. The new tests verify functional results, not constant timing. Earlier November 1 results (before this update), Ubuntu 24.04 on WSL2, GCC 13.3, Release build: - New `guest_libressl3_aes`: aborts on `main` (the stub throws `AES_unwrap_key_nid_postfix not implemented`), passes with the fix. - It covers RFC 3394 4.1-4.6, a 48-block vector (counter past 0xff), an explicit IV, an IV mismatch, single-bit flips, a wrong KEK, bad lengths (0, 8, 16, 17, 20, 23, 25, 28, 31; also with null pointers), in-place unwrap, and null key/input/output. Guard bytes check that exactly `inlen - 8` bytes are written or zeroed. All vectors match host OpenSSL 3.0.13 (`cryptography` 41.0.7). - Mutation check on the implementation: 14 mutants (counter direction, the `> 0xff` branch, zeroing extent, check order, ...), all caught. - Full build OK; full `ctest` 3155/3157; the 2 failures are `guest_socket_options` and `guest_socket_read_write`, which fail the same way on `main` on this WSL box (loopback). `python3 tools/check_conventions.py --base origin/main`: pass. - No console or dump test; nothing GPU related. Overlap refreshed November 6 at 09:43 UTC: 1,855 open PRs across 19 complete REST pages. Checked all 44 PRs sharing the target paths, reusing unchanged head evidence. No other PR changes `AES_unwrap_key` or its test file. #15854 implements AES wrap and #16255 implements CCM in separate files. Shared inventory lines describe distinct exports. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-01 16:40:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T16:40:30Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The unwrap integrity check uses std::memcmp, which does not promise content-independent timing, while the reference implementation uses a timing-safe comparison.

What I ran

Head: 23f2e489b43510c463975afaaae14a0a419af32b; base: f2d874c1fdccf781c0fa5d86619bb5dd8894b958 (main). Stack preview merged cleanly. Environment: Debian 12, Python 3.11.2, GCC 12.2.0. No build or C++ tests were run.

git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958 23f2e489b43510c463975afaaae14a0a419af32b
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14612
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 23f2e489b43510c463975afaaae14a0a419af32b --json
python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/prx/libSceLibreSsl3/tests/Aes.cpp

I read all six changed files, checked the CMake test registration and verified that the new declaration and definition compute to NID JvoQz7GYOMo.

Results

Check Result Note
Diff and conventions passed No whitespace or convention findings
Export audit passed Declaration/definition pair and NID match
Test registration passed AES CTest target is registered
Test-quality heuristic passed Its unregistered-test warning is a false positive; CMake explicitly registers the test
Stack preview passed Clean against current base
Hosted CI not run Required jobs are queued
C++ build/tests not run No build performed in initial review
Precheck check table (verbatim)
| Check | Status | Command / reason |
|---|---|---|
| build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` |
| diff_check | passed | `git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...23f2e489b43510c463975afaaae14a0a419af32b` |
| conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 23f2e489b43510c463975afaaae14a0a419af32b --title feat(libSceLibreSsl3): implement AES_unwrap_key --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14612-23f2e489b435/pr-body.md` |
| changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 23f2e489b43510c463975afaaae14a0a419af32b --json` |
| python_syntax | not_applicable | `No changed Python implementation files.` |
| related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` |
| python_test_registration | not_applicable | `No changed test_*.py files.` |
| live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14612 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14612-23f2e489b435/stack` |
| build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` |
| test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14612-23f2e489b435/head-23f2e489b435-79cf22e7/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14612-23f2e489b435/head-23f2e489b435-79cf22e7 --json core/libs/prx/libSceLibreSsl3/AdditionalExports.cpp core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/prx/libSceLibreSsl3/include/Api.hpp core/libs/prx/libSceLibreSsl3/src/Aes.cpp core/libs/prx/libSceLibreSsl3/tests/Aes.cpp docs/dev/debt/libSceLibreSsl3.md` |
| negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` |

The precheck could not find the workspace-only ABI and test-quality scripts in its detached snapshot. I ran both manually against this exact head. The ABI audit passed with no findings; manual inspection confirms the test registration despite the heuristic warning.

Negative control

Not run: the C++ tests require a built executable. The PR includes RFC 3394 vectors and an integrity-failure test, but I did not execute them.

Findings

Blocking

Use a timing-safe integrity comparison. Aes.cpp calls std::memcmp(block, iv, 8) to decide whether unwrap integrity succeeded. memcmp provides no content-independent timing guarantee. The LibreSSL 4.0.0 implementation cited by this PR compares the integrity block with timingsafe_memcmp; this repository already has CRYPTO_memcmp_nid_postfix, which accumulates differences over the full buffer. Use a constant-time comparison here to avoid data-dependent timing during key unwrap.

Non-blocking

None.

Sources

Not verified

I did not build or execute the C++ tests, measure timing behavior, or verify this implementation against a PS5. Hosted checks were queued when checked.

To get this to a good state

Replace the integrity memcmp with the existing constant-time comparison (or an equivalent), then I will rerun the precheck and AES tests on the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729147407 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14612#pullrequestreview-5729147407). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T16:40:30Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The unwrap integrity check uses `std::memcmp`, which does not promise content-independent timing, while the reference implementation uses a timing-safe comparison. ## What I ran Head: `23f2e489b43510c463975afaaae14a0a419af32b`; base: `f2d874c1fdccf781c0fa5d86619bb5dd8894b958` (`main`). Stack preview merged cleanly. Environment: Debian 12, Python 3.11.2, GCC 12.2.0. No build or C++ tests were run. ```text git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958 23f2e489b43510c463975afaaae14a0a419af32b python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14612 python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 23f2e489b43510c463975afaaae14a0a419af32b --json python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/prx/libSceLibreSsl3/tests/Aes.cpp ``` I read all six changed files, checked the CMake test registration and verified that the new declaration and definition compute to NID `JvoQz7GYOMo`. ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | No whitespace or convention findings | | Export audit | passed | Declaration/definition pair and NID match | | Test registration | passed | AES CTest target is registered | | Test-quality heuristic | passed | Its unregistered-test warning is a false positive; CMake explicitly registers the test | | Stack preview | passed | Clean against current base | | Hosted CI | not run | Required jobs are queued | | C++ build/tests | not run | No build performed in initial review | <details><summary>Precheck check table (verbatim)</summary> ```text | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...23f2e489b43510c463975afaaae14a0a419af32b` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 23f2e489b43510c463975afaaae14a0a419af32b --title feat(libSceLibreSsl3): implement AES_unwrap_key --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14612-23f2e489b435/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 23f2e489b43510c463975afaaae14a0a419af32b --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14612 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14612-23f2e489b435/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14612-23f2e489b435/head-23f2e489b435-79cf22e7/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14612-23f2e489b435/head-23f2e489b435-79cf22e7 --json core/libs/prx/libSceLibreSsl3/AdditionalExports.cpp core/libs/prx/libSceLibreSsl3/CMakeLists.txt core/libs/prx/libSceLibreSsl3/include/Api.hpp core/libs/prx/libSceLibreSsl3/src/Aes.cpp core/libs/prx/libSceLibreSsl3/tests/Aes.cpp docs/dev/debt/libSceLibreSsl3.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | ``` The precheck could not find the workspace-only ABI and test-quality scripts in its detached snapshot. I ran both manually against this exact head. The ABI audit passed with no findings; manual inspection confirms the test registration despite the heuristic warning. </details> ## Negative control Not run: the C++ tests require a built executable. The PR includes RFC 3394 vectors and an integrity-failure test, but I did not execute them. ## Findings ### Blocking **Use a timing-safe integrity comparison.** `Aes.cpp` calls `std::memcmp(block, iv, 8)` to decide whether unwrap integrity succeeded. `memcmp` provides no content-independent timing guarantee. The LibreSSL 4.0.0 implementation cited by this PR compares the integrity block with `timingsafe_memcmp`; this repository already has `CRYPTO_memcmp_nid_postfix`, which accumulates differences over the full buffer. Use a constant-time comparison here to avoid data-dependent timing during key unwrap. ### Non-blocking None. ## Sources - [AES unwrap implementation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/23f2e489b43510c463975afaaae14a0a419af32b/core/libs/prx/libSceLibreSsl3/src/Aes.cpp) - [Existing content-independent comparison at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/23f2e489b43510c463975afaaae14a0a419af32b/core/libs/prx/libSceLibreSsl3/Export.cpp#L35) - [LibreSSL 4.0.0 AES unwrap reference pinned to its source commit](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/aes/aes.c#L494-L528) ## Not verified I did not build or execute the C++ tests, measure timing behavior, or verify this implementation against a PS5. Hosted checks were queued when checked. ## To get this to a good state Replace the integrity `memcmp` with the existing constant-time comparison (or an equivalent), then I will rerun the precheck and AES tests on the updated head.
MarcZX10 commented 2026-11-01 16:55:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T16:55:12Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes still requested

The new head adds the requested source notice and volatile output clearing, but the unwrap integrity decision still uses std::memcmp and remains data-dependent.

What I ran

Re-checked head 503817973caec18f4dee7d5e10639723671e4613 against base f2d874c1fdccf781c0fa5d86619bb5dd8894b958; the merge preview is clean. Environment: Debian GNU/Linux 12, Python 3.11.2, Git 2.39.5. No build or C++ tests were run.

git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958 503817973caec18f4dee7d5e10639723671e4613
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14612
gh pr checks 14612 --repo boykopovar/AnyPS5

I also reviewed the change from the previously reviewed head 23f2e489b43510c463975afaaae14a0a419af32b: it only changes the license notice and integrity-failure output clearing. The four hosted checks are queued.

Results

Check Result Note
Patch whitespace failed Verbatim license line has trailing whitespace
Conventions and PR template passed Precheck passed
Merge preview passed Clean against current base
Integrity comparison review failed std::memcmp remains
ABI and test-quality helpers not run Helpers absent from fetched PR snapshot
C++ tests not run No build performed
Hosted CI not run Four checks remain queued
Commands and unedited output

git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958 503817973caec18f4dee7d5e10639723671e4613:

core/libs/prx/libSceLibreSsl3/src/Aes.cpp:10: trailing whitespace.
+ *    notice, this list of conditions and the following disclaimer. 

Precheck report: diff_check failed with the output above; conventions_and_pr_template passed with stdout:

All conventions checks passed.

The precheck's ABI and test-quality helper invocations could not run because those helper files are not present in its fetched PR snapshot. Its stack check passed and reported a clean merge preview against f2d874c1fdccf781c0fa5d86619bb5dd8894b958.

GitHub reported eligibility, library-portability, report, and conventions as queued on head 503817973caec18f4dee7d5e10639723671e4613.

Negative control

Not run: the AES C++ test requires an exact-head build. No timing measurement or negative control was performed.

Findings

Blocking

AES_unwrap_key_nid_postfix still compares the recovered integrity block with the IV using std::memcmp. This function validates key material, and memcmp may stop at the first differing byte; use the existing CRYPTO_memcmp_nid_postfix helper (or another content-independent comparison) so the integrity decision does not depend on the mismatch position.

Non-blocking

The added OpenSSL notice preserves a trailing space from the pinned source, so git diff --check reports it. The repository convention check passed; preserve the required notice verbatim unless maintainers confirm that whitespace normalization is acceptable.

Sources

Not verified

The C++ build and AES tests, timing behavior, Windows behavior, and console behavior were not independently verified.

To get this to a good state

Replace the integrity memcmp with the existing constant-time comparison while preserving the source notice. I will rerun the precheck and AES tests on the updated head; the test run requires a build.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729216409 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14612#pullrequestreview-5729216409). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T16:55:12Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes still requested The new head adds the requested source notice and volatile output clearing, but the unwrap integrity decision still uses `std::memcmp` and remains data-dependent. ## What I ran Re-checked head `503817973caec18f4dee7d5e10639723671e4613` against base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`; the merge preview is clean. Environment: Debian GNU/Linux 12, Python 3.11.2, Git 2.39.5. No build or C++ tests were run. ```sh git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958 503817973caec18f4dee7d5e10639723671e4613 python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14612 gh pr checks 14612 --repo boykopovar/AnyPS5 ``` I also reviewed the change from the previously reviewed head `23f2e489b43510c463975afaaae14a0a419af32b`: it only changes the license notice and integrity-failure output clearing. The four hosted checks are queued. ## Results | Check | Result | Note | |---|---|---| | Patch whitespace | failed | Verbatim license line has trailing whitespace | | Conventions and PR template | passed | Precheck passed | | Merge preview | passed | Clean against current base | | Integrity comparison review | failed | `std::memcmp` remains | | ABI and test-quality helpers | not run | Helpers absent from fetched PR snapshot | | C++ tests | not run | No build performed | | Hosted CI | not run | Four checks remain queued | <details><summary>Commands and unedited output</summary> `git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958 503817973caec18f4dee7d5e10639723671e4613`: ```text core/libs/prx/libSceLibreSsl3/src/Aes.cpp:10: trailing whitespace. + * notice, this list of conditions and the following disclaimer. ``` Precheck report: `diff_check` failed with the output above; `conventions_and_pr_template` passed with stdout: ```text All conventions checks passed. ``` The precheck's ABI and test-quality helper invocations could not run because those helper files are not present in its fetched PR snapshot. Its stack check passed and reported a clean merge preview against `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`. GitHub reported `eligibility`, `library-portability`, `report`, and `conventions` as queued on head `503817973caec18f4dee7d5e10639723671e4613`. </details> ## Negative control Not run: the AES C++ test requires an exact-head build. No timing measurement or negative control was performed. ## Findings **Blocking** `AES_unwrap_key_nid_postfix` still compares the recovered integrity block with the IV using `std::memcmp`. This function validates key material, and `memcmp` may stop at the first differing byte; use the existing `CRYPTO_memcmp_nid_postfix` helper (or another content-independent comparison) so the integrity decision does not depend on the mismatch position. **Non-blocking** The added OpenSSL notice preserves a trailing space from the pinned source, so `git diff --check` reports it. The repository convention check passed; preserve the required notice verbatim unless maintainers confirm that whitespace normalization is acceptable. ## Sources - [Integrity comparison at this head](https://github.com/boykopovar/AnyPS5/blob/503817973caec18f4dee7d5e10639723671e4613/core/libs/prx/libSceLibreSsl3/src/Aes.cpp#L89-L96) - [Existing `CRYPTO_memcmp_nid_postfix` implementation at the base](https://github.com/boykopovar/AnyPS5/blob/f2d874c1fdccf781c0fa5d86619bb5dd8894b958/core/libs/prx/libSceLibreSsl/Export.cpp#L35-L42) - [Pinned LibreSSL AES unwrap implementation](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/aes/aes.c#L494-L528) ## Not verified The C++ build and AES tests, timing behavior, Windows behavior, and console behavior were not independently verified. ## To get this to a good state Replace the integrity `memcmp` with the existing constant-time comparison while preserving the source notice. I will rerun the precheck and AES tests on the updated head; the test run requires a build.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!14612
No description provided.