Repository navigation
fix(libkernel): filter host CA bundle to certificate blocks - #7007
Conversation
|
Independent Linux provider-level check of exact head I compiled the complete unchanged 10/10 fresh-process cases pass: mixed metadata/key/certificate blocks with LF and CRLF, LF-only, CRLF-only, an end marker without a final newline, empty input, key-only input, an unfinished certificate, an orphan end marker, a begin marker embedded in a larger line, and a new begin marker after an unfinished block. Expected certificate bytes and line endings match exactly. Empty extractions return no path and create no cache directory; nonempty outputs are mode 0444 and leave no temporary files. Every input stays unchanged. The same harness with the parent's complete provider fails the mixed-bundle, unfinished-block, embedded-marker and restarted-block cases, while passing the unchanged controls. A negative control deleting only the CR trimming line also fails the CRLF case. Two additional cache cases pass:
Remaining gap: the full libc/libkernel guest-path, stream, alias and stat integration test was not run; its separate runtime dependencies remain unavailable here. These synthetic marker tests do not validate X.509 contents, console ABI/format, Windows trusted roots or TLS handshakes. |
|
Thanks for the thorough independent check. The 10 fresh-process cases, cache-preservation/replacement cases, and negative controls add useful provider-level evidence for the extraction and cache behavior. I’ll keep the full guest-path integration test and Windows/TLS behavior marked as unverified; your report does not claim those were covered. |
|
Thanks for the provider-level check and the careful scope note. The 10 fresh-process cases and the two cache cases add useful Linux filesystem coverage; I have noted that the full guest-path/libc integration test and TLS handshake behavior remain untested. |
jotitadev
left a comment
There was a problem hiding this comment.
First CTest run of guest_sandbox_certificates on a CPU that passes the host guard (the description notes the focused test stopped at the guard on the author's Xeon, and the provider-level check above did not run it).
Machine: Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release, BUILD_TESTING=ON, full build.
Head 800f045a7 merged onto main 40315fcf8 (clean merge; the branch is based on 07e741481).
guest_sandbox_certificatespasses with the PR, together with the other sandbox, SSL and HTTP tests (ctest -R "sandbox|certificate|ssl|http", 7 tests).- Test file only, on
main: the test aborts withSandbox certificates check failed at line 93, so it catches the unfiltered bundle. - Non-GPU suite (
ctest -E "^agc|gpu|vulkan|video_out"): 682/682, same asmainon this machine.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
|
Checked the filter against the Linux/macOS bundle path and the Windows |
What
Follow up to merged PR #5280. On Linux and macOS, the sandbox certificate provider reads the selected host
SSL_CERT_FILEbundle and currently copies it wholesale to the guest-visibleCA_LIST.cer. Such files can contain PEM metadata and other PEM objects, including private-key blocks.Filter the host input to complete
BEGIN CERTIFICATE/END CERTIFICATEblocks before writing the guest bundle. Preserve each certificate block's bytes and line endings; omit text outside those blocks. The regression fixture includes two certificate blocks with mixed LF/CRLF endings, surrounding metadata, and private-key blocks, and checks that only the certificates are exposed.This does not change certificate selection or establish that the console's
CA_LIST.cerformat matches this host-derived PEM representation.Tested
guest_sandbox_certificates_testsbuilds successfully.check_test_registration.py /tmp/AnyPS5-CA-filter-build: passes (928 test executables, none unregistered).check_conventions.py --base upstream/mainandgit diff --check: pass.Checklist
main(07e741481); searched open and closed PRs for duplicate CA bundle filtering work.mdfiles or images added to the repository