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.
This commit is contained in:
devgianlu 2024-11-24 19:18:18 +01:00 committed by Andreas Kling
parent 07ced0cb34
commit e42410a7a7
Notes: github-actions[bot] 2024-11-25 13:12:30 +00:00
3 changed files with 20 additions and 18 deletions

View file

@ -300,24 +300,6 @@ private:
Optional<bool> m_is_self_signed;
};
class DefaultRootCACertificates {
public:
DefaultRootCACertificates();
Vector<Certificate> const& certificates() const { return m_ca_certificates; }
static ErrorOr<Vector<Certificate>> parse_pem_root_certificate_authorities(ByteBuffer&);
static ErrorOr<Vector<Certificate>> load_certificates(Span<ByteString> custom_cert_paths = {});
static DefaultRootCACertificates& the();
static void set_default_certificate_paths(Span<ByteString> paths);
private:
Vector<Certificate> m_ca_certificates;
};
}
using TLS::Certificate;
using TLS::DefaultRootCACertificates;

View file

@ -549,4 +549,23 @@ private:
RefPtr<Core::Timer> m_handshake_timeout_timer;
};
class DefaultRootCACertificates {
public:
DefaultRootCACertificates();
Vector<Certificate> const& certificates() const { return m_ca_certificates; }
static ErrorOr<Vector<Certificate>> parse_pem_root_certificate_authorities(ByteBuffer&);
static ErrorOr<Vector<Certificate>> load_certificates(Span<ByteString> custom_cert_paths = {});
static DefaultRootCACertificates& the();
static void set_default_certificate_paths(Span<ByteString> paths);
private:
Vector<Certificate> m_ca_certificates;
};
}
using TLS::DefaultRootCACertificates;

View file

@ -16,6 +16,7 @@
#include <LibIPC/SingleServer.h>
#include <LibMain/Main.h>
#include <LibTLS/Certificate.h>
#include <LibTLS/TLSv12.h>
#include <RequestServer/ConnectionFromClient.h>
#if defined(AK_OS_MACOS)