#include "content/browser/web_package/signed_exchange_certificate_chain.h"
#include <string_view>
#include "base/command_line.h"
#include "base/format_macros.h"
#include "base/memory/ptr_util.h"
#include "base/no_destructor.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
#include "components/cbor/reader.h"
#include "content/browser/web_package/signed_exchange_consts.h"
#include "content/browser/web_package/signed_exchange_utils.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/common/content_client.h"
#include "crypto/sha2.h"
#include "net/cert/asn1_util.h"
#include "net/cert/x509_certificate.h"
#include "net/cert/x509_util.h"
#include "services/network/public/cpp/network_switches.h"
namespace content {
namespace {
std::unique_ptr<SignedExchangeCertificateChain> ParseCertChain(
base::span<const uint8_t> message,
SignedExchangeDevToolsProxy* devtools_proxy) { … }
}
std::unique_ptr<SignedExchangeCertificateChain>
SignedExchangeCertificateChain::Parse(
base::span<const uint8_t> cert_response_body,
SignedExchangeDevToolsProxy* devtools_proxy) { … }
SignedExchangeCertificateChain::SignedExchangeCertificateChain(
scoped_refptr<net::X509Certificate> cert,
const std::string& ocsp,
const std::string& sct)
: … { … }
SignedExchangeCertificateChain::~SignedExchangeCertificateChain() = default;
bool SignedExchangeCertificateChain::ShouldIgnoreErrors() const { … }
std::unique_ptr<SignedExchangeCertificateChain::IgnoreErrorsSPKIList>&
SignedExchangeCertificateChain::IgnoreErrorsSPKIList::GetInstance() { … }
std::unique_ptr<SignedExchangeCertificateChain::IgnoreErrorsSPKIList>
SignedExchangeCertificateChain::IgnoreErrorsSPKIList::SetInstanceForTesting(
std::unique_ptr<IgnoreErrorsSPKIList> p) { … }
SignedExchangeCertificateChain::IgnoreErrorsSPKIList::IgnoreErrorsSPKIList(
const std::string& spki_list) { … }
SignedExchangeCertificateChain::IgnoreErrorsSPKIList::IgnoreErrorsSPKIList(
const base::CommandLine& command_line) { … }
void SignedExchangeCertificateChain::IgnoreErrorsSPKIList::Parse(
const std::string& spki_list) { … }
SignedExchangeCertificateChain::IgnoreErrorsSPKIList::~IgnoreErrorsSPKIList() =
default;
bool SignedExchangeCertificateChain::IgnoreErrorsSPKIList::ShouldIgnoreErrors(
scoped_refptr<net::X509Certificate> certificate) { … }
bool SignedExchangeCertificateChain::IgnoreErrorsSPKIList::
ShouldIgnoreErrorsInternal(
scoped_refptr<net::X509Certificate> certificate) { … }
}