From fe5a3d22c52aedc1191fbec9f504fc8203100b26 Mon Sep 17 00:00:00 2001 From: B3n30 Date: Sat, 21 Jul 2018 19:00:50 -0500 Subject: [PATCH] Services/HTTP: Added structures to store both client and server certificates. --- src/core/hle/service/http_c.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/core/hle/service/http_c.cpp b/src/core/hle/service/http_c.cpp index 72c48a8d3..5a700f3fb 100644 --- a/src/core/hle/service/http_c.cpp +++ b/src/core/hle/service/http_c.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/ipc.h" #include "core/hle/service/http_c.h" @@ -9,6 +10,28 @@ namespace Service { namespace HTTP { +/// Represents a client certificate along with its private key, stored as a byte array of DER data. +/// There can only be at most one client certificate context attached to an HTTP context at any +/// given time. +struct ClientCertContext { + u32 handle; + std::vector certificate; + std::vector private_key; +}; + +/// Represents a root certificate chain, it contains a list of DER-encoded certificates for +/// verifying HTTP requests. An HTTP context can have at most one root certificate chain attached to +/// it, but the chain may contain an arbitrary number of certificates in it. +struct RootCertChain { + struct RootCACert { + u32 handle; + std::vector certificate; + }; + + u32 handle; + std::vector certificates; +}; + void HTTP_C::Initialize(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x1, 1, 4); const u32 shmem_size = rp.Pop();