diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/ssl/ssl.cpp | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index dc2baca4a..2c8899ae0 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp | |||
| @@ -10,6 +10,11 @@ | |||
| 10 | 10 | ||
| 11 | namespace Service::SSL { | 11 | namespace Service::SSL { |
| 12 | 12 | ||
| 13 | enum class CertificateFormat : u32 { | ||
| 14 | Pem = 1, | ||
| 15 | Der = 2, | ||
| 16 | }; | ||
| 17 | |||
| 13 | class ISslConnection final : public ServiceFramework<ISslConnection> { | 18 | class ISslConnection final : public ServiceFramework<ISslConnection> { |
| 14 | public: | 19 | public: |
| 15 | explicit ISslConnection(Core::System& system_) : ServiceFramework{system_, "ISslConnection"} { | 20 | explicit ISslConnection(Core::System& system_) : ServiceFramework{system_, "ISslConnection"} { |
| @@ -58,8 +63,8 @@ public: | |||
| 58 | {1, nullptr, "GetOption"}, | 63 | {1, nullptr, "GetOption"}, |
| 59 | {2, &ISslContext::CreateConnection, "CreateConnection"}, | 64 | {2, &ISslContext::CreateConnection, "CreateConnection"}, |
| 60 | {3, nullptr, "GetConnectionCount"}, | 65 | {3, nullptr, "GetConnectionCount"}, |
| 61 | {4, nullptr, "ImportServerPki"}, | 66 | {4, &ISslContext::ImportServerPki, "ImportServerPki"}, |
| 62 | {5, nullptr, "ImportClientPki"}, | 67 | {5, &ISslContext::ImportClientPki, "ImportClientPki"}, |
| 63 | {6, nullptr, "RemoveServerPki"}, | 68 | {6, nullptr, "RemoveServerPki"}, |
| 64 | {7, nullptr, "RemoveClientPki"}, | 69 | {7, nullptr, "RemoveClientPki"}, |
| 65 | {8, nullptr, "RegisterInternalPki"}, | 70 | {8, nullptr, "RegisterInternalPki"}, |
| @@ -94,6 +99,39 @@ private: | |||
| 94 | rb.Push(RESULT_SUCCESS); | 99 | rb.Push(RESULT_SUCCESS); |
| 95 | rb.PushIpcInterface<ISslConnection>(system); | 100 | rb.PushIpcInterface<ISslConnection>(system); |
| 96 | } | 101 | } |
| 102 | |||
| 103 | void ImportServerPki(Kernel::HLERequestContext& ctx) { | ||
| 104 | IPC::RequestParser rp{ctx}; | ||
| 105 | const auto certificate_format = rp.PopEnum<CertificateFormat>(); | ||
| 106 | const auto pkcs_12_certificates = ctx.ReadBuffer(0); | ||
| 107 | |||
| 108 | constexpr u64 server_id = 0; | ||
| 109 | |||
| 110 | LOG_WARNING(Service_SSL, "(STUBBED) called, certificate_format={}", certificate_format); | ||
| 111 | |||
| 112 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 113 | rb.Push(RESULT_SUCCESS); | ||
| 114 | rb.Push(server_id); | ||
| 115 | } | ||
| 116 | |||
| 117 | void ImportClientPki(Kernel::HLERequestContext& ctx) { | ||
| 118 | const auto pkcs_12_certificate = ctx.ReadBuffer(0); | ||
| 119 | const auto ascii_password = [&ctx] { | ||
| 120 | if (ctx.CanReadBuffer(1)) { | ||
| 121 | return ctx.ReadBuffer(1); | ||
| 122 | } | ||
| 123 | |||
| 124 | return std::vector<u8>{}; | ||
| 125 | }(); | ||
| 126 | |||
| 127 | constexpr u64 client_id = 0; | ||
| 128 | |||
| 129 | LOG_WARNING(Service_SSL, "(STUBBED) called"); | ||
| 130 | |||
| 131 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 132 | rb.Push(RESULT_SUCCESS); | ||
| 133 | rb.Push(client_id); | ||
| 134 | } | ||
| 97 | }; | 135 | }; |
| 98 | 136 | ||
| 99 | class SSL final : public ServiceFramework<SSL> { | 137 | class SSL final : public ServiceFramework<SSL> { |