From 6f85b11fccebce391daccf861ff885dffedefeee Mon Sep 17 00:00:00 2001 From: Connor Date: Mon, 1 Jul 2019 03:53:46 -0700 Subject: [PATCH] Fix for 4.X units (new strato rework broke a method in spl) (#616) * Fix for 4.X units (new strato rework broke a method in spl) * Fixed formatting in spl --- .../spl/source/spl_deprecated_service.hpp | 51 ++++++++------- stratosphere/spl/source/spl_es_service.hpp | 24 +++---- .../spl/source/spl_general_service.hpp | 65 ++++++++++--------- stratosphere/spl/source/spl_manu_service.hpp | 16 ++--- stratosphere/spl/source/spl_rsa_service.hpp | 14 ++-- stratosphere/spl/source/spl_ssl_service.hpp | 18 ++--- 6 files changed, 95 insertions(+), 93 deletions(-) diff --git a/stratosphere/spl/source/spl_deprecated_service.hpp b/stratosphere/spl/source/spl_deprecated_service.hpp index 30fac8108..e9e97cb14 100644 --- a/stratosphere/spl/source/spl_deprecated_service.hpp +++ b/stratosphere/spl/source/spl_deprecated_service.hpp @@ -25,35 +25,36 @@ namespace sts::spl { protected: enum class CommandId { /* 1.0.0+ */ - GetConfig = 0, - ExpMod = 1, - GenerateAesKek = 2, - LoadAesKey = 3, - GenerateAesKey = 4, - SetConfig = 5, - GenerateRandomBytes = 7, - ImportLotusKey = 9, - DecryptLotusMessage = 10, - IsDevelopment = 11, - GenerateSpecificAesKey = 12, - DecryptRsaPrivateKey = 13, - DecryptAesKey = 14, - CryptAesCtrDeprecated = 15, - CryptAesCtr = 15, - ComputeCmac = 16, - ImportEsKey = 17, - UnwrapTitleKey = 18, - LoadTitleKey = 19, + GetConfig = 0, + ExpMod = 1, + GenerateAesKek = 2, + LoadAesKey = 3, + GenerateAesKey = 4, + SetConfig = 5, + GenerateRandomBytes = 7, + ImportLotusKey = 9, + DecryptLotusMessage = 10, + IsDevelopment = 11, + GenerateSpecificAesKey = 12, + DecryptRsaPrivateKeyDeprecated = 13, + DecryptRsaPrivateKey = 13, + DecryptAesKey = 14, + CryptAesCtrDeprecated = 15, + CryptAesCtr = 15, + ComputeCmac = 16, + ImportEsKey = 17, + UnwrapTitleKey = 18, + LoadTitleKey = 19, /* 2.0.0+ */ - UnwrapCommonTitleKey = 20, - AllocateAesKeyslot = 21, - FreeAesKeyslot = 22, - GetAesKeyslotAvailableEvent = 23, + UnwrapCommonTitleKey = 20, + AllocateAesKeyslot = 21, + FreeAesKeyslot = 22, + GetAesKeyslotAvailableEvent = 23, /* 3.0.0+ */ - SetBootReason = 24, - GetBootReason = 25, + SetBootReason = 24, + GetBootReason = 25, }; public: DeprecatedService() { /* ... */ } diff --git a/stratosphere/spl/source/spl_es_service.hpp b/stratosphere/spl/source/spl_es_service.hpp index 774e14409..483ce2ead 100644 --- a/stratosphere/spl/source/spl_es_service.hpp +++ b/stratosphere/spl/source/spl_es_service.hpp @@ -43,26 +43,26 @@ namespace sts::spl { MAKE_SERVICE_COMMAND_META(EsService, SetConfig), MAKE_SERVICE_COMMAND_META(EsService, GenerateRandomBytes), MAKE_SERVICE_COMMAND_META(EsService, IsDevelopment), - MAKE_SERVICE_COMMAND_META(EsService, SetBootReason, FirmwareVersion_300), - MAKE_SERVICE_COMMAND_META(EsService, GetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(EsService, SetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(EsService, GetBootReason, FirmwareVersion_300), MAKE_SERVICE_COMMAND_META(EsService, GenerateAesKek), MAKE_SERVICE_COMMAND_META(EsService, LoadAesKey), MAKE_SERVICE_COMMAND_META(EsService, GenerateAesKey), MAKE_SERVICE_COMMAND_META(EsService, DecryptAesKey), MAKE_SERVICE_COMMAND_META(EsService, CryptAesCtr), MAKE_SERVICE_COMMAND_META(EsService, ComputeCmac), - MAKE_SERVICE_COMMAND_META(EsService, AllocateAesKeyslot, FirmwareVersion_200), - MAKE_SERVICE_COMMAND_META(EsService, FreeAesKeyslot, FirmwareVersion_200), - MAKE_SERVICE_COMMAND_META(EsService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), - MAKE_SERVICE_COMMAND_META(EsService, DecryptRsaPrivateKey, FirmwareVersion_400, FirmwareVersion_400), - MAKE_SERVICE_COMMAND_META(EsService, DecryptRsaPrivateKey, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(EsService, AllocateAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(EsService, FreeAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(EsService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(EsService, DecryptRsaPrivateKeyDeprecated, FirmwareVersion_400, FirmwareVersion_400), + MAKE_SERVICE_COMMAND_META(EsService, DecryptRsaPrivateKey, FirmwareVersion_500), MAKE_SERVICE_COMMAND_META(EsService, ImportEsKey), MAKE_SERVICE_COMMAND_META(EsService, UnwrapTitleKey), - MAKE_SERVICE_COMMAND_META(EsService, UnwrapCommonTitleKey, FirmwareVersion_200), - MAKE_SERVICE_COMMAND_META(EsService, ImportDrmKey, FirmwareVersion_500), - MAKE_SERVICE_COMMAND_META(EsService, DrmExpMod, FirmwareVersion_500), - MAKE_SERVICE_COMMAND_META(EsService, UnwrapElicenseKey, FirmwareVersion_600), - MAKE_SERVICE_COMMAND_META(EsService, LoadElicenseKey, FirmwareVersion_600), + MAKE_SERVICE_COMMAND_META(EsService, UnwrapCommonTitleKey, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(EsService, ImportDrmKey, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(EsService, DrmExpMod, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(EsService, UnwrapElicenseKey, FirmwareVersion_600), + MAKE_SERVICE_COMMAND_META(EsService, LoadElicenseKey, FirmwareVersion_600), }; }; diff --git a/stratosphere/spl/source/spl_general_service.hpp b/stratosphere/spl/source/spl_general_service.hpp index baad7d84f..daa263600 100644 --- a/stratosphere/spl/source/spl_general_service.hpp +++ b/stratosphere/spl/source/spl_general_service.hpp @@ -25,46 +25,47 @@ namespace sts::spl { protected: enum class CommandId { /* 1.0.0+ */ - GetConfig = 0, - ExpMod = 1, - GenerateAesKek = 2, - LoadAesKey = 3, - GenerateAesKey = 4, - SetConfig = 5, - GenerateRandomBytes = 7, - ImportLotusKey = 9, - DecryptLotusMessage = 10, - IsDevelopment = 11, - GenerateSpecificAesKey = 12, - DecryptRsaPrivateKey = 13, - DecryptAesKey = 14, - CryptAesCtr = 15, - ComputeCmac = 16, - ImportEsKey = 17, - UnwrapTitleKey = 18, - LoadTitleKey = 19, + GetConfig = 0, + ExpMod = 1, + GenerateAesKek = 2, + LoadAesKey = 3, + GenerateAesKey = 4, + SetConfig = 5, + GenerateRandomBytes = 7, + ImportLotusKey = 9, + DecryptLotusMessage = 10, + IsDevelopment = 11, + GenerateSpecificAesKey = 12, + DecryptRsaPrivateKeyDeprecated = 13, + DecryptRsaPrivateKey = 13, + DecryptAesKey = 14, + CryptAesCtr = 15, + ComputeCmac = 16, + ImportEsKey = 17, + UnwrapTitleKey = 18, + LoadTitleKey = 19, /* 2.0.0+ */ - UnwrapCommonTitleKey = 20, - AllocateAesKeyslot = 21, - FreeAesKeyslot = 22, - GetAesKeyslotAvailableEvent = 23, + UnwrapCommonTitleKey = 20, + AllocateAesKeyslot = 21, + FreeAesKeyslot = 22, + GetAesKeyslotAvailableEvent = 23, /* 3.0.0+ */ - SetBootReason = 24, - GetBootReason = 25, + SetBootReason = 24, + GetBootReason = 25, /* 5.0.0+ */ - ImportSslKey = 26, - SslExpMod = 27, - ImportDrmKey = 28, - DrmExpMod = 29, - ReEncryptRsaPrivateKey = 30, - GetPackage2Hash = 31, + ImportSslKey = 26, + SslExpMod = 27, + ImportDrmKey = 28, + DrmExpMod = 29, + ReEncryptRsaPrivateKey = 30, + GetPackage2Hash = 31, /* 6.0.0+ */ - UnwrapElicenseKey = 31, /* re-used command id :( */ - LoadElicenseKey = 32, + UnwrapElicenseKey = 31, /* re-used command id :( */ + LoadElicenseKey = 32, }; public: GeneralService() { /* ... */ } diff --git a/stratosphere/spl/source/spl_manu_service.hpp b/stratosphere/spl/source/spl_manu_service.hpp index 2ae3f929c..cc17a5e2d 100644 --- a/stratosphere/spl/source/spl_manu_service.hpp +++ b/stratosphere/spl/source/spl_manu_service.hpp @@ -38,20 +38,20 @@ namespace sts::spl { MAKE_SERVICE_COMMAND_META(ManuService, SetConfig), MAKE_SERVICE_COMMAND_META(ManuService, GenerateRandomBytes), MAKE_SERVICE_COMMAND_META(ManuService, IsDevelopment), - MAKE_SERVICE_COMMAND_META(ManuService, SetBootReason, FirmwareVersion_300), - MAKE_SERVICE_COMMAND_META(ManuService, GetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(ManuService, SetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(ManuService, GetBootReason, FirmwareVersion_300), MAKE_SERVICE_COMMAND_META(ManuService, GenerateAesKek), MAKE_SERVICE_COMMAND_META(ManuService, LoadAesKey), MAKE_SERVICE_COMMAND_META(ManuService, GenerateAesKey), MAKE_SERVICE_COMMAND_META(ManuService, DecryptAesKey), MAKE_SERVICE_COMMAND_META(ManuService, CryptAesCtr), MAKE_SERVICE_COMMAND_META(ManuService, ComputeCmac), - MAKE_SERVICE_COMMAND_META(ManuService, AllocateAesKeyslot, FirmwareVersion_200), - MAKE_SERVICE_COMMAND_META(ManuService, FreeAesKeyslot, FirmwareVersion_200), - MAKE_SERVICE_COMMAND_META(ManuService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), - MAKE_SERVICE_COMMAND_META(ManuService, DecryptRsaPrivateKey, FirmwareVersion_400, FirmwareVersion_400), - MAKE_SERVICE_COMMAND_META(ManuService, DecryptRsaPrivateKey, FirmwareVersion_500), - MAKE_SERVICE_COMMAND_META(ManuService, ReEncryptRsaPrivateKey, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(ManuService, AllocateAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(ManuService, FreeAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(ManuService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(ManuService, DecryptRsaPrivateKeyDeprecated, FirmwareVersion_400, FirmwareVersion_400), + MAKE_SERVICE_COMMAND_META(ManuService, DecryptRsaPrivateKey, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(ManuService, ReEncryptRsaPrivateKey, FirmwareVersion_500), }; }; diff --git a/stratosphere/spl/source/spl_rsa_service.hpp b/stratosphere/spl/source/spl_rsa_service.hpp index 3e62d5288..aba63d509 100644 --- a/stratosphere/spl/source/spl_rsa_service.hpp +++ b/stratosphere/spl/source/spl_rsa_service.hpp @@ -38,19 +38,19 @@ namespace sts::spl { MAKE_SERVICE_COMMAND_META(RsaService, SetConfig), MAKE_SERVICE_COMMAND_META(RsaService, GenerateRandomBytes), MAKE_SERVICE_COMMAND_META(RsaService, IsDevelopment), - MAKE_SERVICE_COMMAND_META(RsaService, SetBootReason, FirmwareVersion_300), - MAKE_SERVICE_COMMAND_META(RsaService, GetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(RsaService, SetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(RsaService, GetBootReason, FirmwareVersion_300), MAKE_SERVICE_COMMAND_META(RsaService, GenerateAesKek), MAKE_SERVICE_COMMAND_META(RsaService, LoadAesKey), MAKE_SERVICE_COMMAND_META(RsaService, GenerateAesKey), MAKE_SERVICE_COMMAND_META(RsaService, DecryptAesKey), MAKE_SERVICE_COMMAND_META(RsaService, CryptAesCtr), MAKE_SERVICE_COMMAND_META(RsaService, ComputeCmac), - MAKE_SERVICE_COMMAND_META(RsaService, AllocateAesKeyslot, FirmwareVersion_200), - MAKE_SERVICE_COMMAND_META(RsaService, FreeAesKeyslot, FirmwareVersion_200), - MAKE_SERVICE_COMMAND_META(RsaService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), - MAKE_SERVICE_COMMAND_META(RsaService, DecryptRsaPrivateKey, FirmwareVersion_400, FirmwareVersion_400), - MAKE_SERVICE_COMMAND_META(RsaService, DecryptRsaPrivateKey, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(RsaService, AllocateAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(RsaService, FreeAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(RsaService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(RsaService, DecryptRsaPrivateKeyDeprecated, FirmwareVersion_400, FirmwareVersion_400), + MAKE_SERVICE_COMMAND_META(RsaService, DecryptRsaPrivateKey, FirmwareVersion_500), }; }; diff --git a/stratosphere/spl/source/spl_ssl_service.hpp b/stratosphere/spl/source/spl_ssl_service.hpp index cb9e06126..db09bfa12 100644 --- a/stratosphere/spl/source/spl_ssl_service.hpp +++ b/stratosphere/spl/source/spl_ssl_service.hpp @@ -38,21 +38,21 @@ namespace sts::spl { MAKE_SERVICE_COMMAND_META(SslService, SetConfig), MAKE_SERVICE_COMMAND_META(SslService, GenerateRandomBytes), MAKE_SERVICE_COMMAND_META(SslService, IsDevelopment), - MAKE_SERVICE_COMMAND_META(SslService, SetBootReason, FirmwareVersion_300), - MAKE_SERVICE_COMMAND_META(SslService, GetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(SslService, SetBootReason, FirmwareVersion_300), + MAKE_SERVICE_COMMAND_META(SslService, GetBootReason, FirmwareVersion_300), MAKE_SERVICE_COMMAND_META(SslService, GenerateAesKek), MAKE_SERVICE_COMMAND_META(SslService, LoadAesKey), MAKE_SERVICE_COMMAND_META(SslService, GenerateAesKey), MAKE_SERVICE_COMMAND_META(SslService, DecryptAesKey), MAKE_SERVICE_COMMAND_META(SslService, CryptAesCtr), MAKE_SERVICE_COMMAND_META(SslService, ComputeCmac), - MAKE_SERVICE_COMMAND_META(SslService, AllocateAesKeyslot, FirmwareVersion_200), - MAKE_SERVICE_COMMAND_META(SslService, FreeAesKeyslot, FirmwareVersion_200), - MAKE_SERVICE_COMMAND_META(SslService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), - MAKE_SERVICE_COMMAND_META(SslService, DecryptRsaPrivateKey, FirmwareVersion_400, FirmwareVersion_400), - MAKE_SERVICE_COMMAND_META(SslService, DecryptRsaPrivateKey, FirmwareVersion_500), - MAKE_SERVICE_COMMAND_META(SslService, ImportSslKey, FirmwareVersion_500), - MAKE_SERVICE_COMMAND_META(SslService, SslExpMod, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(SslService, AllocateAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(SslService, FreeAesKeyslot, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(SslService, GetAesKeyslotAvailableEvent, FirmwareVersion_200), + MAKE_SERVICE_COMMAND_META(SslService, DecryptRsaPrivateKeyDeprecated, FirmwareVersion_400, FirmwareVersion_400), + MAKE_SERVICE_COMMAND_META(SslService, DecryptRsaPrivateKey, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(SslService, ImportSslKey, FirmwareVersion_500), + MAKE_SERVICE_COMMAND_META(SslService, SslExpMod, FirmwareVersion_500), }; };