From e42410a7a7e444966a3491382e077feff174a7a5 Mon Sep 17 00:00:00 2001 From: devgianlu Date: Sun, 24 Nov 2024 19:18:18 +0100 Subject: [PATCH] LibTLS: Move `DefaultRootCACertificates` to correct header file The declaration of `DefaultRootCACertificates` was in `Certificate.h` and its implementation in `TLSv12.cpp`. It has been moved over to `TLSv12.h` for consistency. This is in preparation of the next commits to split the changes. --- Libraries/LibTLS/Certificate.h | 18 ------------------ Libraries/LibTLS/TLSv12.h | 19 +++++++++++++++++++ Services/RequestServer/main.cpp | 1 + 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Libraries/LibTLS/Certificate.h b/Libraries/LibTLS/Certificate.h index a05c76b4c18..fc96e1d6844 100644 --- a/Libraries/LibTLS/Certificate.h +++ b/Libraries/LibTLS/Certificate.h @@ -300,24 +300,6 @@ private: Optional m_is_self_signed; }; -class DefaultRootCACertificates { -public: - DefaultRootCACertificates(); - - Vector const& certificates() const { return m_ca_certificates; } - - static ErrorOr> parse_pem_root_certificate_authorities(ByteBuffer&); - static ErrorOr> load_certificates(Span custom_cert_paths = {}); - - static DefaultRootCACertificates& the(); - - static void set_default_certificate_paths(Span paths); - -private: - Vector m_ca_certificates; -}; - } using TLS::Certificate; -using TLS::DefaultRootCACertificates; diff --git a/Libraries/LibTLS/TLSv12.h b/Libraries/LibTLS/TLSv12.h index 02b25fd004e..efc09c45637 100644 --- a/Libraries/LibTLS/TLSv12.h +++ b/Libraries/LibTLS/TLSv12.h @@ -549,4 +549,23 @@ private: RefPtr m_handshake_timeout_timer; }; +class DefaultRootCACertificates { +public: + DefaultRootCACertificates(); + + Vector const& certificates() const { return m_ca_certificates; } + + static ErrorOr> parse_pem_root_certificate_authorities(ByteBuffer&); + static ErrorOr> load_certificates(Span custom_cert_paths = {}); + + static DefaultRootCACertificates& the(); + + static void set_default_certificate_paths(Span paths); + +private: + Vector m_ca_certificates; +}; + } + +using TLS::DefaultRootCACertificates; diff --git a/Services/RequestServer/main.cpp b/Services/RequestServer/main.cpp index 9d2cefdcc6c..1ada7318e3f 100644 --- a/Services/RequestServer/main.cpp +++ b/Services/RequestServer/main.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #if defined(AK_OS_MACOS)