diff options
author | bunnei <bunneidev@gmail.com> | 2021-03-18 23:49:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-18 23:49:41 +0100 |
commit | cb48ed2e1a327889c119fb09f3d0a200b208ae97 (patch) | |
tree | adaf58c7d8abb571fb3813c7d1b94e8928258aa5 /src/core/hle/service/spl/spl.cpp | |
parent | Merge pull request #6055 from MerryMage/exceed-the-limit (diff) | |
parent | Fix casing on DeallocateAesKeySlot (diff) | |
download | yuzu-cb48ed2e1a327889c119fb09f3d0a200b208ae97.tar yuzu-cb48ed2e1a327889c119fb09f3d0a200b208ae97.tar.gz yuzu-cb48ed2e1a327889c119fb09f3d0a200b208ae97.tar.bz2 yuzu-cb48ed2e1a327889c119fb09f3d0a200b208ae97.tar.lz yuzu-cb48ed2e1a327889c119fb09f3d0a200b208ae97.tar.xz yuzu-cb48ed2e1a327889c119fb09f3d0a200b208ae97.tar.zst yuzu-cb48ed2e1a327889c119fb09f3d0a200b208ae97.zip |
Diffstat (limited to 'src/core/hle/service/spl/spl.cpp')
-rw-r--r-- | src/core/hle/service/spl/spl.cpp | 152 |
1 files changed, 143 insertions, 9 deletions
diff --git a/src/core/hle/service/spl/spl.cpp b/src/core/hle/service/spl/spl.cpp index 3fabc2c79..4e212610f 100644 --- a/src/core/hle/service/spl/spl.cpp +++ b/src/core/hle/service/spl/spl.cpp @@ -8,6 +8,24 @@ namespace Service::SPL { SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "spl:") { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetConfig"}, + {1, nullptr, "ModularExponentiate"}, + {5, nullptr, "SetConfig"}, + {7, &SPL::GetRandomBytes, "GetRandomBytes"}, + {11, nullptr, "IsDevelopment"}, + {24, nullptr, "SetBootReason"}, + {25, nullptr, "GetBootReason"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr<Module> module_) + : Interface(system_, std::move(module_), "spl:mig") { + // clang-format off static const FunctionInfo functions[] = { {0, nullptr, "GetConfig"}, {1, nullptr, "ModularExponentiate"}, @@ -15,19 +33,67 @@ SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_) {3, nullptr, "LoadAesKey"}, {4, nullptr, "GenerateAesKey"}, {5, nullptr, "SetConfig"}, - {7, &SPL::GetRandomBytes, "GetRandomBytes"}, - {9, nullptr, "ImportLotusKey"}, - {10, nullptr, "DecryptLotusMessage"}, + {7, &SPL::GetRandomBytes, "GenerateRandomBytes"}, + {11, nullptr, "IsDevelopment"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, nullptr, "SetBootReason"}, + {25, nullptr, "GetBootReason"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr<Module> module_) + : Interface(system_, std::move(module_), "spl:fs") { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetConfig"}, + {1, nullptr, "ModularExponentiate"}, + {2, nullptr, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, nullptr, "GenerateAesKey"}, + {5, nullptr, "SetConfig"}, + {7, &SPL::GetRandomBytes, "GenerateRandomBytes"}, {11, nullptr, "IsDevelopment"}, {12, nullptr, "GenerateSpecificAesKey"}, - {13, nullptr, "DecryptDeviceUniqueData"}, {14, nullptr, "DecryptAesKey"}, {15, nullptr, "CryptAesCtr"}, {16, nullptr, "ComputeCmac"}, - {17, nullptr, "ImportEsKey"}, - {18, nullptr, "UnwrapTitleKey"}, {19, nullptr, "LoadTitleKey"}, - {20, nullptr, "PrepareEsCommonKey"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, nullptr, "SetBootReason"}, + {25, nullptr, "GetBootReason"}, + {31, nullptr, "GetPackage2Hash"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr<Module> module_) + : Interface(system_, std::move(module_), "spl:ssl") { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetConfig"}, + {1, nullptr, "ModularExponentiate"}, + {2, nullptr, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, nullptr, "GenerateAesKey"}, + {5, nullptr, "SetConfig"}, + {7, &SPL::GetRandomBytes, "GetRandomBytes"}, + {11, nullptr, "IsDevelopment"}, + {13, nullptr, "DecryptDeviceUniqueData"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, {21, nullptr, "AllocateAesKeyslot"}, {22, nullptr, "DeallocateAesKeySlot"}, {23, nullptr, "GetAesKeyslotAvailableEvent"}, @@ -35,15 +101,83 @@ SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_) {25, nullptr, "GetBootReason"}, {26, nullptr, "DecryptAndStoreSslClientCertKey"}, {27, nullptr, "ModularExponentiateWithSslClientCertKey"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr<Module> module_) + : Interface(system_, std::move(module_), "spl:es") { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetConfig"}, + {1, nullptr, "ModularExponentiate"}, + {2, nullptr, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, nullptr, "GenerateAesKey"}, + {5, nullptr, "SetConfig"}, + {7, &SPL::GetRandomBytes, "GenerateRandomBytes"}, + {11, nullptr, "IsDevelopment"}, + {13, nullptr, "DecryptDeviceUniqueData"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, + {18, nullptr, "UnwrapTitleKey"}, + {20, nullptr, "PrepareEsCommonKey"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, nullptr, "SetBootReason"}, + {25, nullptr, "GetBootReason"}, {28, nullptr, "DecryptAndStoreDrmDeviceCertKey"}, {29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"}, - {30, nullptr, "ReencryptDeviceUniqueData "}, - {31, nullptr, "PrepareEsArchiveKey"}, // This is also GetPackage2Hash? + {31, nullptr, "PrepareEsArchiveKey"}, {32, nullptr, "LoadPreparedAesKey"}, }; + // clang-format on + + RegisterHandlers(functions); +} + +SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr<Module> module_) + : Interface(system_, std::move(module_), "spl:manu") { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetConfig"}, + {1, nullptr, "ModularExponentiate"}, + {2, nullptr, "GenerateAesKek"}, + {3, nullptr, "LoadAesKey"}, + {4, nullptr, "GenerateAesKey"}, + {5, nullptr, "SetConfig"}, + {7, &SPL::GetRandomBytes, "GetRandomBytes"}, + {11, nullptr, "IsDevelopment"}, + {13, nullptr, "DecryptDeviceUniqueData"}, + {14, nullptr, "DecryptAesKey"}, + {15, nullptr, "CryptAesCtr"}, + {16, nullptr, "ComputeCmac"}, + {21, nullptr, "AllocateAesKeyslot"}, + {22, nullptr, "DeallocateAesKeySlot"}, + {23, nullptr, "GetAesKeyslotAvailableEvent"}, + {24, nullptr, "SetBootReason"}, + {25, nullptr, "GetBootReason"}, + {30, nullptr, "ReencryptDeviceUniqueData"}, + }; + // clang-format on + RegisterHandlers(functions); } SPL::~SPL() = default; +SPL_MIG::~SPL_MIG() = default; + +SPL_FS::~SPL_FS() = default; + +SPL_SSL::~SPL_SSL() = default; + +SPL_ES::~SPL_ES() = default; + +SPL_MANU::~SPL_MANU() = default; + } // namespace Service::SPL |