Repository navigation
feat(libSceSsl): record verify options, minimum version and ALPN on connections - #11
Closed
KernelPanicNT wants to merge 1 commit into
Closed
KernelPanicNT wants to merge 1 commit into
KernelPanicNT wants to merge 1 commit into
Conversation
…onnections sceSslEnableVerifyOption, sceSslDisableVerifyOption, sceSslSetMinSslVersion and sceSslSetAlpn take the signatures SharpProspero gives and record their value on the connection, as sceSslSetVerifyCallback records its callback. The verify option bits (0x1, 0x4, 0x8, 0x10, 0x20, 0x2000) and the versions 0 to 5 follow SharpProspero. sceSslGetAlpnSelected returns null, since sceSslConnect never completes a handshake and no protocol is negotiated. An unknown or terminated connection, unknown option bits, a version outside 0 to 5 and a null protocol list throw, as their error codes are unknown. The PPSA07411 debt entry moves to libSceJson2, its first remaining library. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Withdrawn: open upstream PR boykopovar#5911 already implements the same functions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements
sceSslEnableVerifyOption,sceSslDisableVerifyOption,sceSslSetMinSslVersion,sceSslSetAlpnandsceSslGetAlpnSelectedon the connection records thatsceSslCreateConnectionalready keeps.Source of the behaviour. No console measurement is involved.
Http.csL228-L258:(int sslConnectionId, uint option)for both verify-option calls,(int, SceSslVersion)for the minimum version,(int, const char* proto)for ALPN, andconst char* sceSslGetAlpnSelected(int), which returns "which protocol the peer chose, or null if none was negotiated".None) to 5 (Tls12): L41-L61.sceSslSetVerifyCallbackrecords its callback on the connection and returns 0. These calls record their values the same way. Unknown and terminated connections are rejected by the sameRequireConnectioncheck the other connection calls use.Changes:
SslConnectiongains the verify option mask (initially 0), the minimum version (initially 0) and the ALPN protocol list.sceSslEnableVerifyOptionORs the bits into the mask andsceSslDisableVerifyOptionclears them. Option 0 is accepted and changes nothing.sceSslSetMinSslVersionstores a version from 0 to 5.sceSslSetAlpncopies the NUL-terminated wire-format list. All four return 0.sceSslGetAlpnSelectedreturns null for a known connection.sceSslConnectstill throws, so no handshake runs and no protocol is ever negotiated.std::invalid_argumentbecause the console's error codes are unknown: an unknown connection, a connection whose context was terminated, option bits outside the six known ones, a version outside 0 to 5, and a null protocol list.guest_sslcovers enabling all known bits, disabling one bit twice, option 0, unknown bits for both calls, every version from 0 to 5 plus 6 and -1,GetAlpnSelectedbefore and afterSetAlpn, a null list, all five calls on an unknown connection, and calls aftersceSslTerm.sceSslEnableVerifyOptionnext to libSceJson2, libSceConvertKeycode and libSceNpSessionSignaling exports. It drops that function and moves todocs/dev/debt/libSceJson2.md, the first library it still names, under the same Functional section; libSceSsl.md keeps no empty section.Still throwing:
sceSslConnect,sceSslRead,sceSslWriteandsceSslClose. There is no TLS transport, so the recorded options affect nothing yet.Progress: libSceSsl 12/28 → 17/28.
Tested
Head
fb1051b352d840f0939545a4e272309ee778fa90, basea453108cf7768b71879b0e832d367a935c43440d.BUILD_TESTING=ON, tests run under QEMU 8.2 user mode with-cpu EPYC-Romebecause the build host lacks AVX2):guest_ssl_tests5/5,guest_ssl_load_tests5/5 passes.core/libs/prx/libSceSsl/Export.cppwith the base version:guest_ssl_testsfails withsceSslEnableVerifyOption not implemented;guest_ssl_load_testsstill pass there, as expected for regression coverage. Restoring the PR source and rebuilding passesguest_ssl_tests5/5,guest_ssl_load_tests5/5.git diff --checkpass. The Linux job of the Build workflow now targets the project's self-hosted runner, so it was not run on the fork; no title was run.Duplicate and overlap check
libSceSsl,GuestSsl.cpp,docs/dev/debt/libSceSsl.mdordocs/dev/debt/libSceJson2.md, and none names these functions. feat(libSceJson2): implement sce::Json::String methods and npos boykopovar/AnyPS5#5439 changes libSceJson2 code but not its debt file.core/libs/prx/libSceSsl/Export.cppand the neighbouring CA-load entry indocs/dev/debt/libSceSsl.md. A three-way merge of the two branches has one conflict block in each of those two files. Whichever PR merges second needs a trivial rebase. There is no functional dependency in either direction.mainwithout conflicts, including the libSceJson2 debt file that feat(libSceJson2): implement Object::Pair, Array::iterator copies and notifyError boykopovar/AnyPS5#5634 changed.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)