summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/spl/csrng.cpp2
-rw-r--r--src/core/hle/service/spl/module.cpp14
-rw-r--r--src/core/hle/service/spl/module.h9
-rw-r--r--src/core/hle/service/spl/spl.cpp84
4 files changed, 64 insertions, 45 deletions
diff --git a/src/core/hle/service/spl/csrng.cpp b/src/core/hle/service/spl/csrng.cpp
index 1beca417c..9c7f89475 100644
--- a/src/core/hle/service/spl/csrng.cpp
+++ b/src/core/hle/service/spl/csrng.cpp
@@ -9,7 +9,7 @@ namespace Service::SPL {
9CSRNG::CSRNG(Core::System& system_, std::shared_ptr<Module> module_) 9CSRNG::CSRNG(Core::System& system_, std::shared_ptr<Module> module_)
10 : Interface(system_, std::move(module_), "csrng") { 10 : Interface(system_, std::move(module_), "csrng") {
11 static const FunctionInfo functions[] = { 11 static const FunctionInfo functions[] = {
12 {0, &CSRNG::GetRandomBytes, "GetRandomBytes"}, 12 {0, &CSRNG::GenerateRandomBytes, "GenerateRandomBytes"},
13 }; 13 };
14 RegisterHandlers(functions); 14 RegisterHandlers(functions);
15} 15}
diff --git a/src/core/hle/service/spl/module.cpp b/src/core/hle/service/spl/module.cpp
index 0b5e2b7c3..eabf2e319 100644
--- a/src/core/hle/service/spl/module.cpp
+++ b/src/core/hle/service/spl/module.cpp
@@ -24,7 +24,13 @@ Module::Interface::Interface(Core::System& system_, std::shared_ptr<Module> modu
24 24
25Module::Interface::~Interface() = default; 25Module::Interface::~Interface() = default;
26 26
27void Module::Interface::GetRandomBytes(Kernel::HLERequestContext& ctx) { 27void Module::Interface::GetConfig(Kernel::HLERequestContext& ctx) {}
28
29void Module::Interface::ModularExponentiate(Kernel::HLERequestContext& ctx) {}
30
31void Module::Interface::SetConfig(Kernel::HLERequestContext& ctx) {}
32
33void Module::Interface::GenerateRandomBytes(Kernel::HLERequestContext& ctx) {
28 LOG_DEBUG(Service_SPL, "called"); 34 LOG_DEBUG(Service_SPL, "called");
29 35
30 const std::size_t size = ctx.GetWriteBufferSize(); 36 const std::size_t size = ctx.GetWriteBufferSize();
@@ -39,6 +45,12 @@ void Module::Interface::GetRandomBytes(Kernel::HLERequestContext& ctx) {
39 rb.Push(ResultSuccess); 45 rb.Push(ResultSuccess);
40} 46}
41 47
48void Module::Interface::IsDevelopment(Kernel::HLERequestContext& ctx) {}
49
50void Module::Interface::SetBootReason(Kernel::HLERequestContext& ctx) {}
51
52void Module::Interface::GetBootReason(Kernel::HLERequestContext& ctx) {}
53
42void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { 54void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
43 auto module = std::make_shared<Module>(); 55 auto module = std::make_shared<Module>();
44 std::make_shared<CSRNG>(system, module)->InstallAsService(service_manager); 56 std::make_shared<CSRNG>(system, module)->InstallAsService(service_manager);
diff --git a/src/core/hle/service/spl/module.h b/src/core/hle/service/spl/module.h
index 71855c1bf..67f7657e9 100644
--- a/src/core/hle/service/spl/module.h
+++ b/src/core/hle/service/spl/module.h
@@ -21,7 +21,14 @@ public:
21 const char* name); 21 const char* name);
22 ~Interface() override; 22 ~Interface() override;
23 23
24 void GetRandomBytes(Kernel::HLERequestContext& ctx); 24 // General
25 void GetConfig(Kernel::HLERequestContext& ctx);
26 void ModularExponentiate(Kernel::HLERequestContext& ctx);
27 void SetConfig(Kernel::HLERequestContext& ctx);
28 void GenerateRandomBytes(Kernel::HLERequestContext& ctx);
29 void IsDevelopment(Kernel::HLERequestContext& ctx);
30 void SetBootReason(Kernel::HLERequestContext& ctx);
31 void GetBootReason(Kernel::HLERequestContext& ctx);
25 32
26 protected: 33 protected:
27 std::shared_ptr<Module> module; 34 std::shared_ptr<Module> module;
diff --git a/src/core/hle/service/spl/spl.cpp b/src/core/hle/service/spl/spl.cpp
index fff3f3c42..20384042f 100644
--- a/src/core/hle/service/spl/spl.cpp
+++ b/src/core/hle/service/spl/spl.cpp
@@ -10,13 +10,13 @@ SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_)
10 : Interface(system_, std::move(module_), "spl:") { 10 : Interface(system_, std::move(module_), "spl:") {
11 // clang-format off 11 // clang-format off
12 static const FunctionInfo functions[] = { 12 static const FunctionInfo functions[] = {
13 {0, nullptr, "GetConfig"}, 13 {0, &SPL::GetConfig, "GetConfig"},
14 {1, nullptr, "ModularExponentiate"}, 14 {1, &SPL::ModularExponentiate, "ModularExponentiate"},
15 {5, nullptr, "SetConfig"}, 15 {5, &SPL::SetConfig, "SetConfig"},
16 {7, &SPL::GetRandomBytes, "GetRandomBytes"}, 16 {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
17 {11, nullptr, "IsDevelopment"}, 17 {11, &SPL::IsDevelopment, "IsDevelopment"},
18 {24, nullptr, "SetBootReason"}, 18 {24, &SPL::SetBootReason, "SetBootReason"},
19 {25, nullptr, "GetBootReason"}, 19 {25, &SPL::GetBootReason, "GetBootReason"},
20 }; 20 };
21 // clang-format on 21 // clang-format on
22 22
@@ -27,22 +27,22 @@ SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr<Module> module_)
27 : Interface(system_, std::move(module_), "spl:mig") { 27 : Interface(system_, std::move(module_), "spl:mig") {
28 // clang-format off 28 // clang-format off
29 static const FunctionInfo functions[] = { 29 static const FunctionInfo functions[] = {
30 {0, nullptr, "GetConfig"}, 30 {0, &SPL::GetConfig, "GetConfig"},
31 {1, nullptr, "ModularExponentiate"}, 31 {1, &SPL::ModularExponentiate, "ModularExponentiate"},
32 {2, nullptr, "GenerateAesKek"}, 32 {2, nullptr, "GenerateAesKek"},
33 {3, nullptr, "LoadAesKey"}, 33 {3, nullptr, "LoadAesKey"},
34 {4, nullptr, "GenerateAesKey"}, 34 {4, nullptr, "GenerateAesKey"},
35 {5, nullptr, "SetConfig"}, 35 {5, &SPL::SetConfig, "SetConfig"},
36 {7, &SPL::GetRandomBytes, "GenerateRandomBytes"}, 36 {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
37 {11, nullptr, "IsDevelopment"}, 37 {11, &SPL::IsDevelopment, "IsDevelopment"},
38 {14, nullptr, "DecryptAesKey"}, 38 {14, nullptr, "DecryptAesKey"},
39 {15, nullptr, "CryptAesCtr"}, 39 {15, nullptr, "CryptAesCtr"},
40 {16, nullptr, "ComputeCmac"}, 40 {16, nullptr, "ComputeCmac"},
41 {21, nullptr, "AllocateAesKeyslot"}, 41 {21, nullptr, "AllocateAesKeyslot"},
42 {22, nullptr, "DeallocateAesKeySlot"}, 42 {22, nullptr, "DeallocateAesKeySlot"},
43 {23, nullptr, "GetAesKeyslotAvailableEvent"}, 43 {23, nullptr, "GetAesKeyslotAvailableEvent"},
44 {24, nullptr, "SetBootReason"}, 44 {24, &SPL::SetBootReason, "SetBootReason"},
45 {25, nullptr, "GetBootReason"}, 45 {25, &SPL::GetBootReason, "GetBootReason"},
46 }; 46 };
47 // clang-format on 47 // clang-format on
48 48
@@ -53,16 +53,16 @@ SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr<Module> module_)
53 : Interface(system_, std::move(module_), "spl:fs") { 53 : Interface(system_, std::move(module_), "spl:fs") {
54 // clang-format off 54 // clang-format off
55 static const FunctionInfo functions[] = { 55 static const FunctionInfo functions[] = {
56 {0, nullptr, "GetConfig"}, 56 {0, &SPL::GetConfig, "GetConfig"},
57 {1, nullptr, "ModularExponentiate"}, 57 {1, &SPL::ModularExponentiate, "ModularExponentiate"},
58 {2, nullptr, "GenerateAesKek"}, 58 {2, nullptr, "GenerateAesKek"},
59 {3, nullptr, "LoadAesKey"}, 59 {3, nullptr, "LoadAesKey"},
60 {4, nullptr, "GenerateAesKey"}, 60 {4, nullptr, "GenerateAesKey"},
61 {5, nullptr, "SetConfig"}, 61 {5, &SPL::SetConfig, "SetConfig"},
62 {7, &SPL::GetRandomBytes, "GenerateRandomBytes"}, 62 {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
63 {9, nullptr, "ImportLotusKey"}, 63 {9, nullptr, "ImportLotusKey"},
64 {10, nullptr, "DecryptLotusMessage"}, 64 {10, nullptr, "DecryptLotusMessage"},
65 {11, nullptr, "IsDevelopment"}, 65 {11, &SPL::IsDevelopment, "IsDevelopment"},
66 {12, nullptr, "GenerateSpecificAesKey"}, 66 {12, nullptr, "GenerateSpecificAesKey"},
67 {14, nullptr, "DecryptAesKey"}, 67 {14, nullptr, "DecryptAesKey"},
68 {15, nullptr, "CryptAesCtr"}, 68 {15, nullptr, "CryptAesCtr"},
@@ -71,8 +71,8 @@ SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr<Module> module_)
71 {21, nullptr, "AllocateAesKeyslot"}, 71 {21, nullptr, "AllocateAesKeyslot"},
72 {22, nullptr, "DeallocateAesKeySlot"}, 72 {22, nullptr, "DeallocateAesKeySlot"},
73 {23, nullptr, "GetAesKeyslotAvailableEvent"}, 73 {23, nullptr, "GetAesKeyslotAvailableEvent"},
74 {24, nullptr, "SetBootReason"}, 74 {24, &SPL::SetBootReason, "SetBootReason"},
75 {25, nullptr, "GetBootReason"}, 75 {25, &SPL::GetBootReason, "GetBootReason"},
76 {31, nullptr, "GetPackage2Hash"}, 76 {31, nullptr, "GetPackage2Hash"},
77 }; 77 };
78 // clang-format on 78 // clang-format on
@@ -84,14 +84,14 @@ SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr<Module> module_)
84 : Interface(system_, std::move(module_), "spl:ssl") { 84 : Interface(system_, std::move(module_), "spl:ssl") {
85 // clang-format off 85 // clang-format off
86 static const FunctionInfo functions[] = { 86 static const FunctionInfo functions[] = {
87 {0, nullptr, "GetConfig"}, 87 {0, &SPL::GetConfig, "GetConfig"},
88 {1, nullptr, "ModularExponentiate"}, 88 {1, &SPL::ModularExponentiate, "ModularExponentiate"},
89 {2, nullptr, "GenerateAesKek"}, 89 {2, nullptr, "GenerateAesKek"},
90 {3, nullptr, "LoadAesKey"}, 90 {3, nullptr, "LoadAesKey"},
91 {4, nullptr, "GenerateAesKey"}, 91 {4, nullptr, "GenerateAesKey"},
92 {5, nullptr, "SetConfig"}, 92 {5, &SPL::SetConfig, "SetConfig"},
93 {7, &SPL::GetRandomBytes, "GetRandomBytes"}, 93 {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
94 {11, nullptr, "IsDevelopment"}, 94 {11, &SPL::IsDevelopment, "IsDevelopment"},
95 {13, nullptr, "DecryptDeviceUniqueData"}, 95 {13, nullptr, "DecryptDeviceUniqueData"},
96 {14, nullptr, "DecryptAesKey"}, 96 {14, nullptr, "DecryptAesKey"},
97 {15, nullptr, "CryptAesCtr"}, 97 {15, nullptr, "CryptAesCtr"},
@@ -99,8 +99,8 @@ SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr<Module> module_)
99 {21, nullptr, "AllocateAesKeyslot"}, 99 {21, nullptr, "AllocateAesKeyslot"},
100 {22, nullptr, "DeallocateAesKeySlot"}, 100 {22, nullptr, "DeallocateAesKeySlot"},
101 {23, nullptr, "GetAesKeyslotAvailableEvent"}, 101 {23, nullptr, "GetAesKeyslotAvailableEvent"},
102 {24, nullptr, "SetBootReason"}, 102 {24, &SPL::SetBootReason, "SetBootReason"},
103 {25, nullptr, "GetBootReason"}, 103 {25, &SPL::GetBootReason, "GetBootReason"},
104 {26, nullptr, "DecryptAndStoreSslClientCertKey"}, 104 {26, nullptr, "DecryptAndStoreSslClientCertKey"},
105 {27, nullptr, "ModularExponentiateWithSslClientCertKey"}, 105 {27, nullptr, "ModularExponentiateWithSslClientCertKey"},
106 }; 106 };
@@ -113,14 +113,14 @@ SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr<Module> module_)
113 : Interface(system_, std::move(module_), "spl:es") { 113 : Interface(system_, std::move(module_), "spl:es") {
114 // clang-format off 114 // clang-format off
115 static const FunctionInfo functions[] = { 115 static const FunctionInfo functions[] = {
116 {0, nullptr, "GetConfig"}, 116 {0, &SPL::GetConfig, "GetConfig"},
117 {1, nullptr, "ModularExponentiate"}, 117 {1, &SPL::ModularExponentiate, "ModularExponentiate"},
118 {2, nullptr, "GenerateAesKek"}, 118 {2, nullptr, "GenerateAesKek"},
119 {3, nullptr, "LoadAesKey"}, 119 {3, nullptr, "LoadAesKey"},
120 {4, nullptr, "GenerateAesKey"}, 120 {4, nullptr, "GenerateAesKey"},
121 {5, nullptr, "SetConfig"}, 121 {5, &SPL::SetConfig, "SetConfig"},
122 {7, &SPL::GetRandomBytes, "GenerateRandomBytes"}, 122 {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
123 {11, nullptr, "IsDevelopment"}, 123 {11, &SPL::IsDevelopment, "IsDevelopment"},
124 {13, nullptr, "DecryptDeviceUniqueData"}, 124 {13, nullptr, "DecryptDeviceUniqueData"},
125 {14, nullptr, "DecryptAesKey"}, 125 {14, nullptr, "DecryptAesKey"},
126 {15, nullptr, "CryptAesCtr"}, 126 {15, nullptr, "CryptAesCtr"},
@@ -131,8 +131,8 @@ SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr<Module> module_)
131 {21, nullptr, "AllocateAesKeyslot"}, 131 {21, nullptr, "AllocateAesKeyslot"},
132 {22, nullptr, "DeallocateAesKeySlot"}, 132 {22, nullptr, "DeallocateAesKeySlot"},
133 {23, nullptr, "GetAesKeyslotAvailableEvent"}, 133 {23, nullptr, "GetAesKeyslotAvailableEvent"},
134 {24, nullptr, "SetBootReason"}, 134 {24, &SPL::SetBootReason, "SetBootReason"},
135 {25, nullptr, "GetBootReason"}, 135 {25, &SPL::GetBootReason, "GetBootReason"},
136 {28, nullptr, "DecryptAndStoreDrmDeviceCertKey"}, 136 {28, nullptr, "DecryptAndStoreDrmDeviceCertKey"},
137 {29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"}, 137 {29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"},
138 {31, nullptr, "PrepareEsArchiveKey"}, 138 {31, nullptr, "PrepareEsArchiveKey"},
@@ -147,14 +147,14 @@ SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr<Module> module_)
147 : Interface(system_, std::move(module_), "spl:manu") { 147 : Interface(system_, std::move(module_), "spl:manu") {
148 // clang-format off 148 // clang-format off
149 static const FunctionInfo functions[] = { 149 static const FunctionInfo functions[] = {
150 {0, nullptr, "GetConfig"}, 150 {0, &SPL::GetConfig, "GetConfig"},
151 {1, nullptr, "ModularExponentiate"}, 151 {1, &SPL::ModularExponentiate, "ModularExponentiate"},
152 {2, nullptr, "GenerateAesKek"}, 152 {2, nullptr, "GenerateAesKek"},
153 {3, nullptr, "LoadAesKey"}, 153 {3, nullptr, "LoadAesKey"},
154 {4, nullptr, "GenerateAesKey"}, 154 {4, nullptr, "GenerateAesKey"},
155 {5, nullptr, "SetConfig"}, 155 {5, &SPL::SetConfig, "SetConfig"},
156 {7, &SPL::GetRandomBytes, "GetRandomBytes"}, 156 {7, &SPL::GenerateRandomBytes, "GenerateRandomBytes"},
157 {11, nullptr, "IsDevelopment"}, 157 {11, &SPL::IsDevelopment, "IsDevelopment"},
158 {13, nullptr, "DecryptDeviceUniqueData"}, 158 {13, nullptr, "DecryptDeviceUniqueData"},
159 {14, nullptr, "DecryptAesKey"}, 159 {14, nullptr, "DecryptAesKey"},
160 {15, nullptr, "CryptAesCtr"}, 160 {15, nullptr, "CryptAesCtr"},
@@ -162,8 +162,8 @@ SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr<Module> module_)
162 {21, nullptr, "AllocateAesKeyslot"}, 162 {21, nullptr, "AllocateAesKeyslot"},
163 {22, nullptr, "DeallocateAesKeySlot"}, 163 {22, nullptr, "DeallocateAesKeySlot"},
164 {23, nullptr, "GetAesKeyslotAvailableEvent"}, 164 {23, nullptr, "GetAesKeyslotAvailableEvent"},
165 {24, nullptr, "SetBootReason"}, 165 {24, &SPL::SetBootReason, "SetBootReason"},
166 {25, nullptr, "GetBootReason"}, 166 {25, &SPL::GetBootReason, "GetBootReason"},
167 {30, nullptr, "ReencryptDeviceUniqueData"}, 167 {30, nullptr, "ReencryptDeviceUniqueData"},
168 }; 168 };
169 // clang-format on 169 // clang-format on