#include "net/cert/internal/trust_store_chrome.h"
#include <optional>
#include "base/command_line.h"
#include "base/containers/span.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "crypto/sha2.h"
#include "net/cert/root_store_proto_lite/root_store.pb.h"
#include "net/cert/x509_certificate.h"
#include "net/cert/x509_util.h"
#include "third_party/boringssl/src/include/openssl/pool.h"
#include "third_party/boringssl/src/pki/cert_errors.h"
#include "third_party/boringssl/src/pki/parsed_certificate.h"
namespace net {
namespace {
#include "net/data/ssl/chrome_root_store/chrome-root-store-inc.cc"
}
ChromeRootCertConstraints::ChromeRootCertConstraints() = default;
ChromeRootCertConstraints::ChromeRootCertConstraints(
std::optional<base::Time> sct_not_after,
std::optional<base::Time> sct_all_after,
std::optional<base::Version> min_version,
std::optional<base::Version> max_version_exclusive)
: … { … }
ChromeRootCertConstraints::ChromeRootCertConstraints(
const StaticChromeRootCertConstraints& constraints)
: … { … }
ChromeRootCertConstraints::~ChromeRootCertConstraints() = default;
ChromeRootCertConstraints::ChromeRootCertConstraints(
const ChromeRootCertConstraints& other) = default;
ChromeRootCertConstraints::ChromeRootCertConstraints(
ChromeRootCertConstraints&& other) = default;
ChromeRootCertConstraints& ChromeRootCertConstraints::operator=(
const ChromeRootCertConstraints& other) = default;
ChromeRootCertConstraints& ChromeRootCertConstraints::operator=(
ChromeRootCertConstraints&& other) = default;
ChromeRootStoreData::Anchor::Anchor(
std::shared_ptr<const bssl::ParsedCertificate> certificate,
std::vector<ChromeRootCertConstraints> constraints)
: … { … }
ChromeRootStoreData::Anchor::~Anchor() = default;
ChromeRootStoreData::Anchor::Anchor(const Anchor& other) = default;
ChromeRootStoreData::Anchor::Anchor(Anchor&& other) = default;
ChromeRootStoreData::Anchor& ChromeRootStoreData::Anchor::operator=(
const ChromeRootStoreData::Anchor& other) = default;
ChromeRootStoreData::Anchor& ChromeRootStoreData::Anchor::operator=(
ChromeRootStoreData::Anchor&& other) = default;
ChromeRootStoreData::ChromeRootStoreData() = default;
ChromeRootStoreData::~ChromeRootStoreData() = default;
ChromeRootStoreData::ChromeRootStoreData(const ChromeRootStoreData& other) =
default;
ChromeRootStoreData::ChromeRootStoreData(ChromeRootStoreData&& other) = default;
ChromeRootStoreData& ChromeRootStoreData::operator=(
const ChromeRootStoreData& other) = default;
ChromeRootStoreData& ChromeRootStoreData::operator=(
ChromeRootStoreData&& other) = default;
std::optional<ChromeRootStoreData>
ChromeRootStoreData::CreateChromeRootStoreData(
const chrome_root_store::RootStore& proto) { … }
TrustStoreChrome::TrustStoreChrome()
: … { … }
TrustStoreChrome::TrustStoreChrome(base::span<const ChromeRootCertInfo> certs,
bool certs_are_static,
int64_t version,
ConstraintOverrideMap override_constraints)
: … { … }
TrustStoreChrome::TrustStoreChrome(const ChromeRootStoreData& root_store_data)
: … { … }
TrustStoreChrome::~TrustStoreChrome() = default;
TrustStoreChrome::ConstraintOverrideMap
TrustStoreChrome::InitializeConstraintsOverrides() { … }
TrustStoreChrome::ConstraintOverrideMap
TrustStoreChrome::ParseCrsConstraintsSwitch(std::string_view switch_value) { … }
void TrustStoreChrome::SyncGetIssuersOf(const bssl::ParsedCertificate* cert,
bssl::ParsedCertificateList* issuers) { … }
bssl::CertificateTrust TrustStoreChrome::GetTrust(
const bssl::ParsedCertificate* cert) { … }
bool TrustStoreChrome::Contains(const bssl::ParsedCertificate* cert) const { … }
base::span<const ChromeRootCertConstraints>
TrustStoreChrome::GetConstraintsForCert(
const bssl::ParsedCertificate* cert) const { … }
std::unique_ptr<TrustStoreChrome> TrustStoreChrome::CreateTrustStoreForTesting(
base::span<const ChromeRootCertInfo> certs,
int64_t version,
ConstraintOverrideMap override_constraints) { … }
int64_t CompiledChromeRootStoreVersion() { … }
std::vector<ChromeRootStoreData::Anchor> CompiledChromeRootStoreAnchors() { … }
}