Repository navigation
feat(libkernel): serve the sandbox CA bundle from host TLS roots - #5280
Conversation
|
Two more titles on Windows 11 (RTX 3080, WinLibs GCC 15.2, Release), with this PR (8fd97c2) merged onto
The bundle written to |
|
Please rebase on current |
8fd97c2 to
5f1b1fe
Compare
|
Rebased onto Fresh-checkout validation passes: four Windows sandbox/path tests, the three applicable Ubuntu/WSL2 tests, conventions and the whitespace check. The description now distinguishes these checks from the earlier full build/title runs and credits @babyhuey's additional ProsperoLichess and ProsperoRadio results. Agreed that serving host trust as The overlap with #4994 is adjacent to AI-assisted: yes. |
5f1b1fe to
36057ae
Compare
|
@oneandonlydean, rebased this PR onto current Validation on this head passes: five Windows tests and six Ubuntu/WSL2 tests, including the Linux The new head's conventions check passes; its automatic build checks are running. Full Windows/Linux CI is skipped under the maintainer-dispatch policy and requires a maintainer dispatch. The overlap scan finds no conflicting lines with other open PRs. #6061 is separate drive-letter path hardening, but it also changes resolver helpers this provider uses. If that refactor lands first, please retain this exact-path provider lookup when combining the changes; it is not listed as a functional dependency. The design question in #5001 is also still open: host-derived trust at this exact guest path, or a shipped bundle? The title reports show that PEM works with bundled OpenSSL, while the console format and full Windows chain policy remain unverified in technical debt. If you approve the host-derived approach, please dispatch full Windows/Linux CI for PR 5280. AI-assisted: yes. |
36057ae to
f2ceed0
Compare
|
@oneandonlydean, quick ping on the #5001 design decision: should AnyPS5 expose host-derived trust at #5280 is rebased onto |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
jotitadev
left a comment
There was a problem hiding this comment.
Static review on macOS, head f2ceed091, of the non-Windows branch of TrustedRoots.cpp / SandboxCertificates.cpp. Checked on the host, not with this PR's binary.
On macOS the provider finds no bundle, so CA_LIST.cer stays missing. None of the three fixed candidates exists on macOS 27.2:
$ ls /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt /etc/ssl/ca-bundle.pem
ls: ...: No such file or directory (all three)
$ grep -c 'BEGIN CERT' /etc/ssl/cert.pem
128
macOS ships its PEM bundle at /etc/ssl/cert.pem. That is also the path FreeBSD, OpenBSD/LibreSSL and Alpine use. Without SSL_CERT_FILE set, a macOS run behaves like main (CA_LIST.cer (MISSING)). The tests still pass because they set SSL_CERT_FILE, so they don't catch this.
Adding "/etc/ssl/cert.pem" to candidates would cover macOS. One caveat for the debt note: on macOS that file is a static snapshot. It does not reflect roots added to or distrusted in the Keychain, which is the same kind of gap the Windows section already notes for CTL restrictions.
This depends on the #5001 design decision, so treat it as input for whichever option is chosen.
Written with AI assistance (Claude Code). I ran the check above on my machine.
|
Linux title runs (CachyOS, RTX 2070, NVIDIA driver), with f2ceed0 merged into main 5d9dcc4. Host bundle: ProsperoTV (PPSA99003):
PSXS5 (PPSA97510):
Both titles are the ones #5001 listed as expected to follow but not verified. AI-assisted: yes (Claude Code) |
|
Windows title run for this PR: SwanStationPS5 (PPSA98510) 1.3.7 from the homebrew catalog, RTX 4070 Laptop, Windows 11 26300, WinLibs GCC 15.2.0 r7.
With the PR the run directory gets One thing to be aware of for the #5001 decision: during the passing run, Avast's HTTPS scanning was on, so both hosts were served a chain issued by "Avast Web/Mail Shield Root". It still verified, because that root is in the current user's ROOT store and this PR exports that store. So with host-derived trust, a title trusts whatever the PC trusts, including local TLS-inspection roots. A title that ships its own CA bundle instead (PSBox Cloud Gaming PPSA99810, The AI-assisted: yes, Claude Code ran the builds and tests; I reviewed the results. |
|
Host-derived trust is fine: serving the host's trust store as |
Titles that bundle OpenSSL load the console's CA file from the sandbox directory and fail every HTTPS request without it. ProsperoRadio (PPSA99001, libcurl 8.18.0 + OpenSSL 3.5.2) on main + boykopovar#4796 + boykopovar#4525: [ProsperoRadio][http] https://all.api.radio-browser.info/json/servers: Problem with the SSL CA cert (path? access rights?) (error adding trust anchors from file: /gkbHtXc3Wq/common/cert/CA_LIST.cer) SwanStation (PPSA98510) stops on the same file (boykopovar#5001). The guest path resolver now accepts exact-path providers, and libkernel registers one for /<sceKernelGetFsSandboxRandomWord()>/common/cert/CA_LIST.cer. On first use it writes a PEM bundle once per process to cert_cache/CA_LIST.cer in the run directory, read-only: on Windows the current user's ROOT and CA system stores, elsewhere SSL_CERT_FILE or the first distro bundle that exists. Without a certificate the path keeps resolving under the guest root and does not exist, as before. Every other path under the sandbox word is unchanged. The console file's format and the rest of its common/cert directory are unverified and recorded in docs/dev/debt/libkernel.md. With this change, boykopovar#4796, boykopovar#4525 and boykopovar#5025 on Windows 11, 60 s each: [ProsperoRadio][http] 11846160 bytes in 1458 ms: 1161 passes, 803 waits (679 woken) for 1428 ms [ProsperoRadio][catalog] page offset=0 bytes=11846160 objects=10000 accepted=9549 total=9549 ... [ProsperoRadio][catalog] page offset=60000 bytes=1712035 objects=1494 accepted=1436 total=59371 [SwanStationPS5] update: latest 1.2.5, this 1.1.3, available [SwanStationPS5] gamedb: index written Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
f2ceed0 to
eb26fb9
Compare
|
@oneandonlydean, thanks for approving the host-derived approach. Rebased onto The Windows link conflict is resolved by retaining both main's Fresh validation on Debian 13, GCC 14.2.0, Release: the affected Automatic build checks are still running. Full Linux/Windows jobs were skipped under the maintainer-dispatch policy; please dispatch full CI for this head. AI-assisted: yes. |
|
Merged, thanks @santhoshkumar-dev. One non-blocking follow-up if you have time: on Linux and macOS the bundle is served as the first file found ( |
|
I opened PR #7007 for this follow-up. It filters the host bundle to complete certificate blocks and adds a regression with surrounding metadata and private-key blocks. The target builds and conventions/registration checks pass; focused CTest is blocked before assertions by this Linux runner's CPU feature guard, so I recorded that limitation and a passing standalone extraction harness in the PR. |
What
ProsperoRadio (PPSA99001) and SwanStation (PPSA98510) load
/<sandbox word>/common/cert/CA_LIST.certhrough bundled OpenSSL and cannot complete HTTPS requests when it is absent (#5001). This proposes serving a host-derived PEM bundle at that exact path. The host-trust design still awaits the maintainer decision in #5001.The branch has two feature commits rebased onto
main8856f180c, with no merge commits. The first carries @screamm's implementation, as offered in #5001, retaining its author and coauthor attribution. The second adds:Linux retains the original implementation's
SSL_CERT_FILE/distribution-bundle selection. The bundle is created lazily as a read-only cache in the run directory; Windows certificate stores are opened read-only. Console CA contents/file format and complete Windows chain policy remain unverified and recorded in technical debt. Windows usage semantics follow CertGetEnhancedKeyUsage.Tested
Rebased head
f2ceed091, validated in the isolated PR checkout:BUILD_TESTING=ON: five tests pass (guest_sandbox_certificates,guest_sandbox_certificate_trust,guest_sandbox_random_word,guest_path_case,guest_working_directory).guest_working_directory,guest_exit_orderandguest_path_lifetime.git diff --checkpass. The certificate implementation and both certificate test files are byte-identical to the previous PR head5f1b1fe01. The rebase preserves current-main path resolution, fix(libc): list the directory once for a missing path that may be a relinked module #6230, the merged fix(libc): preserve path services through process exit #4994 path-service lifetime fix and the host-stream source registration.Earlier validation on
e8f179733:8fd97c296, the Windows/Linux sandbox/path tests passed again.e6740bc6) and fix(libkernel): support POLLPRI on Windows sockets #4525 (5db1d8d5), excluded from this PR; fix(libkernel_sys): reach rename through a _nid_no_patch export #5025 was already on the base. With no manually supplied CA file and a 60-second limit, ProsperoRadio 01.000.010 downloaded three catalog pages and accepted 28,865 stations. SwanStation 1.2.4 wrote its game database and installed 1.2.5 (249 files), then reported Vulkan device loss; no rendering/gameplay stability claim. Both used an automatically generated 66-certificate bundle.Independent contributor validation, attributed to @babyhuey's report on
8fd97c29merged ontomainf40b6930, Windows 11 / RTX 3080 / WinLibs GCC 15.2:No PS5 hardware or Linux title run was performed locally. Full Windows/Linux CI requires maintainer dispatch under the repository's workflow policy.
Checklist
main; no other open PR implements the same functions