feat(libSceNKWebKit): implement WebCore serialized crypto key wrap and unwrap (OpenSSL port) #19835
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19835"
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 B-Howell on 2026-11-14T01:32:59Z.
What
Implements
WebCore::wrapSerializedCryptoKeyandWebCore::unwrapSerializedCryptoKeyas the PlayStation build of the pinned WebKit source does.Source/WebCore/PlatformPlayStation.cmakeincludesplatform/OpenSSL.cmake, which buildscrypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp. There, both functions ignore the master key, copy the input bytes into the output vector (result = Vector<uint8_t>(key)) and returntrue. The copy reuses the existingNKWebKit::WtfAbi::Vector(src/WtfVector.hpp), whose copy constructor allocates capacity equal to the size, as the pinnedVector.hcopy constructor does. Its 16-byte layout is pinned withstatic_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.cppcovers 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.main(only the test and header added):nkwebkit_serializedcryptokeywrap ...Subprocess aborted(wrapSerializedCryptoKey ... not implemented), 0% tests passed.nkwebkit_serializedcryptokeywrap ... Passed, 3 of 3 runs.ctest -R '^public_headers': 65/65 passed.d309243c78merged onto main322f2ed19c(report):nkwebkit_serializedcryptokeywrappassed 3/3, none skipped.2e41c34f41a: Windows 11, WinLibs GCC 15.2, Release, all 18 of our main merges from this round built together on main790e9a371cc:ctest -R nkwebkit116/116 passed,patched_librariespassed once the #19822 fix was in. Re-merged ontob9fb5ab5a32(no NKWebKit changes in between);check_conventionspassed. Resolved a conflict in thelibSceNKWebKit.hppinclude list by keeping both sides.ab04ea43e9: merged mainc3d38470e0c. The debt entry stays indocs/dev/debt/libSceNKWebKit.mdfor now: with only a fragment,check_conventions.pystops exempting the// Derived fromline the porting ruling requires.check_conventions.py --base origin/mainpasses. Documentation only, no build.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 PrivacyOnion on 2026-11-14T02:03:01Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
d309243c78:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_serializedcryptokeywrap_testsbuilt cleanly.nkwebkit_serializedcryptokeywrap):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.// 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.Requesting changes for the points above.
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:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_serializedcryptokeywrap_testsbuilt cleanly.nkwebkit_serializedcryptokeywrap):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
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:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_serializedcryptokeywrap_testsbuilt cleanly.nkwebkit_serializedcryptokeywrap):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
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:tools/check_conventions.pypassed.nkwebkit_serializedcryptokeywrap_testsbuilt cleanly.nkwebkit_serializedcryptokeywrap):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.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me