diff options
author | bunnei <bunneidev@gmail.com> | 2021-05-13 07:11:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-13 07:11:19 +0200 |
commit | e12ee020e796ad7b7b9d1c82a55d2c1f3a88a5a9 (patch) | |
tree | d9cfe37eec44983bdf0afd4be33501a7bae8fb11 /src/core/hle/service | |
parent | Merge pull request #6298 from Kewlan/toggled-show-add-on-refresh (diff) | |
parent | ssl: Stub Import(Client/Server)Pki (diff) | |
download | yuzu-e12ee020e796ad7b7b9d1c82a55d2c1f3a88a5a9.tar yuzu-e12ee020e796ad7b7b9d1c82a55d2c1f3a88a5a9.tar.gz yuzu-e12ee020e796ad7b7b9d1c82a55d2c1f3a88a5a9.tar.bz2 yuzu-e12ee020e796ad7b7b9d1c82a55d2c1f3a88a5a9.tar.lz yuzu-e12ee020e796ad7b7b9d1c82a55d2c1f3a88a5a9.tar.xz yuzu-e12ee020e796ad7b7b9d1c82a55d2c1f3a88a5a9.tar.zst yuzu-e12ee020e796ad7b7b9d1c82a55d2c1f3a88a5a9.zip |
Diffstat (limited to 'src/core/hle/service')
-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 @@ namespace Service::SSL { +enum class CertificateFormat : u32 { + Pem = 1, + Der = 2, +}; + class ISslConnection final : public ServiceFramework<ISslConnection> { public: explicit ISslConnection(Core::System& system_) : ServiceFramework{system_, "ISslConnection"} { @@ -58,8 +63,8 @@ public: {1, nullptr, "GetOption"}, {2, &ISslContext::CreateConnection, "CreateConnection"}, {3, nullptr, "GetConnectionCount"}, - {4, nullptr, "ImportServerPki"}, - {5, nullptr, "ImportClientPki"}, + {4, &ISslContext::ImportServerPki, "ImportServerPki"}, + {5, &ISslContext::ImportClientPki, "ImportClientPki"}, {6, nullptr, "RemoveServerPki"}, {7, nullptr, "RemoveClientPki"}, {8, nullptr, "RegisterInternalPki"}, @@ -94,6 +99,39 @@ private: rb.Push(RESULT_SUCCESS); rb.PushIpcInterface<ISslConnection>(system); } + + void ImportServerPki(Kernel::HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto certificate_format = rp.PopEnum<CertificateFormat>(); + const auto pkcs_12_certificates = ctx.ReadBuffer(0); + + constexpr u64 server_id = 0; + + LOG_WARNING(Service_SSL, "(STUBBED) called, certificate_format={}", certificate_format); + + IPC::ResponseBuilder rb{ctx, 4}; + rb.Push(RESULT_SUCCESS); + rb.Push(server_id); + } + + void ImportClientPki(Kernel::HLERequestContext& ctx) { + const auto pkcs_12_certificate = ctx.ReadBuffer(0); + const auto ascii_password = [&ctx] { + if (ctx.CanReadBuffer(1)) { + return ctx.ReadBuffer(1); + } + + return std::vector<u8>{}; + }(); + + constexpr u64 client_id = 0; + + LOG_WARNING(Service_SSL, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + rb.Push(client_id); + } }; class SSL final : public ServiceFramework<SSL> { |