Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7e9ad1b
feat(libSceLibreSsl3): return from the error-string and digest loaders
bayessawitcoming Nov 8, 2026
d1dbb05
docs(libSceLibreSsl3): justify the no-op error-string and digest loaders
bayessawitcoming Nov 8, 2026
1e08539
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 8, 2026
e2fbe72
docs(libSceLibreSsl3): keep the silent-stub entry within the length l…
bayessawitcoming Nov 8, 2026
313b40e
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 9, 2026
f1ca1d9
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 9, 2026
6e77d7b
docs(libSceLibreSsl3): put the loader entry under Silent stubs
bayessawitcoming Nov 9, 2026
8fce677
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 9, 2026
48afc9e
docs(libSceLibreSsl3): recount the unimplemented exports
bayessawitcoming Nov 9, 2026
9003616
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 9, 2026
f1a7ec2
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 10, 2026
61a7242
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 10, 2026
2de9f39
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 10, 2026
3c877e9
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 10, 2026
482bd81
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 10, 2026
d529cd2
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 10, 2026
5593710
Merge remote-tracking branch 'fork/feat/libressl3-error-string-loader…
bayessawitcoming Nov 10, 2026
c34e26a
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 11, 2026
65230b0
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 11, 2026
55843fb
chore(libSceLibreSsl3): merge main
oneandonlydean Nov 11, 2026
dd34b51
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
fishingpvalues Nov 12, 2026
b802be9
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
fishingpvalues Nov 12, 2026
40824ec
docs(libSceLibreSsl3): point the loader rationale at the implemented …
fishingpvalues Nov 12, 2026
6847665
docs(libSceLibreSsl3): count the remaining throwing stubs exactly
fishingpvalues Nov 12, 2026
5364512
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 13, 2026
8bbeff0
docs(libSceLibreSsl3): normalize the export inventory against main
bayessawitcoming Nov 13, 2026
ec5faa9
build(libSceLibreSsl3): restore the test blocks the main merge fused …
oneandonlydean Nov 13, 2026
1a6eb68
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
bayessawitcoming Nov 13, 2026
16d3cfe
docs(libSceLibreSsl3): normalize the inventory against current main
bayessawitcoming Nov 13, 2026
0810bb3
fix(libSceLibreSsl3): restore the CMake tail broken by the merge of main
oneandonlydean Nov 13, 2026
093bd71
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
fishingpvalues Nov 14, 2026
22dc4df
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
fishingpvalues Nov 15, 2026
4d6a9e7
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
fishingpvalues Nov 16, 2026
cc40ac2
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
fishingpvalues Nov 16, 2026
6a9880f
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
fishingpvalues Nov 17, 2026
511ef85
Merge remote-tracking branch 'origin/main' into feat/libressl3-error-…
fishingpvalues Nov 17, 2026
0048608
fix(build): keep main's CMake test registrations after the merge
fishingpvalues Nov 17, 2026
74bb3b0
docs(libSceLibreSsl3): keep the loader debt entry from matching the E…
oneandonlydean Nov 17, 2026
32c166e
chore: merge main
oneandonlydean Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions core/libs/prx/libSceLibreSsl3/AdditionalExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ int APS5_VABI i2d_PUBKEY_nid_postfix() {
NotImplemented_nid_no_patch(__func__);
}

int APS5_VABI ERR_load_X509_strings_nid_postfix() {
NotImplemented_nid_no_patch(__func__);
}


int APS5_VABI X509_check_akid_nid_postfix() {
NotImplemented_nid_no_patch(__func__);
}
Expand All @@ -112,14 +107,6 @@ int APS5_VABI X509_CRL_get0_by_cert_nid_postfix() {
NotImplemented_nid_no_patch(__func__);
}

int APS5_VABI ERR_load_PEM_strings_nid_postfix() {
NotImplemented_nid_no_patch(__func__);
}

int APS5_VABI OpenSSL_add_all_digests_nid_postfix() {
NotImplemented_nid_no_patch(__func__);
}

int APS5_VABI Unknown_PBYz0kpXwg8_nid_no_patch() {
NotImplemented_nid_no_patch(__func__);
}
Expand Down
14 changes: 14 additions & 0 deletions core/libs/prx/libSceLibreSsl3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ if(BUILD_TESTING)
endif()

target_sources(libSceLibreSsl3 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/Asn1Values.cpp)
target_sources(libSceLibreSsl3 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/ErrorStringLoaders.cpp)

if(BUILD_TESTING)
add_test_executable(guest_libressl3_asn1_values_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/Asn1Values.cpp)
Expand Down Expand Up @@ -919,6 +920,19 @@ if(BUILD_TESTING)
endif()
endif()

