diff --git a/rpcs3/Emu/Cell/Modules/cellSsl.cpp b/rpcs3/Emu/Cell/Modules/cellSsl.cpp index 985aa72a71..6efc347a44 100644 --- a/rpcs3/Emu/Cell/Modules/cellSsl.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSsl.cpp @@ -11,6 +11,8 @@ logs::channel cellSsl("cellSsl"); namespace vm { using namespace ps3; } +enum SpecialCerts { BaltimoreCert = 6, Class3G2V2Cert = 13, ClassSSV4Cert = 15, EntrustNetCert = 18, GTECyberTrustGlobalCert = 23 }; + s32 cellSslInit(vm::ptr pool, u32 poolSize) { cellSsl.todo("cellSslInit(pool=0x%x, poolSize=%d)", pool, poolSize); @@ -23,14 +25,22 @@ s32 cellSslEnd() return CELL_OK; } -std::string getCert(const std::string certPath, const int certID) +std::string getCert(const std::string certPath, const int certID, const bool isNormalCert) { - //Stupid cellssl int newID = certID; - if (certID == 6) - newID = 23; - if (certID > 6 && certID < 23) - newID = certID - 1; + + // The 'normal' certs have some special rules for loading. + if (isNormalCert && certID >= BaltimoreCert && certID <= GTECyberTrustGlobalCert) + { + if (certID == BaltimoreCert) + newID = GTECyberTrustGlobalCert; + else if (certID == Class3G2V2Cert) + newID = BaltimoreCert; + else if (certID == EntrustNetCert) + newID = ClassSSV4Cert; + else + newID = certID - 1; + } std::string filePath = fmt::format("%sCA%02d.cer", certPath, newID); @@ -51,27 +61,28 @@ s32 cellSslCertificateLoader(u64 flag, vm::ptr buffer, u32 size, vm::ptr