#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/component_updater/installer_policies/trust_token_key_commitments_component_installer_policy.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/path_service.h"
#include "base/task/thread_pool.h"
#include "base/values.h"
#include "base/version.h"
#include "components/component_updater/component_updater_paths.h"
#include "components/component_updater/component_updater_switches.h"
ComponentUpdateService;
namespace {
const uint8_t kTrustTokenKeyCommitmentsPublicKeySHA256[32] = …;
const char kTrustTokenKeyCommitmentsManifestName[] = …;
std::optional<std::string> LoadKeyCommitmentsFromDisk(
const base::FilePath& path) { … }
}
namespace component_updater {
TrustTokenKeyCommitmentsComponentInstallerPolicy::
TrustTokenKeyCommitmentsComponentInstallerPolicy(
base::RepeatingCallback<void(const std::string&)> on_commitments_ready)
: … { … }
TrustTokenKeyCommitmentsComponentInstallerPolicy::
~TrustTokenKeyCommitmentsComponentInstallerPolicy() = default;
bool TrustTokenKeyCommitmentsComponentInstallerPolicy::
SupportsGroupPolicyEnabledComponentUpdates() const { … }
bool TrustTokenKeyCommitmentsComponentInstallerPolicy::
RequiresNetworkEncryption() const { … }
update_client::CrxInstaller::Result
TrustTokenKeyCommitmentsComponentInstallerPolicy::OnCustomInstall(
const base::Value::Dict& manifest,
const base::FilePath& install_dir) { … }
void TrustTokenKeyCommitmentsComponentInstallerPolicy::OnCustomUninstall() { … }
base::FilePath
TrustTokenKeyCommitmentsComponentInstallerPolicy::GetInstalledPath(
const base::FilePath& base) { … }
void TrustTokenKeyCommitmentsComponentInstallerPolicy::ComponentReady(
const base::Version& version,
const base::FilePath& install_dir,
base::Value::Dict manifest) { … }
bool TrustTokenKeyCommitmentsComponentInstallerPolicy::VerifyInstallation(
const base::Value::Dict& manifest,
const base::FilePath& install_dir) const { … }
base::FilePath
TrustTokenKeyCommitmentsComponentInstallerPolicy::GetRelativeInstallDir()
const { … }
void TrustTokenKeyCommitmentsComponentInstallerPolicy::GetHash(
std::vector<uint8_t>* hash) const { … }
std::string TrustTokenKeyCommitmentsComponentInstallerPolicy::GetName() const { … }
update_client::InstallerAttributes
TrustTokenKeyCommitmentsComponentInstallerPolicy::GetInstallerAttributes()
const { … }
void TrustTokenKeyCommitmentsComponentInstallerPolicy::GetPublicKeyHash(
std::vector<uint8_t>* hash) { … }
void TrustTokenKeyCommitmentsComponentInstallerPolicy::
LoadTrustTokensFromString(
base::OnceCallback<std::optional<std::string>()> load_keys_from_disk,
base::OnceCallback<void(const std::string&)> on_commitments_ready) { … }
}