feat(libSceNKWebKit): implement WebCore serialized crypto key wrap and unwrap (OpenSSL port) #19835

Merged
B-Howell merged 7 commits from upstream-pr/19835 into main 2026-11-17 06:42:07 +00:00
B-Howell commented 2026-11-14 01:32:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by B-Howell on 2026-11-14T01:32:59Z.


What

Implements WebCore::wrapSerializedCryptoKey and WebCore::unwrapSerializedCryptoKey as the PlayStation build of the pinned WebKit source does. Source/WebCore/PlatformPlayStation.cmake includes platform/OpenSSL.cmake, which builds crypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp. There, both functions ignore the master key, copy the input bytes into the output vector (result = Vector<uint8_t>(key)) and return true. The copy reuses the existing NKWebKit::WtfAbi::Vector (src/WtfVector.hpp), whose copy constructor allocates capacity equal to the size, as the pinned Vector.h copy constructor does. Its 16-byte layout is pinned with static_assert. The two inventory rows are removed and a debt entry is added.

tools/progress.py --compare: +2 implemented functions (libSceNKWebKit 3000 to 3002 of 11258; system libraries 40.13%, +0.01%).

Tested

Ubuntu (WSL2), GCC 11, Release. New tests/SerializedCryptoKeyWrap.cpp covers copy into an empty output, replacement of a non-empty output (new buffer, old one freed), an empty key and a capacity-16 empty key giving a null buffer, the master key being ignored, and an unwrap-after-wrap round trip, for both functions.

  • On main (only the test and header added): nkwebkit_serializedcryptokeywrap ...Subprocess aborted (wrapSerializedCryptoKey ... not implemented), 0% tests passed.
  • On this branch: nkwebkit_serializedcryptokeywrap ... Passed, 3 of 3 runs.
  • ctest -R '^public_headers': 65/65 passed.
  • @JJenkx, Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release, d309243c78 merged onto main 322f2ed19c (report): nkwebkit_serializedcryptokeywrap passed 3/3, none skipped.
  • Main merge 2e41c34f41a: Windows 11, WinLibs GCC 15.2, Release, all 18 of our main merges from this round built together on main 790e9a371cc: ctest -R nkwebkit 116/116 passed, patched_libraries passed once the #19822 fix was in. Re-merged onto b9fb5ab5a32 (no NKWebKit changes in between); check_conventions passed. Resolved a conflict in the libSceNKWebKit.hpp include list by keeping both sides.
  • Main merge ab04ea43e9: merged main c3d38470e0c. The debt entry stays in docs/dev/debt/libSceNKWebKit.md for now: with only a fragment, check_conventions.py stops exempting the // Derived from line the porting ruling requires. check_conventions.py --base origin/main passes. Documentation only, no build.

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:5305677780 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19835). Originally posted by [B-Howell](https://github.com/B-Howell) on 2026-11-14T01:32:59Z. --- ### What Implements `WebCore::wrapSerializedCryptoKey` and `WebCore::unwrapSerializedCryptoKey` as the PlayStation build of the pinned WebKit source does. `Source/WebCore/PlatformPlayStation.cmake` includes `platform/OpenSSL.cmake`, which builds [`crypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/crypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp#L48-L63). There, both functions ignore the master key, copy the input bytes into the output vector (`result = Vector<uint8_t>(key)`) and return `true`. The copy reuses the existing `NKWebKit::WtfAbi::Vector` (`src/WtfVector.hpp`), whose copy constructor allocates capacity equal to the size, as the pinned `Vector.h` copy constructor does. Its 16-byte layout is pinned with `static_assert`. The two inventory rows are removed and a debt entry is added. `tools/progress.py --compare`: +2 implemented functions (libSceNKWebKit 3000 to 3002 of 11258; system libraries 40.13%, +0.01%). ### Tested <!-- 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. --> Ubuntu (WSL2), GCC 11, Release. New `tests/SerializedCryptoKeyWrap.cpp` covers copy into an empty output, replacement of a non-empty output (new buffer, old one freed), an empty key and a capacity-16 empty key giving a null buffer, the master key being ignored, and an unwrap-after-wrap round trip, for both functions. - On `main` (only the test and header added): `nkwebkit_serializedcryptokeywrap ...Subprocess aborted` (`wrapSerializedCryptoKey ... not implemented`), 0% tests passed. - On this branch: `nkwebkit_serializedcryptokeywrap ... Passed`, 3 of 3 runs. - `ctest -R '^public_headers'`: 65/65 passed. - @JJenkx, Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release, d309243c78 merged onto main 322f2ed19c ([report](https://github.com/boykopovar/AnyPS5/pull/19835#issuecomment-6871118263)): `nkwebkit_serializedcryptokeywrap` passed 3/3, none skipped. - Main merge `2e41c34f41a`: Windows 11, WinLibs GCC 15.2, Release, all 18 of our main merges from this round built together on main `790e9a371cc`: `ctest -R nkwebkit` 116/116 passed, `patched_libraries` passed once the #19822 fix was in. Re-merged onto `b9fb5ab5a32` (no NKWebKit changes in between); `check_conventions` passed. Resolved a conflict in the `libSceNKWebKit.hpp` include list by keeping both sides. - Main merge `ab04ea43e9`: merged main `c3d38470e0c`. The debt entry stays in `docs/dev/debt/libSceNKWebKit.md` for now: with only a fragment, `check_conventions.py` stops exempting the `// Derived from` line the porting ruling requires. `check_conventions.py --base origin/main` passes. Documentation only, no build. ### 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
PrivacyOnion commented 2026-11-14 02:03:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T02:03:01Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against d309243c78:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: nkwebkit_serializedcryptokeywrap_tests built cleanly.
  • CTest (nkwebkit_serializedcryptokeywrap):
    1/1 Test #3923: nkwebkit_serializedcryptokeywrap ...   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified WebCore::wrapSerializedCryptoKey and WebCore::unwrapSerializedCryptoKey in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp match the upstream OpenSSL implementation returning true under APS5_VABI.
    • Verified NKWebKit::WtfAbi::Vector layout and field offsets via static_assert in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp (sizeof == 16, buffer == 0, capacity == 8, size == 12).
    • Verified vector copy construction semantics in result = ByteVector(key) and key = ByteVector(wrappedKey) to ensure memory safety on self-aliasing (&wrappedKey == &key) and replacement of existing buffers.
    • Verified empty key handling and null buffer behavior without null pointer dereferencing in SerializedCryptoKeyWrap.cpp and tests/SerializedCryptoKeyWrap.cpp.
    • Verified export synchronization across core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/include/SerializedCryptoKeyWrapExports.hpp, and removal of inventory entries wd4TA00miTA and m2S0+pUgP1s in docs/dev/debt/libSceNKWebKit.md.
    • Verified AGENTS.md compliance regarding in-code comments across all added and modified files in the pull request.
  • Concerns:
    • core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp:5: violates AGENTS.md rule ("No comments in code, except #endif and namespace ends") by including the comment // Derived from Source/WebCore/crypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp@80f77e94c63ee7202eec3d4b5b1a021dd89011ba. Notes, URLs, and derivation details must be placed in docs/dev/debt/.md or the pull request description, never in code.
  • Note: the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5900687625 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19835#pullrequestreview-5900687625). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-14T02:03:01Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `d309243c78`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `nkwebkit_serializedcryptokeywrap_tests` built cleanly. - **CTest** (`nkwebkit_serializedcryptokeywrap`): ``` 1/1 Test #3923: nkwebkit_serializedcryptokeywrap ... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified WebCore::wrapSerializedCryptoKey and WebCore::unwrapSerializedCryptoKey in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp match the upstream OpenSSL implementation returning true under APS5_VABI. - Verified NKWebKit::WtfAbi::Vector<unsigned char> layout and field offsets via static_assert in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp (sizeof == 16, buffer == 0, capacity == 8, size == 12). - Verified vector copy construction semantics in result = ByteVector(key) and key = ByteVector(wrappedKey) to ensure memory safety on self-aliasing (&wrappedKey == &key) and replacement of existing buffers. - Verified empty key handling and null buffer behavior without null pointer dereferencing in SerializedCryptoKeyWrap.cpp and tests/SerializedCryptoKeyWrap.cpp. - Verified export synchronization across core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/include/SerializedCryptoKeyWrapExports.hpp, and removal of inventory entries wd4TA00miTA and m2S0+pUgP1s in docs/dev/debt/libSceNKWebKit.md. - Verified AGENTS.md compliance regarding in-code comments across all added and modified files in the pull request. - **Concerns**: - core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp:5: violates AGENTS.md rule ("No comments in code, except #endif and namespace ends") by including the comment `// Derived from Source/WebCore/crypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp@80f77e94c63ee7202eec3d4b5b1a021dd89011ba`. Notes, URLs, and derivation details must be placed in docs/dev/debt/<library>.md or the pull request description, never in code. - Note: the AI-assisted checkbox can stay. Requesting changes for the points above.
PrivacyOnion commented 2026-11-15 19:17:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T19:17:10Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against d309243c78:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: nkwebkit_serializedcryptokeywrap_tests built cleanly.
  • CTest (nkwebkit_serializedcryptokeywrap):
    1/1 Test #3923: nkwebkit_serializedcryptokeywrap ...   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified WebCore::wrapSerializedCryptoKey and WebCore::unwrapSerializedCryptoKey in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp match the upstream OpenSSL implementation returning true under APS5_VABI.
    • Verified NKWebKit::WtfAbi::Vector layout and field offsets via static_assert in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp (sizeof == 16, buffer == 0, capacity == 8, size == 12).
    • Verified vector copy construction semantics in result = ByteVector(key) and key = ByteVector(wrappedKey) to ensure memory safety on self-aliasing (&wrappedKey == &key) and replacement of existing buffers.
    • Verified empty key handling and null buffer behavior without null pointer dereferencing in SerializedCryptoKeyWrap.cpp and tests/SerializedCryptoKeyWrap.cpp.
    • Verified export synchronization across core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/include/SerializedCryptoKeyWrapExports.hpp, and removal of inventory entries wd4TA00miTA and m2S0+pUgP1s in docs/dev/debt/libSceNKWebKit.md.
    • Verified AGENTS.md compliance regarding in-code comments across all added and modified files in the pull request.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5912392536 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19835#pullrequestreview-5912392536). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T19:17:10Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `d309243c78`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `nkwebkit_serializedcryptokeywrap_tests` built cleanly. - **CTest** (`nkwebkit_serializedcryptokeywrap`): ``` 1/1 Test #3923: nkwebkit_serializedcryptokeywrap ... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified WebCore::wrapSerializedCryptoKey and WebCore::unwrapSerializedCryptoKey in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp match the upstream OpenSSL implementation returning true under APS5_VABI. - Verified NKWebKit::WtfAbi::Vector<unsigned char> layout and field offsets via static_assert in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp (sizeof == 16, buffer == 0, capacity == 8, size == 12). - Verified vector copy construction semantics in result = ByteVector(key) and key = ByteVector(wrappedKey) to ensure memory safety on self-aliasing (&wrappedKey == &key) and replacement of existing buffers. - Verified empty key handling and null buffer behavior without null pointer dereferencing in SerializedCryptoKeyWrap.cpp and tests/SerializedCryptoKeyWrap.cpp. - Verified export synchronization across core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/include/SerializedCryptoKeyWrapExports.hpp, and removal of inventory entries wd4TA00miTA and m2S0+pUgP1s in docs/dev/debt/libSceNKWebKit.md. - Verified AGENTS.md compliance regarding in-code comments across all added and modified files in the pull request. Looks Good To Me
PrivacyOnion commented 2026-11-15 21:18:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T21:18:10Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 2e41c34f41:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: nkwebkit_serializedcryptokeywrap_tests built cleanly.
  • CTest (nkwebkit_serializedcryptokeywrap):
    1/1 Test #4249: nkwebkit_serializedcryptokeywrap ...   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified WebCore::wrapSerializedCryptoKey and WebCore::unwrapSerializedCryptoKey in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp match the pinned upstream SerializedCryptoKeyWrapOpenSSL.cpp implementation by copying the input vector to the output vector, ignoring masterKey, and returning true under APS5_VABI.
    • Verified NKWebKit::WtfAbi::Vector layout and field offsets via static_assert in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp (sizeof == 16, buffer == 0, capacity == 8, size == 12) for LP64/LLP64 portability.
    • Verified copy construction and move assignment semantics in result = ByteVector(key) and key = ByteVector(wrappedKey) to ensure memory safety on self-aliasing (&wrappedKey == &key), replacement of existing buffers, and empty vector handling.
    • Verified export declarations and stub removals across core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/include/SerializedCryptoKeyWrapExports.hpp, and core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp.
    • Verified technical debt documentation and removal of inventory entries wd4TA00miTA and m2S0+pUgP1s in docs/dev/debt/libSceNKWebKit.md, as well as AGENTS.md compliance.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5912977735 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19835#pullrequestreview-5912977735). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T21:18:10Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `2e41c34f41`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `nkwebkit_serializedcryptokeywrap_tests` built cleanly. - **CTest** (`nkwebkit_serializedcryptokeywrap`): ``` 1/1 Test #4249: nkwebkit_serializedcryptokeywrap ... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified WebCore::wrapSerializedCryptoKey and WebCore::unwrapSerializedCryptoKey in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp match the pinned upstream SerializedCryptoKeyWrapOpenSSL.cpp implementation by copying the input vector to the output vector, ignoring masterKey, and returning true under APS5_VABI. - Verified NKWebKit::WtfAbi::Vector<unsigned char> layout and field offsets via static_assert in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp (sizeof == 16, buffer == 0, capacity == 8, size == 12) for LP64/LLP64 portability. - Verified copy construction and move assignment semantics in result = ByteVector(key) and key = ByteVector(wrappedKey) to ensure memory safety on self-aliasing (&wrappedKey == &key), replacement of existing buffers, and empty vector handling. - Verified export declarations and stub removals across core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/include/SerializedCryptoKeyWrapExports.hpp, and core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp. - Verified technical debt documentation and removal of inventory entries wd4TA00miTA and m2S0+pUgP1s in docs/dev/debt/libSceNKWebKit.md, as well as AGENTS.md compliance. Looks Good To Me
PrivacyOnion commented 2026-11-17 06:17:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-17T06:17:58Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 18d756e927:

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_serializedcryptokeywrap_tests built cleanly.
  • CTest (nkwebkit_serializedcryptokeywrap):
    1/1 Test #4459: nkwebkit_serializedcryptokeywrap ...   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp, core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp reverted to main and the new tests kept, the suite fails:
    1/1 Test #4459: nkwebkit_serializedcryptokeywrap ...Subprocess aborted***Exception:   0.13 sec
    0% tests passed, 1 tests failed out of 1
    
    Restoring the change makes it pass again.
  • Code reading:
    • Verified that wrapSerializedCryptoKey and unwrapSerializedCryptoKey in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp accurately replicate the pinned PlayStation WebKit implementation from SerializedCryptoKeyWrapOpenSSL.cpp by copying key bytes to the destination vector and returning true.
    • Verified that Vector layout and ABI offsets (sizeof==16, buffer@0, capacity@8, size@12) match WtfVector.hpp and are guarded by static_assert checks for LP64/LLP64 portability.
    • Verified that copy-construction and assignment (result = ByteVector(key)) safely handle memory allocations, deallocations of previous buffers, empty vectors, and self-aliasing (&key == &result).
    • Verified that export declarations and symbols in core/libs/prx/libSceNKWebKit/Export.cpp, include/InventoryExports.hpp, include/SerializedCryptoKeyWrapExports.hpp, and libSceNKWebKit.hpp properly replace the old NotImplemented stubs and inventory rows.
    • Verified that technical debt updates in docs/dev/debt/libSceNKWebKit.md correctly document the implementation against the pinned upstream commit and remove the corresponding inventory entries (wd4TA00miTA and m2S0+pUgP1s).
    • Verified that comprehensive test coverage in core/libs/prx/libSceNKWebKit/tests/SerializedCryptoKeyWrap.cpp covers empty buffers, pre-allocated buffers, master key independence, and round-trip conversion without leaks.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5933894680 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19835#pullrequestreview-5933894680). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-17T06:17:58Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `18d756e927`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_serializedcryptokeywrap_tests` built cleanly. - **CTest** (`nkwebkit_serializedcryptokeywrap`): ``` 1/1 Test #4459: nkwebkit_serializedcryptokeywrap ... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp`, `core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp` reverted to `main` and the new tests kept, the suite fails: ``` 1/1 Test #4459: nkwebkit_serializedcryptokeywrap ...Subprocess aborted***Exception: 0.13 sec 0% tests passed, 1 tests failed out of 1 ``` Restoring the change makes it pass again. - **Code reading**: - Verified that wrapSerializedCryptoKey and unwrapSerializedCryptoKey in core/libs/prx/libSceNKWebKit/src/SerializedCryptoKeyWrap.cpp accurately replicate the pinned PlayStation WebKit implementation from SerializedCryptoKeyWrapOpenSSL.cpp by copying key bytes to the destination vector and returning true. - Verified that Vector layout and ABI offsets (sizeof==16, buffer@0, capacity@8, size@12) match WtfVector.hpp and are guarded by static_assert checks for LP64/LLP64 portability. - Verified that copy-construction and assignment (result = ByteVector(key)) safely handle memory allocations, deallocations of previous buffers, empty vectors, and self-aliasing (&key == &result). - Verified that export declarations and symbols in core/libs/prx/libSceNKWebKit/Export.cpp, include/InventoryExports.hpp, include/SerializedCryptoKeyWrapExports.hpp, and libSceNKWebKit.hpp properly replace the old NotImplemented stubs and inventory rows. - Verified that technical debt updates in docs/dev/debt/libSceNKWebKit.md correctly document the implementation against the pinned upstream commit and remove the corresponding inventory entries (wd4TA00miTA and m2S0+pUgP1s). - Verified that comprehensive test coverage in core/libs/prx/libSceNKWebKit/tests/SerializedCryptoKeyWrap.cpp covers empty buffers, pre-allocated buffers, master key independence, and round-trip conversion without leaks. Looks Good To Me
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!19835
No description provided.