if(BUILD_TESTING)
add_test_executable(guest_libressl3_error_string_loaders_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/ErrorStringLoaders.cpp)
target_include_directories(guest_libressl3_error_string_loaders_tests PRIVATE ${LIBS_INCLUDE_DIR})
target_link_libraries(guest_libressl3_error_string_loaders_tests PRIVATE libSceLibreSsl3 libSceLibreSsl)
configure_windows_unwind(guest_libressl3_error_string_loaders_tests)
add_test(NAME guest_libressl3_error_string_loaders COMMAND guest_libressl3_error_string_loaders_tests)
set_tests_properties(guest_libressl3_error_string_loaders PROPERTIES TIMEOUT 20)
if(WIN32)
set_tests_properties(guest_libressl3_error_string_loaders PROPERTIES ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceLibreSsl3>")
endif()
endif()

target_sources(libSceLibreSsl3 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/ErrorPrinting.cpp)

if(BUILD_TESTING)
Expand Down
6 changes: 3 additions & 3 deletions core/libs/prx/libSceLibreSsl3/include/Api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ int APS5_VABI BIO_meth_set_read_nid_postfix(LibreSsl::BioMethod* method, decltyp
int APS5_VABI EC_POINT_set_affine_coordinates_GFp_nid_postfix();
int APS5_VABI SSL_CTX_set_max_early_data_nid_postfix(void* ctx, std::uint32_t maxEarlyData);
int APS5_VABI i2d_PUBKEY_nid_postfix();
int APS5_VABI ERR_load_X509_strings_nid_postfix();
void APS5_VABI ERR_load_X509_strings_nid_postfix(void);
int APS5_VABI X509_cmp_current_time_nid_postfix(const Asn1String* time);
int APS5_VABI X509_get_ext_by_NID_nid_postfix(const LibreSsl3Certificate* certificate, int nid, int lastpos);
int APS5_VABI EVP_PKEY_security_bits_nid_postfix(const LibreSsl3EvpPkey* key);
Expand All @@ -389,8 +389,8 @@ int APS5_VABI AES_unwrap_key_nid_postfix(AesKey* key, const unsigned char* iv, u
int APS5_VABI ASN1_OCTET_STRING_cmp_nid_postfix(const Asn1String* first, const Asn1String* second);
int APS5_VABI X509_print_nid_postfix();
int APS5_VABI X509_CRL_get0_by_cert_nid_postfix();
int APS5_VABI ERR_load_PEM_strings_nid_postfix();
int APS5_VABI OpenSSL_add_all_digests_nid_postfix();
void APS5_VABI ERR_load_PEM_strings_nid_postfix(void);
void APS5_VABI OpenSSL_add_all_digests_nid_postfix(void);
int APS5_VABI EVP_PKEY_base_id_nid_postfix(const LibreSsl3EvpPkey* key);
int APS5_VABI Unknown_PBYz0kpXwg8_nid_no_patch();
int APS5_VABI X509_new_nid_postfix();
Expand Down
11 changes: 11 additions & 0 deletions core/libs/prx/libSceLibreSsl3/src/ErrorStringLoaders.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "prx/libSceLibreSsl3/include/Api.hpp"

extern "C" {

void APS5_VABI ERR_load_X509_strings_nid_postfix(void) {}

void APS5_VABI ERR_load_PEM_strings_nid_postfix(void) {}

void APS5_VABI OpenSSL_add_all_digests_nid_postfix(void) {}

}
25 changes: 25 additions & 0 deletions core/libs/prx/libSceLibreSsl3/tests/ErrorStringLoaders.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "prx/libSceLibreSsl3/libSceLibreSsl3.hpp"

#include <cstdio>
#include <cstdlib>
#include <source_location>

namespace {

void Require(bool condition, std::source_location location = std::source_location::current()) {
if (condition) return;
std::fprintf(stderr, "LibreSSL3 error-string loader check failed at line %u\n", location.line());
std::abort();
}

} // namespace

int main() {
const void* sha256 = EVP_get_digestbyname_nid_postfix("SHA256");
Require(sha256 != nullptr);
ERR_load_X509_strings_nid_postfix();
ERR_load_PEM_strings_nid_postfix();
OpenSSL_add_all_digests_nid_postfix();
Require(EVP_get_digestbyname_nid_postfix("SHA256") == sha256);
std::puts("libSceLibreSsl3 error-string loader tests passed");
}
4 changes: 1 addition & 3 deletions docs/dev/debt/libSceLibreSsl3.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [`X509_set_version`](../../../core/libs/prx/libSceLibreSsl3/src/X509.cpp) follows LibreSSL 4.0.0 `crypto/x509/x509_set.c` at [`ce488b78e0bd994780569df718596b9776ff681a`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/x509/x509_set.c) and the `X509_CINF` layout in its `x509_local.h`. Versions outside 0 to 2 return 0 without mutation; a missing version integer is allocated from the guest heap, the encoding is marked modified, and the value is set through `ASN1_INTEGER_set`. A null certificate returns 0 and null certificate info, undefined upstream, throws. The 104-byte `X509_CINF` layout and the `enc.modified` offset 96 are not measured on the console.
### Functional

- [ERR_load_X509_strings, ERR_load_PEM_strings and OpenSSL_add_all_digests](../../../core/libs/prx/libSceLibreSsl3/src/ErrorStringLoaders.cpp) (libSceLibreSsl3) - do not register the reason strings and digests that LibreSSL loads in `x509_err.c`, `pem_err.c` and `c_all.c`, because no lookup reads those registries: the digest lookup by name uses the always-populated static table in [src/DigestNames.cpp](../../../core/libs/prx/libSceLibreSsl3/src/DigestNames.cpp), `ERR_load_crypto_strings` is empty ([Export.cpp](../../../core/libs/prx/libSceLibreSsl3/Export.cpp)), and the `ERR_*_error_string` lookups return null ([src/ErrorStrings.cpp](../../../core/libs/prx/libSceLibreSsl3/src/ErrorStrings.cpp)). Firmware 13.42 `libSceLibreSsl3.sprx` also returns immediately: bodies at `0xc37b0`, `0x989d0` and `0x10100` are a lone `ret`, read from the [disassembly](https://github.com/boykopovar/AnyPS5/pull/15591) and not run on a console; LibreSSL declares all three `void (void)`.
- [X509_add_ext and X509_EXTENSION_free](../../../core/libs/prx/libSceLibreSsl3/src/X509ExtensionStack.cpp) - `X509_add_ext` duplicates the 24-byte extension (object with names and OID bytes, critical flag and octet value), creates the certificate-info extension stack when absent, appends the copy and moves it to the requested position; `X509_EXTENSION_free` releases a null or non-null extension through the same object and string destructors. The `X509`, `X509_CINF`, stack and extension layouts follow LibreSSL 4.0.0 and are not measured on the console; a null certificate or extension returns 0, and an invalid stack count throws. Closes when: compared with the console.
- [X509_get0_pubkey](../../../core/libs/prx/libSceLibreSsl3/src/X509PublicKeyAccessors.cpp) - reads the cached public key from the certificate-info key structure; a null certificate, info or key returns null, and a null cached key with encoded SPKI data throws `NotImplemented_nid_no_patch` until SPKI decoding exists. The PS5 layout and console behaviour are unverified. Closes when: compared with the console.
- [AUTHORITY_KEYID_free and X509_CRL_free](../../../core/libs/prx/libSceLibreSsl3/src/X509ItemFree.cpp#L6) - not measured on a PS5; non-null object disposal remains unsupported and throws before dereference. The null no-op follows LibreSSL 4.0.0 [`AUTHORITY_KEYID_free`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/x509/x509_akeya.c#L124-L128), [`X509_CRL_free`](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/asn1/x_crl.c#L507-L511) and their [`ASN1_item_free` dispatcher](https://github.com/libressl/openbsd/blob/ce488b78e0bd994780569df718596b9776ff681a/src/lib/libcrypto/asn1/tasn_fre.c#L72-L99).
Expand Down Expand Up @@ -130,16 +131,13 @@
| `tls_read` | `7RvDjfy4gUA` |
| `EC_POINT_set_affine_coordinates_GFp` | `8AGfaSvdDq4` |
| `i2d_PUBKEY` | `A-Hs-8mau+8` |
| `ERR_load_X509_strings` | `A0lZtFjhcTw` |
| `X509_check_akid` | `C7eFtWPfLdk` |
| `SSL_CTX_set_default_verify_paths` | `DZ6fywqpaik` |
| `d2i_SSL_SESSION` | `IiG4HLr+cOw` |
| `RSAPublicKey_dup` | `JSqFTYGaWhU` |
| `SSL_CTX_add1_chain_cert` | `L897DuAuXKk` |
| `X509_print` | `LA1MlgDx80o` |
| `X509_CRL_get0_by_cert` | `LdGe2IfIlpI` |
| `ERR_load_PEM_strings` | `M7ze0mz2jQM` |
| `OpenSSL_add_all_digests` | `O9Thca3enw8` |
| `unknown` | `PBYz0kpXwg8` |
| `X509_new` | `PNfwr3s6dEs` |
| `SSL_get0_verified_chain` | `QKIOxHfZLh8` |
Expand Down
Loading