Repository navigation
feat(libSceLibreSsl3): implement BIO_up_ref - #12945
oneandonlydean merged 10 commits into
Conversation
Progress report (e8d3579 → a014955)📈 System libraries: 28.95% (+0.01%, +1 implemented functions) ✅ 1 implemented
Changed libraries (implemented exports)
|
|
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.
|
|
Windows run of this head (
AI-assisted: yes (Claude Code). |
|
@EagleBearerYS a heads-up, since this branch carries #12754's commits. #12754 conflicted with To restack: AI-assisted: yes (Claude Code). |
BIO_up_ref adds one to the reference count of a caller-owned BIO through the shared retain in Reference.hpp and returns 1 when the new count is above 1, as CRYPTO_add(...) > 1 does. LibreSsl3Bio in Key.hpp is the 112-byte BIO with its counter at offset 80. Behaviour and layout follow LibreSSL 4.0.0 (ce488b78e0bd): bio_lib.c L198-L202 and bio_local.h. No upstream source is copied.
219770a to
82c0aa6
Compare
The conflicts in docs/dev/debt/libSceLibreSsl3.md keep both sides: main's EVP_PKEY_get0 entry, then this branch's entries. The pending-exports count is recounted on the merged tree as 68, the NotImplemented_nid_no_patch exports left in Export.cpp, and its list names both sides' implemented exports.
|
@CnRJay, it's stacked on #12754 (Lindamea1), as the description says, so the diff against
Once #12754 merges, the diff is down to this PR's commit. |
boykopovar#10557 implements X509_PUBKEY_get0_param where this branch, through boykopovar#12754, implements the SSL_CTX, SSL and SSL_SESSION retains, the SSL_CTX version bounds and SSL_get_client_random. In Export.cpp the merge drops both sides' stubs, and Api.hpp keeps this branch's six declarations and boykopovar#10557's X509_PUBKEY_get0_param one. The Windows ENVIRONMENT_MODIFICATION list in CMakeLists.txt takes both guest_libressl3_ssl and guest_libressl3_x509_pubkey_param. The pending exports entry counts 64 and adds X509_PUBKEY_get0_param to the implemented ones.
✅ AMD GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (7, not counted against this PR)Validation IDs already present on main (8 IDs in 675 tests)Skipped (10)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
✅ AMD GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (8, not counted against this PR)Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validation IDs already present on main (4 IDs in 765 tests)Skipped (17)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
What
BIO_up_refinlibSceLibreSsl3was a bare stub. It now does what LibreSSL 4.0.0 does (bio_lib.cL198-L202): it raises the BIO'sreferencesby one and returns 1 when the new count is above 1, asCRYPTO_add(&bio->references, 1, CRYPTO_LOCK_BIO) > 1does.Retain_nid_no_patchininclude/Reference.hppas it is.LibreSsl3Bio, withreferencesat offset 80, from LibreSSL 4.0.0'sbio_local.h(struct bio_st, LP64).static_asserts hold the size and the offset.INT32_MAX, throw without changing memory, where LibreSSL dereferences or overflows.BIO_up_refdoesn't appear in an issue or discussion.Overlap: #12580 and #12582 (PrivacyOnion), which also appended their retains and test cases after
SSL_CTX_up_ref, were closed unmerged on 2026-10-31.ASN1_STRING_get0_dataits signature inExport.cppandApi.hpp, on the line next to this PR'sBIO_up_ref. The clash was textual only, and the merge ofmain1ee57e1 keeps both.main. feat(libSceLibreSsl3): implement numeric object identifier text parsing #12315 is still open.Tested
guest_libressl3_key_referencegains abiocase. It sits with theCheckKeycases (EVP_PKEY,EC_KEY,SSL_CTX) inGuestLibreSsl3KeyReference.cpp, sinceBIO_up_refsits with their retains insrc/Key.cpp; feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754'sCheckRetaincases are inGuestLibreSsl3Ssl.cpp. It covers:INT32_MAX - 1, with the result;No case asserts a throw.
Red: with the body put back to
main'sNotImplemented_nid_no_patch(the signature kept), thebiocase aborts withBIO_up_ref_nid_postfix not implemented. The other cases still pass.Green, Linux (Ubuntu 24.04, GCC 13.3, Release, CI's flags):
ctest -R "libressl3|crypto_memcmp" --repeat until-fail:10: 5 tests, 10 of 10 each, 0 skipped;ctest -R "libressl|crypto_memcmp"once: 34 tests, 34 passed, 0 skipped.Checks:
check_conventions.pyandcheck_test_registration.pypass. MinGW-w64-fsyntax-only -Wall -Wextra: no errors or warnings.GitHub, ×10 on both runners (run 40895956237), compared against feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754's head:
guest_libressl3_key_referencepassed 10 of 10 on Linux and on Windows, 0 skipped.APS5_SKIP_TIMING_TESTS=1, pass: 171 and 291 tests on Linux, 199 and 314 on Windows.82c0aa6: this PR's one commit on feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754's 34728c5, because feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754 was rewritten onto
main474030e. The commit is 219770a cherry-picked, with the same message and author.docs/dev/debt/libSceLibreSsl3.mdnow says 71, against feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754's 72. That's feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754's new line withBIO_up_refadded to the list, and it already names main'sRSA_up_ref.APS5_VABIdefinitions inExport.cppwhose body still callsNotImplemented_nid_no_patch.BIO_up_refbullet is unchanged.BIO_up_refput back as a pending stub, only thebiocase ofguest_libressl3_key_referencefails, withBIO_up_ref_nid_postfix not implemented.^guest_libressl3test:APS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.272efa5, a merge of
maina043b04, which brings gazaret's feat(libSceLibreSsl3): implement EVP_PKEY_get0_RSA, EVP_PKEY_get0_DSA and EVP_PKEY_get0_DH #13897 (EVP_PKEY_get0_RSA,_DSAand_DH) (run).docs/dev/debt/libSceLibreSsl3.md, and both keep both sides: feat(libSceLibreSsl3): implement EVP_PKEY_get0_RSA, EVP_PKEY_get0_DSA and EVP_PKEY_get0_DH #13897'sEVP_PKEY_get0entry, then this branch's entries, feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754's and this PR's.NotImplemented_nid_no_patchcalls left in the mergedExport.cpp: 80 at the base, lessmain's 3 and the stack's 9. Its list names both sides' implemented exports,main's first.main, which is in the same file, on this branch. feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754 itself is unchanged.^guest_libressl3test. Linux: 9 run, 9 pass, 0 skip, 0 fail. Windows: 9 run, 9 pass, 0 skip, 0 fail. The libc and libkernel suites run 206 and 308 tests on Linux and 233 and 330 on Windows, with 0 failed. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.main5c9837b, where the count is still 68.e44bf06, a merge of
mainb28bb77 (run), which brings Froraut's feat(libressl3): report OpenSSL version strings #9970 (OpenSSL_version) and Felipebmaitan's feat(libSceLibreSsl): implement numeric ERR formatting and newest peeking #9535 (numericERRformatting, withERR_load_crypto_stringsandERR_peek_last_errorin this module).CMakeLists.txt: feat(libressl3): report OpenSSL version strings #9970'sguest_libressl3_versionjoins this PR'sguest_libressl3_sslon theset_tests_propertiesline;docs/dev/debt/libSceLibreSsl3.md: the pending-exports line lists feat(libressl3): report OpenSSL version strings #9970'sOpenSSL_versionamong the exclusions, with this PR's.NotImplemented_nid_no_patchcalls left in the mergedExport.cpp.main's line reads 76, 2 more than the 74 calls left in its ownExport.cpp, since feat(libSceLibreSsl): implement numeric ERR formatting and newest peeking #9535'sERR_load_crypto_stringsandERR_peek_last_errorare no longer stubs.mainare the same, and it merges cleanly withmaina4eca2a.^guest_libressltests, feat(libressl3): report OpenSSL version strings #9970'sguest_libressl3_versionamong them, withguest_crypto_memcmp,guest_libressl3_key_reference,guest_libressl3_sslandpublic_headers. Linux: 48 run, 48 pass, 0 skip, 0 fail. Windows: 48 run, 48 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (217 and 319) and on Windows (244 and 340). The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.1a23809, a merge of
mainacf7ac2, which brings MarcZX10's feat(libSceLibreSsl3): implement X509 public key parameters #10557 (X509_PUBKEY_get0_param) (×10).X509_PUBKEY_get0_paramand this PR, through feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754, implements theSSL_CTX,SSLandSSL_SESSIONretains, theSSL_CTXversion bounds andSSL_get_client_random. Both sides stay:Export.cpp: both sides' stubs go;include/Api.hpp: this PR's six declarations and feat(libSceLibreSsl3): implement X509 public key parameters #10557'sX509_PUBKEY_get0_paramone;CMakeLists.txt: feat(libSceLibreSsl3): implement X509 public key parameters #10557'sguest_libressl3_x509_pubkey_paramjoins this PR'sguest_libressl3_sslon the Windowsset_tests_propertiesline;docs/dev/debt/libSceLibreSsl3.md: the pending-exports line adds feat(libSceLibreSsl3): implement X509 public key parameters #10557'sX509_PUBKEY_get0_paramto its exclusions.NotImplemented_nid_no_patchcalls left in the mergedExport.cpp: this PR's 65, less feat(libSceLibreSsl3): implement X509 public key parameters #10557'sX509_PUBKEY_get0_param.mainare the same.guest_crypto_memcmpand every test matching^guest_libressl3, feat(libSceLibreSsl3): implement X509 public key parameters #10557'sguest_libressl3_x509_pubkey_paramamong them. Linux: 13 run, 13 pass, 0 skip, 0 fail. Windows: 13 run, 13 pass, 0 skip, 0 fail. The libc and libkernel suites run 301 and 325 tests on Linux and 331 and 343 on Windows, with 0 failed. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.80bce94, oneandonlydean's merge of
maince676cb, which brings AZLisme's feat(libSceLibreSsl3): implement EVP digest contexts and SHA methods #10960 (EVP digest contexts and SHA methods) and MatteoSid's feat(libSceLibreSsl): implement EC groups and keys for named curves #10395 (EC groups and keys for named curves) (×10).core/libs/prx/libSceLibreSsl3/CMakeLists.txt: feat(libSceLibreSsl3): implement EVP digest contexts and SHA methods #10960'sguest_libressl3_evpjoins this PR'sguest_libressl3_sslon the Windowsset_tests_propertiesline;docs/dev/debt/libSceLibreSsl3.md: the pending-exports line adds feat(libSceLibreSsl3): implement EVP digest contexts and SHA methods #10960'sEVP_MD_CTX_new,EVP_MD_CTX_free,EVP_DigestInit,EVP_sha1andEVP_sha224to its exclusions, and the Functional entries keep this PR's, then feat(libSceLibreSsl3): implement EVP digest contexts and SHA methods #10960's.NotImplemented_nid_no_patchcalls left in the mergedExport.cpp:main's 68, less this stack's 9.GuestLibreSsl3KeyReference.cpp, next to this PR'sbiocase, merge without a conflict. This PR's other changed lines overmainare the same, and it merges cleanly withmain7ad9749.main, in four files, are resolved on this branch.check_conventions.py: 0 errors. Its one warning is the pending-exports line's length, 1,046 characters against the 1,000 guide, since the line names each implemented export.guest_crypto_memcmpand every test matching^guest_libressl3, feat(libSceLibreSsl3): implement EVP digest contexts and SHA methods #10960'sguest_libressl3_evpandguest_libressl3_mixed_evp(Linux only) among them. Linux: 15 run, 15 pass, 0 skip, 0 fail. Windows: 14 run, 14 pass, 0 skip, 0 fail. The libc and libkernel suites run 310 and 329 tests on Linux and 341 and 360 on Windows, with 0 failed. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.maine772fb2, Mesa 25.2.8. 2,482 passed, 11 failed (none new: 8 also fail onmain, 3 unstable onmain), 17 skipped, with no new validation IDs (1,076 tests on the GPU).agc_graphics_profile_drawtimed out in the parallel run and passed on its retry.ded4b34, a merge of
main04cdd52, which brings MarcZX10's feat(libSceLibreSsl3): implement OBJ_cmp #10631 (OBJ_cmp) and AlexWhitehouse's feat(libSceLibreSsl3): implement RSA_get0_factors and RSA_get0_crt_params #14366 (RSA_get0_factorsandRSA_get0_crt_params) (×10).core/libs/prx/libSceLibreSsl3/include/Key.hpp: feat(libSceLibreSsl3): implement RSA_get0_factors and RSA_get0_crt_params #14366'sLibreSsl3Rsafieldstatic_asserts, then this branch'sLibreSsl3SslCtx(feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754) andLibreSsl3Bioones;core/libs/prx/libSceLibreSsl3/src/Key.cpp: feat(libSceLibreSsl3): implement RSA_get0_factors and RSA_get0_crt_params #14366's two RSA getters, then this branch'sSSL_CTX_up_ref(feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754) andBIO_up_ref;docs/dev/debt/libSceLibreSsl3.md: the pending-exports line adds feat(libSceLibreSsl3): implement OBJ_cmp #10631'sOBJ_cmpto its exclusions.NotImplemented_nid_no_patchcalls left in the mergedExport.cpp:main's 67, less this stack's 9.mainare the same, and it merges cleanly withmain151a2cb.check_conventions.py: 0 errors. Its one warning is still the pending-exports line's length, now 1,057 characters against the 1,000 guide.guest_crypto_memcmpand every test matching^guest_libressl3, feat(libSceLibreSsl3): implement OBJ_cmp #10631'sguest_libressl3_obj_cmpand feat(libSceLibreSsl3): implement RSA_get0_factors and RSA_get0_crt_params #14366'sguest_libressl3_rsa_gettersamong them. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 16 run, 16 pass, 0 skip, 0 fail. The libc and libkernel suites run 322 and 334 tests on Linux and 353 and 365 on Windows, with 0 failed. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.1ee57e1, a merge of
maine647fe1, which brings alvaroelpob's feat(libSceLibreSsl3): implement X509_get0_extensions, X509_get_ext_count and X509_get_ext #10493 (X509_get0_extensions,X509_get_ext_countandX509_get_ext) and feat(libSceLibreSsl3): implement ASN1_STRING_get0_data and ASN1_INTEGER_free #10452 (ASN1_STRING_get0_dataandASN1_INTEGER_free) (×10).core/libs/prx/libSceLibreSsl3/Export.cpp: the stubs go forASN1_STRING_get0_data,X509_get_extandX509_get_ext_count, whichmainimplements, and forBIO_up_refandX509_get_version, which this branch implements;core/libs/prx/libSceLibreSsl3/include/Api.hpp:main's signatures forASN1_STRING_get0_data,X509_get_extandX509_get_ext_count, and this branch's forBIO_up_refandX509_get_version(feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754);docs/dev/debt/libSceLibreSsl3.md: the pending-exports line adds feat(libSceLibreSsl3): implement ASN1_STRING_get0_data and ASN1_INTEGER_free #10452's and feat(libSceLibreSsl3): implement X509_get0_extensions, X509_get_ext_count and X509_get_ext #10493's five exports to its exclusions.NotImplemented_nid_no_patchcalls left in the mergedExport.cpp:main's 62, less this stack's 9.mainare the same.check_conventions.py: 0 errors. Its one warning is still the pending-exports line's length, now 1,165 characters against the 1,000 guide.guest_crypto_memcmpand every test matching^guest_libressl3, feat(libSceLibreSsl3): implement X509_get0_extensions, X509_get_ext_count and X509_get_ext #10493'sguest_libressl3_x509_extensionsand feat(libSceLibreSsl3): implement ASN1_STRING_get0_data and ASN1_INTEGER_free #10452'sguest_libressl3_asn1_stringamong them. Linux: 19 run, 19 pass, 0 skip, 0 fail. Windows: 18 run, 18 pass, 0 skip, 0 fail. The libc and libkernel suites run 322 and 334 tests on Linux and 353 and 365 on Windows, with 0 failed. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.273540e, a merge of
main3a2cd3d, which brings atharvjairath's feat(libSceLibreSsl3): implement key size, security and comparison queries #15031 (the key size, security and comparison queries,EVP_PKEY_sizeamong them) (×10).docs/dev/debt/libSceLibreSsl3.md. The merge keeps both sides: the exclusions add feat(libSceLibreSsl3): implement key size, security and comparison queries #15031'sEVP_PKEY_size, and the count is 52, theNotImplemented_nid_no_patchcalls left in the mergedExport.cpp:main's 61, less this stack's 9.mainare the same.check_conventions.py: 0 errors. Its one warning is still the pending-exports line's length, now 1,182 characters against the 1,000 guide.guest_crypto_memcmpand every test matching^guest_libressl3, feat(libSceLibreSsl3): implement key size, security and comparison queries #15031'sguest_libressl3_pkey_queriesamong them. Linux: 20 run, 20 pass, 0 skip, 0 fail. Windows: 19 run, 19 pass, 0 skip, 0 fail. The libc and libkernel suites run 323 and 338 tests on Linux and 354 and 365 on Windows, with 0 failed. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.a427257, a merge of
main018cfcb, after feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754 merged on 11-06 at 07:12Z (×10).main's version, the one feat(libSceLibreSsl3): implement the SSL_CTX, SSL, SSL_SESSION and X509 retains, the SSL_CTX version bounds, SSL_get_client_random and X509_get_version #12754 merged with, in place of this branch's copy of them. Of this PR, only 82c0aa6's change stays:BIO_up_refinExport.cpp,include/Api.hpp,include/Key.hppandsrc/Key.cpp;biotest case;git diff 018cfcbbc4 a427257694gives those 6 files, +32/-7, the same as 82c0aa6's own diff. The one difference is the pending-exports line: it reads 45,main's 46 lessBIO_up_ref, withBIO_up_refadded to the exclusions.check_conventions.py: 0 errors. Its one warning is still the pending-exports line's length, now 1,393 characters against the 1,000 guide.guest_crypto_memcmpand every test matching^guest_libressl3, with this PR'sbiocase inguest_libressl3_key_reference.APS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.main: one hunk indocs/dev/debt/libSceLibreSsl3.md. ahmadmuj's feat(libSceLibreSsl): implement EVP_PKEY_set1_RSA, EVP_PKEY_get1_RSA and EVP_PKEY_copy_parameters #11128 adds two entries directly above the pending-exports line this PR changes. Keeping both sides resolves it: feat(libSceLibreSsl): implement EVP_PKEY_set1_RSA, EVP_PKEY_get1_RSA and EVP_PKEY_copy_parameters #11128's two entries, then this PR's line. Its count stays 45, theNotImplemented_nid_no_patchcalls in theExport.cppof a merge withmaine509b29.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)LibreSsl3Biofrominclude/Key.hpp)