diff options
author | mailwl <mailwl@gmail.com> | 2018-04-10 20:40:53 +0200 |
---|---|---|
committer | mailwl <mailwl@gmail.com> | 2018-04-11 18:17:18 +0200 |
commit | 39f75350bbb43ddf999ce8c71cab7030488b5084 (patch) | |
tree | bc8c16ab5d5891314f589d04e984dec198c15226 /src/core/hle/service/ssl | |
parent | Merge pull request #318 from mailwl/account (diff) | |
download | yuzu-39f75350bbb43ddf999ce8c71cab7030488b5084.tar yuzu-39f75350bbb43ddf999ce8c71cab7030488b5084.tar.gz yuzu-39f75350bbb43ddf999ce8c71cab7030488b5084.tar.bz2 yuzu-39f75350bbb43ddf999ce8c71cab7030488b5084.tar.lz yuzu-39f75350bbb43ddf999ce8c71cab7030488b5084.tar.xz yuzu-39f75350bbb43ddf999ce8c71cab7030488b5084.tar.zst yuzu-39f75350bbb43ddf999ce8c71cab7030488b5084.zip |
Diffstat (limited to 'src/core/hle/service/ssl')
-rw-r--r-- | src/core/hle/service/ssl/ssl.cpp | 96 | ||||
-rw-r--r-- | src/core/hle/service/ssl/ssl.h | 3 |
2 files changed, 98 insertions, 1 deletions
diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index afa8d5d79..01a03ec83 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp @@ -2,12 +2,106 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/ipc_helpers.h" #include "core/hle/service/ssl/ssl.h" namespace Service { namespace SSL { -SSL::SSL() : ServiceFramework("ssl") {} +class ISslConnection final : public ServiceFramework<ISslConnection> { +public: + ISslConnection() : ServiceFramework("ISslConnection") { + static const FunctionInfo functions[] = { + {0, nullptr, "SetSocketDescriptor"}, + {1, nullptr, "SetHostName"}, + {2, nullptr, "SetVerifyOption"}, + {3, nullptr, "SetIoMode"}, + {4, nullptr, "GetSocketDescriptor"}, + {5, nullptr, "GetHostName"}, + {6, nullptr, "GetVerifyOption"}, + {7, nullptr, "GetIoMode"}, + {8, nullptr, "DoHandshake"}, + {9, nullptr, "DoHandshakeGetServerCert"}, + {10, nullptr, "Read"}, + {11, nullptr, "Write"}, + {12, nullptr, "Pending"}, + {13, nullptr, "Peek"}, + {14, nullptr, "Poll"}, + {15, nullptr, "GetVerifyCertError"}, + {16, nullptr, "GetNeededServerCertBufferSize"}, + {17, nullptr, "SetSessionCacheMode"}, + {18, nullptr, "GetSessionCacheMode"}, + {19, nullptr, "FlushSessionCache"}, + {20, nullptr, "SetRenegotiationMode"}, + {21, nullptr, "GetRenegotiationMode"}, + {22, nullptr, "SetOption"}, + {23, nullptr, "GetOption"}, + {24, nullptr, "GetVerifyCertErrors"}, + {25, nullptr, "GetCipherInfo"}, + }; + RegisterHandlers(functions); + } +}; + +class ISslContext final : public ServiceFramework<ISslContext> { +public: + ISslContext() : ServiceFramework("ISslContext") { + static const FunctionInfo functions[] = { + {0, &ISslContext::SetOption, "SetOption"}, + {1, nullptr, "GetOption"}, + {2, &ISslContext::CreateConnection, "CreateConnection"}, + {3, nullptr, "GetConnectionCount"}, + {4, nullptr, "ImportServerPki"}, + {5, nullptr, "ImportClientPki"}, + {6, nullptr, "RemoveServerPki"}, + {7, nullptr, "RemoveClientPki"}, + {8, nullptr, "RegisterInternalPki"}, + {9, nullptr, "AddPolicyOid"}, + {10, nullptr, "ImportCrl"}, + {11, nullptr, "RemoveCrl"}, + }; + RegisterHandlers(functions); + } + ~ISslContext() = default; + +private: + void SetOption(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_SSL, "(STUBBED) called"); + IPC::RequestParser rp{ctx}; + + IPC::ResponseBuilder rb = rp.MakeBuilder(2, 0, 0); + rb.Push(RESULT_SUCCESS); + } + + void CreateConnection(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_SSL, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface<ISslConnection>(); + } +}; + +void SSL::CreateContext(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_SSL, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface<ISslContext>(); +} + +SSL::SSL() : ServiceFramework("ssl") { + static const FunctionInfo functions[] = { + {0, &SSL::CreateContext, "CreateContext"}, + {1, nullptr, "GetContextCount"}, + {2, nullptr, "GetCertificates"}, + {3, nullptr, "GetCertificateBufSize"}, + {4, nullptr, "DebugIoctl"}, + {5, nullptr, "SetInterfaceVersion"}, + {6, nullptr, "FlushSessionCache"}, + }; + RegisterHandlers(functions); +} void InstallInterfaces(SM::ServiceManager& service_manager) { std::make_shared<SSL>()->InstallAsService(service_manager); diff --git a/src/core/hle/service/ssl/ssl.h b/src/core/hle/service/ssl/ssl.h index 645dad003..7fcff5ccd 100644 --- a/src/core/hle/service/ssl/ssl.h +++ b/src/core/hle/service/ssl/ssl.h @@ -13,6 +13,9 @@ class SSL final : public ServiceFramework<SSL> { public: explicit SSL(); ~SSL() = default; + +private: + void CreateContext(Kernel::HLERequestContext& ctx); }; /// Registers all SSL services with the specified service manager. |