Files
AnyPS5/core/libs/tests/GuestSsl.cpp
T
Adrià FranchandClaude c548cd25b7 feat(libSceSsl): implement CA certificate queries and sceHttp2AbortRequest
sceSslGetCaCerts reports that no CA certificates are available and
sceSslFreeCaCerts clears the structure, in line with the library's
no-network behaviour. sceHttp2AbortRequest succeeds like
sceHttpAbortRequest. sceSslClose and sceSslGetSerialNumber keep throwing
and are listed as unknown signatures.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-01 18:35:02 +02:00

37 lines
1.1 KiB
C++

#include "prx/libc/include/general/VabiMacros.hpp"
#include <cstddef>
#include <cstdlib>
extern "C" {
int APS5_VABI sceSslInit_nid_postfix(std::size_t);
int APS5_VABI sceSslGetCaCerts(int, void*);
int APS5_VABI sceSslFreeCaCerts(int, void*);
}
static void Require(bool value) { if (!value) std::abort(); }
struct SslCaCerts {
void* certs;
std::size_t num;
void* pool;
};
int main() {
constexpr int notFound = static_cast<int>(0x8095F004);
constexpr int invalidArg = static_cast<int>(0x8095177A);
int marker = 0;
const int context = sceSslInit_nid_postfix(0x10000);
Require(context > 0);
Require(sceSslGetCaCerts(context, nullptr) == invalidArg);
Require(sceSslFreeCaCerts(context, nullptr) == invalidArg);
SslCaCerts certs{&marker, 3, &marker};
Require(sceSslGetCaCerts(context, &certs) == notFound);
Require(certs.certs == nullptr && certs.num == 0 && certs.pool == nullptr);
certs = {&marker, 3, &marker};
Require(sceSslFreeCaCerts(context, &certs) == 0);
Require(certs.certs == nullptr && certs.num == 0 && certs.pool == nullptr);
}