Repository navigation
feat(libSceLibreSsl3): implement X509V3_set_ctx - #15629
Conversation
XairRrR
left a comment
There was a problem hiding this comment.
Reviewed — approved
X509V3_set_ctx matches the LibreSSL 4.0.0 code the PR cites, and the new test passes on the merged tree. The test also fails when the export is reverted to main's throwing stub. I found no issues.
What I ran
Head 197ead80f3e9cfad89eec9a637c0d4267c4c7e3e, main 1c8c0efc8c41314402e6966da5bef6ea3d639d10, merged with --no-ff into tree a8c7d326a531b6deed1b20325d83a029bc47e166. Debian 13 VM, GCC 14.2.0, Release, Ninja.
git diff --check 1c8c0efc8c41314402e6966da5bef6ea3d639d10...197ead80f3e9cfad89eec9a637c0d4267c4c7e3e
python3 tools/check_conventions.py --base 1c8c0efc8c41314402e6966da5bef6ea3d639d10
# negative control: src/X509V3Context.cpp body replaced by NotImplemented_nid_no_patch(__func__)
ninja -C build -j32 -l32 guest_libressl3_x509v3_context_tests
ctest --test-dir build -R "^guest_libressl3_x509v3_context$" --output-on-failure
# merged file restored from a8c7d326a531b6deed1b20325d83a029bc47e166
ninja -C build -j32 -l32 guest_libressl3_x509v3_context_tests
ctest --test-dir build -R "^guest_libressl3_x509v3_context$" --output-on-failure
git status --porcelain
# cited reference, read from the libressl-openbsd submodule's object store
git show ce488b78e0bd994780569df718596b9776ff681a:src/lib/libcrypto/x509/x509_conf.c | sed -n 428,442p
git show ce488b78e0bd994780569df718596b9776ff681a:src/lib/libcrypto/x509/x509v3.h | sed -n 121,132p
Results
| Check | Result |
|---|---|
git diff --check |
clean |
check_conventions.py |
All conventions checks passed |
Configure / build / libs (script) |
ok |
| Selected tests (script) | 835 ran, 831 passed, 3 expected skips, 0 new failures, 0 timeouts |
| Known failure | unwrap_self_UnwrapTest_test_new_output_inherits_the_destination_directory_group: fails on main too, unrelated to this PR |
guest_libressl3_x509v3_context |
passed (about 0.01 s) |
public_headers |
passed: "406 libraries, 28302 exports: unique declarations and umbrella coverage verified" |
| Vulkan validation comparison | skipped by the script: the PR changes no AGC driver, shader recompiler or VideoOut files |
| Cited LibreSSL 4.0.0 source | x509_conf.c L430–L440 is X509V3_set_ctx and sets issuer, subject, CRL, request and flags. It does not touch db. x509v3.h L123–L131 is struct v3_ext_ctx { int flags; X509 *issuer_cert; X509 *subject_cert; X509_REQ *subject_req; X509_CRL *crl; void *db; }. This matches the new struct and its static_asserts. |
Negative control
I replaced the body of core/libs/prx/libSceLibreSsl3/src/X509V3Context.cpp with NotImplemented_nid_no_patch(__func__), which is what main does for this export. After a rebuild the test failed as expected:
Output
terminate called after throwing an instance of 'std::runtime_error'
what(): X509V3_set_ctx_nid_postfix not implemented
0% tests passed, 1 tests failed out of 1
2874 - guest_libressl3_x509v3_context (Subprocess aborted)
I then restored the merged file and rebuilt; the test passed again, and git status --porcelain was empty.
Findings
Blocking
None.
Non-blocking
None.
Notes from reading the code:
- The repository's pinned
libressl-openbsdsubmodule is an older LibreSSL whose context still hasdb_methbeforedb. This does not affect the implementation:- The fields it writes are at the same offsets (0–32) in both layouts.
- It never touches
dbordb_meth. - Only the 48-byte size assertion depends on the version, and the debt entry records that.
- The null-context
throw(core/libs/prx/libSceLibreSsl3/src/X509V3Context.cpp:7) follows the library's existing rule that inputs on which LibreSSL would fault throw instead. - The new debt entry and the updated inventory count (174 exports: 164 named, 10 known only by NID) match the export removed from
AdditionalExports.cpp.
Not verified
- Behaviour on a PS5 console, and which LibreSSL version Sony's libSceLibreSsl3 is built from. The debt entry already lists this as open.
- Windows/MinGW build and the
WIN32PATHsetting for the new test. - The full test suite: only the tests the script selected and the new test were run.
197ead8 to
edcec1c
Compare
|
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.
|
edcec1c to
41386cd
Compare
41386cd to
c2acc30
Compare
c2acc30 to
e3fde7d
Compare
e3fde7d to
5774baf
Compare
|
Rebased on current |
What
Implements
X509V3_set_ctxin libSceLibreSsl3. As in LibreSSL 4.0.0x509_conf.c, it stores the issuer, subject, request, CRL and flags in the caller's 48-byteX509V3_CTXfrom the public 4.0.0x509v3.hand leavesdbalone.Tested
Linux x86-64 (WSL2), Release: the full build passes and
ctest --test-dir build -j16passes 3829 of 3829 tests, including the newguest_libressl3_x509v3_context.python3 tools/check_conventions.py --base upstream/mainpasses. Not run on a console or in a title.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)