feat(libSceLibreSsl): parse cipher rule strings in SSL_CTX_set_cipher_list #17813
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17813"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarrasFederico on 2026-11-09T16:57:27Z.
What
SSL_CTX_set_cipher_listparses real cipher rule strings, as LibreSSL 2.5.4 does. It used to throw on every call.This follows up on #16724, which only handled a null rule string and was closed with a request for a version that parses real strings.
ssl3_ciphers[](s3_lib.c), in the 88-byte layout thatSSL_CIPHER_get_name,SSL_CIPHER_get_bitsandSSL_CIPHER_get_versionalready read.ssl_create_cipher_list(ssl_ciph.c). It covers:ALL,HIGH,kEECDH,AESGCM, …), including combined ones such askEECDH+AESGCM;+,-and!operators,@STRENGTH, and the:,;and space separators;DEFAULTprefix (ALL:!aNULL:!eNULL:!SSLv2);SSL_CTX_set_cipher_listinstalls the ordered list and the id-sorted list into the context and frees the previous ones._STACK; the sorted one has a guest-callable comparator.SSL_R_NO_CIPHER_MATCHwhen nothing matches, and reportsSSL_R_INVALID_COMMANDthe way LibreSSL does.Reviewer points addressed (oneandonlydean):
ssl_ciph.c(v1.96, including the Nokia block) ands3_lib.c(v1.138) have been added verbatim byte-for-byte at the top ofcore/libs/prx/libSceLibreSsl/src/CipherList.cpp, followed by attribution lines with pinned permalinks to 2.5.4 (https://github.com/libressl/openbsd/blob/2e2c612066aa993717528a0249c15c51128d61cb/src/lib/libssl/ssl_ciph.cand.../src/lib/libssl/s3_lib.c).include/CipherList.hppcontains only AnyPS5-specific helper declarations and no ported code.upstream/main(919e4ee48a) into the published head (2b15fc50e3) with merge commitchore: merge upstream main. All conflicts inExport.cpp,Oracle.cpp, andOracleReference.cppwere resolved by taking main's full code/tests and cleanly re-applying PR #17813's additions. No functions or structs are duplicated.docs/dev/debt/libSceLibreSsl.mdhas no summary numeric count line on main. Verified actualNotImplemented_nid_no_patchoccurrences incore/libs/prx/libSceLibreSsl/Export.cpp: 93 on main -> 92 in this branch (SSL_CTX_set_cipher_list_nid_postfixremoved). Technical debt entry forSSL_CTX_set_cipher_listupdated.Final head:
1f77cc7be2Debt: the console's build choices are assumed, not measured:
Tested
Ubuntu 26.04.1 LTS, kernel 7.0.0-43-generic, GCC 15.2.0, Release,
BUILD_TESTING=ON, CMake 4.4.4 with Ninja 1.13 from a virtualenv. Mergedupstream/maininto the published head2b15fc50e3with normal merge commits20070ce24a(main919e4ee48a); the published history was not rebased, squashed or force-pushed. On top of the merges the branch adds local commit(s):1f77cc7be2(docs(libSceLibreSsl): keep LibreSSL 2.5.4 licence notices in CipherList.cpp). No console or title was run. Final head:1f77cc7be2(full1f77cc7be287502a3d23b664c1e5a05c0a609967). Windows and macOS were not compiled here; no game title was run.guest_libressl_cipher_list: checks the table,ssl3_get_cipherindex order, lookup by id and bit counts. It also covers errors and their codes, ordering rules,DEFAULT,@STRENGTH, stack shapes and the comparator, and replacing a list.guest_libressl_cipher_list_allocator: checks that each failed guest allocation returns 0, keeps the previous lists and frees everything it allocated. It also checks that a failed growth during a push silently drops that cipher, as in 2.5.4.-DANYPS5_LIBRESSL_ORACLE=ON, built against the official libressl-2.5.4 tarball):AES_set_encrypt_keyandAES_set_decrypt_key; those are onmainwithout this PR too.!rule disabled, the unit test fails and the oracle reports 515 of 3,500 lists differing. Restoring the code makes both pass.ctest -R '^guest_libressl_cipher' --output-on-failure --repeat until-fail:3: 100% tests passed out of 3, 3 runs each,Not Run= 0 (exit 0).guest_libressl_oracle_testsis behindoption(ANYPS5_LIBRESSL_ORACLE ... OFF)and needs a LibreSSL 2.5.4 checkout, so the oracle evidence stays the one produced on the contributor's machine.python3 tools/check_conventions.py --base upstream/mainpassed (0 errors);git diff --check upstream/main...HEADpassed cleanly.Publication checks: head
1f77cc7be287502a3d23b664c1e5a05c0a609967passed an independent conventions/diff check and a clean merge-tree check against upstream mainfa289273974bb03ffcf6c6432f0b15a2cb65f46d. Linux execution results above come from the recorded verification runs, reviewed rather than rerun during publication.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)