Android fonts fingerprinting mitigation (#1830)

Android fonts fingerprinting mitigation
This commit is contained in:
uazo
2025-02-18 19:50:26 -12:00
committed by GitHub
11 changed files with 3596 additions and 151 deletions
+2 -2
View File
@@ -24,7 +24,6 @@ Restore-classic-new-tab-page.patch
Always-use-new-tab-page-for-default-home-page.patch
disable-battery-status-updater.patch
Battery-API-return-nothing.patch
updater-disable-updater-pings.patch
Disable-omission-of-URL-elements.patch
Modify-default-preferences.patch
Do-not-store-passwords-by-default.patch
@@ -183,7 +182,6 @@ WIN-Add-some-prefs-to-secure-preferences.patch
WIN-Disable-search-for-image.patch
AudioBuffer-AnalyserNode-fp-mitigations.patch
Disable-Component-Updates.patch
add-browser-policy.patch
Always-open-browser-controls-in-new-tab.patch
Partitioning-all-cookies-by-top-frame-domain.patch
@@ -304,6 +302,8 @@ Never-treat-Proguard-warnings-as-errors.patch
Temp-disable-experimental-web-platform-features.patch
Block-leakage-of-urls-in-sandbox-iframes.patch
Fix-chromium-build-bugs.patch
Enable-component-updater.patch
Android-fonts-fingerprinting-mitigation.patch
# adblock patches
eyeo-beta-118.0.5993.48-base.patch
+28 -1
View File
@@ -25,6 +25,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
.../privacy/settings/PrivacySettings.java | 2 +-
.../settings/FragmentDependencyProvider.java | 10 +-
.../browser/settings/SettingsActivity.java | 42 ++++-
.../tracing/settings/DeveloperSettings.java | 5 +-
chrome/browser/about_flags.cc | 11 ++
chrome/browser/browser_features.cc | 1 +
chrome/browser/browser_features.h | 1 +
@@ -105,7 +106,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
third_party/blink/public/common/features.h | 1 +
ui/base/ui_base_features.cc | 1 +
ui/base/ui_base_features.h | 1 +
92 files changed, 805 insertions(+), 28 deletions(-)
93 files changed, 808 insertions(+), 30 deletions(-)
create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/include_all_directory.java
create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/java_template/CromiteCachedFlag.java.tmpl
create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-cromite-flags-support.grdp
@@ -602,6 +603,32 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin
true /* recursive */);
fragmentManager.registerFragmentLifecycleCallbacks(
new WideDisplayPaddingApplier(), false /* recursive */);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tracing/settings/DeveloperSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/tracing/settings/DeveloperSettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/tracing/settings/DeveloperSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tracing/settings/DeveloperSettings.java
@@ -17,11 +17,12 @@ import org.chromium.base.version_info.VersionInfo;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
import org.chromium.chrome.browser.preferences.ChromeSharedPreferences;
+import org.chromium.chrome.browser.settings.ChromeBaseSettingsFragment;
import org.chromium.components.browser_ui.settings.EmbeddableSettingsPage;
import org.chromium.components.browser_ui.settings.SettingsUtils;
/** Settings fragment containing preferences aimed at Chrome and web developers. */
-public class DeveloperSettings extends PreferenceFragmentCompat implements EmbeddableSettingsPage {
+public class DeveloperSettings extends ChromeBaseSettingsFragment implements EmbeddableSettingsPage {
private static final String UI_PREF_BETA_STABLE_HINT = "beta_stable_hint";
// Non-translated strings:
@@ -52,7 +53,7 @@ public class DeveloperSettings extends PreferenceFragmentCompat implements Embed
}
@Override
- public void onCreatePreferences(Bundle savedInstanceState, String s) {
+ public void onCreatePreferencesCromite(Bundle savedInstanceState, String s) {
SettingsUtils.addPreferencesFromResource(this, R.xml.developer_preferences);
if (VersionInfo.isBetaBuild() || VersionInfo.isStableBuild()) {
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
File diff suppressed because it is too large Load Diff
@@ -1,53 +0,0 @@
From: uazo <uazo@users.noreply.github.com>
Date: Tue, 8 Nov 2022 12:41:22 +0000
Subject: Disable Component Updates
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
chrome/browser/component_updater/registration.cc | 1 +
components/component_updater/component_installer.cc | 1 +
components/component_updater/component_updater_service.cc | 8 +-------
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/chrome/browser/component_updater/registration.cc b/chrome/browser/component_updater/registration.cc
--- a/chrome/browser/component_updater/registration.cc
+++ b/chrome/browser/component_updater/registration.cc
@@ -113,6 +113,7 @@
namespace component_updater {
void RegisterComponentsForUpdate() {
+ if ((true)) return;
auto* const cus = g_browser_process->component_updater();
#if BUILDFLAG(IS_WIN)
diff --git a/components/component_updater/component_installer.cc b/components/component_updater/component_installer.cc
--- a/components/component_updater/component_installer.cc
+++ b/components/component_updater/component_installer.cc
@@ -123,6 +123,7 @@ void ComponentInstaller::Register(
base::OnceClosure callback,
const base::Version& registered_version,
const base::Version& max_previous_product_version) {
+ if ((true)) return;
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!installer_policy_) {
diff --git a/components/component_updater/component_updater_service.cc b/components/component_updater/component_updater_service.cc
--- a/components/component_updater/component_updater_service.cc
+++ b/components/component_updater/component_updater_service.cc
@@ -542,14 +542,8 @@ std::unique_ptr<ComponentUpdateService> ComponentUpdateServiceFactory(
// Register prefs required by the component update service.
void RegisterComponentUpdateServicePrefs(PrefRegistrySimple* registry) {
- // If the preference is not set the component updates are enabled by default
- // unless in Chrome for Testing where we never want components to be updated
- // automatically.
- constexpr bool kComponentUpdatesEnabledByDefault =
- !BUILDFLAG(CHROME_FOR_TESTING);
-
registry->RegisterBooleanPref(prefs::kComponentUpdatesEnabled,
- kComponentUpdatesEnabledByDefault);
+ false);
}
} // namespace component_updater
--
@@ -0,0 +1,536 @@
From: uazo <uazo@users.noreply.github.com>
Date: Wed, 29 Jan 2025 12:50:13 +0000
Subject: Enable component updater
Activates component updaters in one-shot mode: downloading occurs
only once and updates are inhibited.
Only cromite-specific components can be enabled.
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
.../browser/component_updater/registration.cc | 2 +
.../component_updater/component_installer.cc | 48 +++++++++++--------
.../component_updater/component_installer.h | 4 +-
.../component_updater_url_constants.cc | 4 +-
.../component_updater/configurator_impl.cc | 8 +---
.../component_updater/configurator_impl.h | 2 -
components/crx_file/crx_build_action_main.cc | 11 +++--
components/crx_file/crx_verifier.cc | 16 +++++++
components/update_client/component.cc | 12 +++++
components/update_client/crx_downloader.cc | 5 ++
components/update_client/net/network_impl.cc | 2 +
.../update_client/protocol_parser_json.cc | 2 +
components/update_client/request_sender.cc | 3 +-
components/update_client/update_checker.cc | 6 ++-
components/update_client/update_engine.cc | 9 ++++
components/update_client/utils.cc | 3 ++
16 files changed, 100 insertions(+), 37 deletions(-)
diff --git a/chrome/browser/component_updater/registration.cc b/chrome/browser/component_updater/registration.cc
--- a/chrome/browser/component_updater/registration.cc
+++ b/chrome/browser/component_updater/registration.cc
@@ -115,6 +115,8 @@ namespace component_updater {
void RegisterComponentsForUpdate() {
auto* const cus = g_browser_process->component_updater();
+ if ((true)) return;
+
#if BUILDFLAG(IS_WIN)
RegisterRecoveryImprovedComponent(cus, g_browser_process->local_state());
#endif // BUILDFLAG(IS_WIN)
diff --git a/components/component_updater/component_installer.cc b/components/component_updater/component_installer.cc
--- a/components/component_updater/component_installer.cc
+++ b/components/component_updater/component_installer.cc
@@ -105,7 +105,9 @@ ComponentInstaller::ComponentInstaller(
ComponentInstaller::~ComponentInstaller() = default;
void ComponentInstaller::Register(ComponentUpdateService* cus,
- base::OnceClosure callback) {
+ base::OnceClosure callback,
+ bool allowed) {
+ if (!allowed) return;
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
CHECK(cus);
@@ -115,14 +117,16 @@ void ComponentInstaller::Register(ComponentUpdateService* cus,
Register(base::BindOnce(&ComponentUpdateService::RegisterComponent,
base::Unretained(cus)),
std::move(callback), cus->GetRegisteredVersion(crx_id),
- cus->GetMaxPreviousProductVersion(crx_id));
+ cus->GetMaxPreviousProductVersion(crx_id), allowed);
}
void ComponentInstaller::Register(
RegisterCallback register_callback,
base::OnceClosure callback,
const base::Version& registered_version,
- const base::Version& max_previous_product_version) {
+ const base::Version& max_previous_product_version,
+ bool allowed) {
+ if (!allowed) return;
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!installer_policy_) {
@@ -143,7 +147,7 @@ void ComponentInstaller::Register(
}
void ComponentInstaller::OnUpdateError(int error) {
- VLOG(0) << "Component update error: " << error;
+ LOG(INFO) << "Component update error: " << error;
}
Result ComponentInstaller::InstallHelper(const base::FilePath& unpack_path,
@@ -153,6 +157,7 @@ Result ComponentInstaller::InstallHelper(const base::FilePath& unpack_path,
std::optional<base::Value::Dict> local_manifest =
update_client::ReadManifest(unpack_path);
if (!local_manifest) {
+ LOG(ERROR) << "Bad manifest";
return Result(InstallError::BAD_MANIFEST);
}
@@ -163,7 +168,7 @@ Result ComponentInstaller::InstallHelper(const base::FilePath& unpack_path,
const base::Version manifest_version(*version_ascii);
- VLOG(1) << "Install: version=" << manifest_version.GetString()
+ LOG(INFO) << "Install: version=" << manifest_version.GetString()
<< " current version=" << current_version_.GetString();
if (!manifest_version.IsValid()) {
@@ -182,11 +187,11 @@ Result ComponentInstaller::InstallHelper(const base::FilePath& unpack_path,
}
}
- VLOG(1) << "unpack_path=" << unpack_path.AsUTF8Unsafe()
+ LOG(INFO) << "unpack_path=" << unpack_path.AsUTF8Unsafe()
<< " install_path=" << local_install_path.AsUTF8Unsafe();
if (!base::Move(unpack_path, local_install_path)) {
- VPLOG(0) << "Move failed.";
+ LOG(INFO) << "Move failed.";
base::DeletePathRecursively(local_install_path);
return Result(InstallError::MOVE_FILES_ERROR);
}
@@ -247,6 +252,9 @@ void ComponentInstaller::Install(
InstallHelper(unpack_path, &manifest, &version, &install_path);
base::DeletePathRecursively(unpack_path);
if (result.result.category_ != update_client::ErrorCategory::kNone) {
+ LOG(ERROR) << "ComponentInstaller:"
+ << " Install error " << result.result.code_
+ << " extra " << result.result.extra_;
main_task_runner_->PostTask(FROM_HERE,
base::BindOnce(std::move(callback), result));
return;
@@ -286,34 +294,34 @@ bool ComponentInstaller::FindPreinstallation(
scoped_refptr<RegistrationInfo> registration_info) {
base::FilePath path = root.Append(installer_policy_->GetRelativeInstallDir());
if (!base::PathExists(path)) {
- DVLOG(1) << "Relative install dir does not exist: " << path.MaybeAsASCII();
+ LOG(INFO) << "Relative install dir does not exist: " << path.MaybeAsASCII();
return false;
}
std::optional<base::Value::Dict> manifest = update_client::ReadManifest(path);
if (!manifest) {
- DVLOG(1) << "Manifest does not exist: " << path.MaybeAsASCII();
+ LOG(INFO) << "Manifest does not exist: " << path.MaybeAsASCII();
return false;
}
if (!installer_policy_->VerifyInstallation(*manifest, path)) {
- DVLOG(1) << "Installation verification failed: " << path.MaybeAsASCII();
+ LOG(INFO) << "Installation verification failed: " << path.MaybeAsASCII();
return false;
}
std::string* version_lexical = manifest->FindString("version");
if (!version_lexical || !base::IsStringASCII(*version_lexical)) {
- DVLOG(1) << "Failed to get component version from the manifest.";
+ LOG(INFO) << "Failed to get component version from the manifest.";
return false;
}
const base::Version version(*version_lexical);
if (!version.IsValid()) {
- DVLOG(1) << "Version in the manifest is invalid:" << *version_lexical;
+ LOG(INFO) << "Version in the manifest is invalid:" << *version_lexical;
return false;
}
- VLOG(1) << "Preinstalled component found for " << installer_policy_->GetName()
+ LOG(INFO) << "Preinstalled component found for " << installer_policy_->GetName()
<< " at " << path.MaybeAsASCII() << " with version " << version
<< ".";
@@ -330,13 +338,13 @@ std::optional<base::Value::Dict>
ComponentInstaller::GetValidInstallationManifest(const base::FilePath& path) {
std::optional<base::Value::Dict> manifest = update_client::ReadManifest(path);
if (!manifest) {
- VPLOG(0) << "Failed to read manifest for " << installer_policy_->GetName()
+ LOG(INFO) << "Failed to read manifest for " << installer_policy_->GetName()
<< " (" << path.MaybeAsASCII() << ").";
return std::nullopt;
}
if (!installer_policy_->VerifyInstallation(*manifest, path)) {
- VPLOG(0) << "Failed to verify installation for "
+ LOG(INFO) << "Failed to verify installation for "
<< installer_policy_->GetName() << " (" << path.MaybeAsASCII()
<< ").";
return std::nullopt;
@@ -453,7 +461,7 @@ std::optional<base::FilePath> ComponentInstaller::GetComponentDirectory() {
base::FilePath base_dir =
base_component_dir.Append(installer_policy_->GetRelativeInstallDir());
if (!base::CreateDirectory(base_dir)) {
- VPLOG(0) << "Could not create the base directory for "
+ LOG(INFO) << "Could not create the base directory for "
<< installer_policy_->GetName() << " (" << base_dir.MaybeAsASCII()
<< ").";
return std::nullopt;
@@ -538,14 +546,14 @@ void ComponentInstaller::UninstallOnTaskRunner() {
}
if (!base::DeletePathRecursively(path)) {
- DVLOG(0) << "Couldn't delete " << path.value();
+ LOG(INFO) << "Couldn't delete " << path.value();
}
}
// Delete the base directory if it's empty now.
if (base::IsDirectoryEmpty(*base_dir)) {
if (!base::DeleteFile(*base_dir)) {
- DVLOG(0) << "Couldn't delete " << base_dir->value();
+ LOG(INFO) << "Couldn't delete " << base_dir->value();
}
}
@@ -589,7 +597,7 @@ void ComponentInstaller::FinishRegistration(
if (registration_info->manifest) {
ComponentReady(std::move(*registration_info->manifest));
} else {
- DVLOG(1) << "No component found for " << installer_policy_->GetName();
+ LOG(INFO) << "No component found for " << installer_policy_->GetName();
}
if (!callback.is_null()) {
@@ -598,7 +606,7 @@ void ComponentInstaller::FinishRegistration(
}
void ComponentInstaller::ComponentReady(base::Value::Dict manifest) {
- VLOG(1) << "Component ready, version " << current_version_.GetString()
+ LOG(INFO) << "Component ready, version " << current_version_.GetString()
<< " in " << current_install_dir_.value();
installer_policy_->ComponentReady(current_version_, current_install_dir_,
std::move(manifest));
diff --git a/components/component_updater/component_installer.h b/components/component_updater/component_installer.h
--- a/components/component_updater/component_installer.h
+++ b/components/component_updater/component_installer.h
@@ -152,7 +152,7 @@ class ComponentInstaller final : public update_client::CrxInstaller {
// |cus| provides the registration logic.
// The passed |callback| will be called once the initial check for installed
// versions is done and the component has been registered.
- void Register(ComponentUpdateService* cus, base::OnceClosure callback);
+ void Register(ComponentUpdateService* cus, base::OnceClosure callback, bool allowed = false);
// Registers the component for update checks and installs.
// |register_callback| is called to do the registration.
@@ -162,7 +162,7 @@ class ComponentInstaller final : public update_client::CrxInstaller {
base::OnceClosure callback,
const base::Version& registered_version = base::Version(kNullVersion),
const base::Version& max_previous_product_version =
- base::Version(kNullVersion));
+ base::Version(kNullVersion), bool allowed = false);
// Overrides from update_client::CrxInstaller.
void OnUpdateError(int error) override;
diff --git a/components/component_updater/component_updater_url_constants.cc b/components/component_updater/component_updater_url_constants.cc
--- a/components/component_updater/component_updater_url_constants.cc
+++ b/components/component_updater/component_updater_url_constants.cc
@@ -15,9 +15,9 @@ namespace component_updater {
// The value of |kDefaultUrlSource| can be overridden with
// --component-updater=url-source=someurl.
const char kUpdaterJSONDefaultUrl[] =
- "https://update.googleapis.com/service/update2/json";
+ "https://www.cromite.org/components/query.json";
const char kUpdaterJSONFallbackUrl[] =
- "http://update.googleapis.com/service/update2/json";
+ "about:blank";
} // namespace component_updater
diff --git a/components/component_updater/configurator_impl.cc b/components/component_updater/configurator_impl.cc
--- a/components/component_updater/configurator_impl.cc
+++ b/components/component_updater/configurator_impl.cc
@@ -40,8 +40,6 @@ ConfiguratorImpl::ConfiguratorImpl(
: background_downloads_enabled_(config_policy.BackgroundDownloadsEnabled()),
deltas_enabled_(config_policy.DeltaUpdatesEnabled()),
fast_update_(config_policy.FastUpdate()),
- pings_enabled_(config_policy.PingsEnabled()),
- require_encryption_(require_encryption),
url_source_override_(config_policy.UrlSourceOverride()),
initial_delay_(config_policy.InitialDelay()) {
if (config_policy.TestRequest()) {
@@ -83,16 +81,14 @@ std::vector<GURL> ConfiguratorImpl::UpdateUrl() const {
std::vector<GURL> urls{GURL(kUpdaterJSONDefaultUrl),
GURL(kUpdaterJSONFallbackUrl)};
- if (require_encryption_) {
- update_client::RemoveUnsecureUrls(&urls);
- }
+ update_client::RemoveUnsecureUrls(&urls);
return urls;
}
std::vector<GURL> ConfiguratorImpl::PingUrl() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- return pings_enabled_ ? UpdateUrl() : std::vector<GURL>();
+ return std::vector<GURL>();
}
const base::Version& ConfiguratorImpl::GetBrowserVersion() const {
diff --git a/components/component_updater/configurator_impl.h b/components/component_updater/configurator_impl.h
--- a/components/component_updater/configurator_impl.h
+++ b/components/component_updater/configurator_impl.h
@@ -106,8 +106,6 @@ class ConfiguratorImpl {
const bool background_downloads_enabled_;
const bool deltas_enabled_;
const bool fast_update_;
- const bool pings_enabled_;
- const bool require_encryption_;
const GURL url_source_override_;
const base::TimeDelta initial_delay_;
};
diff --git a/components/crx_file/crx_build_action_main.cc b/components/crx_file/crx_build_action_main.cc
--- a/components/crx_file/crx_build_action_main.cc
+++ b/components/crx_file/crx_build_action_main.cc
@@ -14,6 +14,7 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
+#include "base/strings/string_number_conversions.h"
#include "components/crx_file/crx_creator.h"
#include "crypto/rsa_private_key.h"
@@ -30,9 +31,13 @@ int main(int argc, char* argv[]) {
VLOG(0) << "Failed to read key material from " << argv[3];
return -1;
}
+ auto signing_key = crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(
+ std::vector<uint8_t>(key_file.begin(), key_file.end()));
+ std::vector<uint8_t> public_key;
+ signing_key->ExportPublicKey(&public_key);
+ VLOG(0) << "Pubkey: " << base::HexEncode(public_key);
+
return static_cast<int>(crx_file::Create(
base::FilePath::FromASCII(argv[1]), base::FilePath::FromASCII(argv[2]),
- crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(
- std::vector<uint8_t>(key_file.begin(), key_file.end()))
- .get()));
+ signing_key.get()));
}
diff --git a/components/crx_file/crx_verifier.cc b/components/crx_file/crx_verifier.cc
--- a/components/crx_file/crx_verifier.cc
+++ b/components/crx_file/crx_verifier.cc
@@ -18,6 +18,7 @@
#include <set>
#include <utility>
+#include "base/logging.h"
#include "base/base64.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
@@ -39,9 +40,15 @@ namespace {
// The SHA256 hash of the DER SPKI "ecdsa_2017_public" Crx3 key.
constexpr uint8_t kPublisherKeyHash[] = {
+#if BUILDFLAG(IS_ANDROID)
+ 0x9F, 0x4A, 0x10, 0x80, 0x0F, 0x84, 0x13, 0xCB, 0x8F, 0x69, 0x92,
+ 0xA6, 0x03, 0x44, 0x9D, 0xC5, 0xFE, 0x01, 0x4D, 0x00, 0xF3, 0x4E,
+ 0x16, 0x79, 0xA1, 0x81, 0x95, 0x77, 0x1C, 0x5A, 0x21, 0x24};
+#else
0x61, 0xf7, 0xf2, 0xa6, 0xbf, 0xcf, 0x74, 0xcd, 0x0b, 0xc1, 0xfe,
0x24, 0x97, 0xcc, 0x9b, 0x04, 0x25, 0x4c, 0x65, 0x8f, 0x79, 0xf2,
0x14, 0x53, 0x92, 0x86, 0x7e, 0xa8, 0x36, 0x63, 0x67, 0xcf};
+#endif
// The SHA256 hash of the DER SPKI "ecdsa_2017_public" Crx3 test key.
constexpr uint8_t kPublisherTestKeyHash[] = {
@@ -210,6 +217,13 @@ VerifierResult VerifyCrx3(
found_publisher_key =
found_publisher_key || key_hash == publisher_key ||
(accept_publisher_test_key && key_hash == *publisher_test_key);
+
+ DLOG(INFO) << "---key_hash: " << base::HexEncode(key_hash);
+ DLOG(INFO) << "---publisher_key: " << base::HexEncode(publisher_key);
+ DLOG(INFO) << "---found_publisher_key: " << found_publisher_key;
+ DLOG(INFO) << "---sig: " << sig;
+ DLOG(INFO) << "---key: " << key;
+
auto v = std::make_unique<crypto::SignatureVerifier>();
static_assert(sizeof(unsigned char) == sizeof(uint8_t),
"Unsupported char size.");
@@ -223,9 +237,11 @@ VerifierResult VerifyCrx3(
verifiers.push_back(std::move(v));
}
}
+#if !BUILDFLAG(IS_ANDROID)
if (public_key_bytes.empty() || !required_key_set.empty()) {
return VerifierResult::ERROR_REQUIRED_PROOF_MISSING;
}
+#endif
if (require_publisher_key && !found_publisher_key) {
return VerifierResult::ERROR_REQUIRED_PROOF_MISSING;
diff --git a/components/update_client/component.cc b/components/update_client/component.cc
--- a/components/update_client/component.cc
+++ b/components/update_client/component.cc
@@ -398,6 +398,18 @@ void Component::StateChecking::DoHandle() {
return;
}
+ LOG(INFO) << "Component: StateChecking"
+ << " component.id=" << component.id()
+ << " previous_version()=" << component.previous_version().GetString()
+ << " next_version()=" << component.next_version().GetString();
+
+#if BUILDFLAG(IS_ANDROID)
+ if (component.previous_version().CompareTo(component.next_version()) == 0) {
+ TransitionState(std::make_unique<StateUpToDate>(&component));
+ return;
+ }
+#endif
+
if (component.pipeline_.has_value()) {
metrics::RecordUpdateCheckResult(metrics::UpdateCheckResult::kHasUpdate);
TransitionState(std::make_unique<StateCanUpdate>(&component));
diff --git a/components/update_client/crx_downloader.cc b/components/update_client/crx_downloader.cc
--- a/components/update_client/crx_downloader.cc
+++ b/components/update_client/crx_downloader.cc
@@ -24,6 +24,7 @@
#include "components/update_client/update_client_metrics.h"
#include "components/update_client/url_fetcher_downloader.h"
#include "components/update_client/utils.h"
+#include "base/logging.h"
namespace update_client {
@@ -89,6 +90,9 @@ base::OnceClosure CrxDownloader::StartDownload(
current_url_ = urls_.begin();
download_callback_ = std::move(download_callback);
+ LOG(INFO) << "CrxDownloader: StartDownload"
+ << " current_url_=" << *current_url_
+ << " expected_hash=" << expected_hash;
return DoStartDownload(*current_url_);
}
@@ -125,6 +129,7 @@ void CrxDownloader::OnDownloadComplete(
return CrxDownloaderError::NONE;
}
DeleteFileAndEmptyParentDirectory(filepath);
+ LOG(ERROR) << "CrxDownloaderError: BAD_HASH";
return CrxDownloaderError::BAD_HASH;
},
result.response, expected_hash_),
diff --git a/components/update_client/net/network_impl.cc b/components/update_client/net/network_impl.cc
--- a/components/update_client/net/network_impl.cc
+++ b/components/update_client/net/network_impl.cc
@@ -130,7 +130,9 @@ void NetworkFetcherImpl::PostRequest(
network::SimpleURLLoader::RETRY_ON_NETWORK_CHANGE);
// The `Content-Type` header set by |AttachStringForUpload| overwrites any
// `Content-Type` header present in the |ResourceRequest| above.
+#if !BUILDFLAG(IS_ANDROID)
simple_url_loader->AttachStringForUpload(post_data, content_type);
+#endif
simple_url_loader->SetOnResponseStartedCallback(base::BindOnce(
&NetworkFetcherImpl::OnResponseStartedCallback, base::Unretained(this),
std::move(response_started_callback)));
diff --git a/components/update_client/protocol_parser_json.cc b/components/update_client/protocol_parser_json.cc
--- a/components/update_client/protocol_parser_json.cc
+++ b/components/update_client/protocol_parser_json.cc
@@ -16,6 +16,7 @@
#include "base/values.h"
#include "base/version.h"
#include "components/update_client/protocol_definition.h"
+#include "base/logging.h"
namespace update_client {
@@ -323,6 +324,7 @@ bool ProtocolParserJSON::DoParse(const std::string& response_json,
Results* results) {
CHECK(results);
+ DLOG(INFO) << "ProtocolParserJSON: DoParse " << response_json;
if (response_json.empty()) {
ParseError("Empty JSON.");
return false;
diff --git a/components/update_client/request_sender.cc b/components/update_client/request_sender.cc
--- a/components/update_client/request_sender.cc
+++ b/components/update_client/request_sender.cc
@@ -104,7 +104,8 @@ void RequestSender::SendInternal() {
}
VLOG_IF(2, !url.is_valid()) << "url is not valid.";
- VLOG(2) << "Sending Omaha request: " << request_body_;
+ LOG(INFO) << "Sending Omaha request: " << url.spec();
+ DLOG(INFO) << "Request body (not send): " << request_body_;
if (!fetcher_factory_) {
// The request was cancelled.
diff --git a/components/update_client/update_checker.cc b/components/update_client/update_checker.cc
--- a/components/update_client/update_checker.cc
+++ b/components/update_client/update_checker.cc
@@ -239,6 +239,10 @@ void UpdateCheckerImpl::CheckForUpdatesHelper(
config_->IsMachineExternallyManaged(), additional_attributes,
updater_state_attributes, std::move(apps));
+ bool enabled_cup_signing = config_->EnabledCupSigning();
+#if BUILDFLAG(IS_ANDROID)
+ enabled_cup_signing = false;
+#endif
cancellation_->OnCancel(
base::MakeRefCounted<RequestSender>(config_->GetNetworkFetcherFactory())
->Send({url},
@@ -248,7 +252,7 @@ void UpdateCheckerImpl::CheckForUpdatesHelper(
config_->GetProtocolHandlerFactory()
->CreateSerializer()
->Serialize(request),
- config_->EnabledCupSigning(),
+ enabled_cup_signing,
base::BindOnce(
&UpdateCheckerImpl::OnRequestSenderComplete,
weak_factory_.GetWeakPtr(), context,
diff --git a/components/update_client/update_engine.cc b/components/update_client/update_engine.cc
--- a/components/update_client/update_engine.cc
+++ b/components/update_client/update_engine.cc
@@ -212,6 +212,15 @@ void UpdateEngine::StartOperation(
component->set_crx_component(*crx_component);
component->set_previous_version(component->crx_component()->version);
component->set_previous_fp(component->crx_component()->fingerprint);
+#if BUILDFLAG(IS_ANDROID)
+ if (!update_context->is_foreground && component->crx_component()->version.IsValid()
+ && component->crx_component()->version.components()[0] != 0) {
+ LOG(INFO) << "Component " << id << " do not need updates. "
+ << "Current Version: " << component->crx_component()->version.GetString();
+ continue;
+ }
+#endif
+ LOG(INFO) << "Component " << id << " can be checked for updates.";
update_context->components_to_check_for_updates.push_back(id);
} else {
// |CrxDataCallback| did not return a CrxComponent instance for this
diff --git a/components/update_client/utils.cc b/components/update_client/utils.cc
--- a/components/update_client/utils.cc
+++ b/components/update_client/utils.cc
@@ -106,6 +106,9 @@ bool VerifyFileHash256(const base::FilePath& filepath,
uint8_t actual_hash[crypto::kSHA256Length] = {};
hasher->Finish(actual_hash, sizeof(actual_hash));
+ DLOG(INFO) << "VerifyFileHash256 "
+ << "actual_hash=" << base::HexEncode(actual_hash);
+
return memcmp(actual_hash, &expected_hash[0], sizeof(actual_hash)) == 0;
}
--
@@ -83,20 +83,20 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tracing/setting
import androidx.preference.PreferenceFragmentCompat;
import org.chromium.base.ResettersForTesting;
@@ -19,10 +21,12 @@ import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
import org.chromium.chrome.browser.preferences.ChromeSharedPreferences;
@@ -20,10 +22,12 @@ import org.chromium.chrome.browser.preferences.ChromeSharedPreferences;
import org.chromium.chrome.browser.settings.ChromeBaseSettingsFragment;
import org.chromium.components.browser_ui.settings.EmbeddableSettingsPage;
import org.chromium.components.browser_ui.settings.SettingsUtils;
+import org.chromium.chrome.browser.util.PlatformUtil;
/** Settings fragment containing preferences aimed at Chrome and web developers. */
public class DeveloperSettings extends PreferenceFragmentCompat implements EmbeddableSettingsPage {
public class DeveloperSettings extends ChromeBaseSettingsFragment implements EmbeddableSettingsPage {
private static final String UI_PREF_BETA_STABLE_HINT = "beta_stable_hint";
+ private static final String TEST_GWP_ASAN_KEY = "test_gwp_asan";
// Non-translated strings:
private static final String MSG_DEVELOPER_OPTIONS_TITLE = "Developer options";
@@ -58,6 +62,22 @@ public class DeveloperSettings extends PreferenceFragmentCompat implements Embed
@@ -59,6 +63,22 @@ public class DeveloperSettings extends ChromeBaseSettingsFragment implements Emb
if (VersionInfo.isBetaBuild() || VersionInfo.isStableBuild()) {
getPreferenceScreen().removePreference(findPreference(UI_PREF_BETA_STABLE_HINT));
}
@@ -17,7 +17,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
.../Fonts-fingerprinting-mitigation.inc | 8 +
.../Fonts-fingerprinting-mitigation.inc | 2 +
.../Fonts-fingerprinting-mitigation.inc | 5 +
.../Fonts-fingerprinting-mitigation.inc | 10 +
skia/ext/skia_utils_win.cc | 20 ++
skia/ext/skia_utils_win.h | 3 +
third_party/blink/public/common/features.h | 3 +
@@ -26,7 +26,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
.../fonts/skia/bromite_allowed_fonts.h | 271 ++++++++++++++++++
.../platform/fonts/skia/font_cache_skia.cc | 44 ++-
.../platform/fonts/win/font_cache_skia_win.cc | 7 +-
11 files changed, 357 insertions(+), 9 deletions(-)
11 files changed, 362 insertions(+), 9 deletions(-)
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Fonts-fingerprinting-mitigation.inc
create mode 100644 cromite_flags/content/common/features_cc/Fonts-fingerprinting-mitigation.inc
create mode 100644 cromite_flags/third_party/blink/common/features_cc/Fonts-fingerprinting-mitigation.inc
@@ -41,7 +41,7 @@ new file mode 100644
+
+ {"fonts-fingerprint-mitigation",
+ "Enable fonts fingerprint mitigation",
+ "Filters the list of fonts allowing only standard ones to be used.", kOsAll,
+ "Filters the list of fonts allowing only standard ones to be used.", kOsDesktop,
+ FEATURE_VALUE_TYPE(blink::features::kFontsFingerprintMitigation)},
+
+#endif
@@ -56,12 +56,17 @@ diff --git a/cromite_flags/third_party/blink/common/features_cc/Fonts-fingerprin
new file mode 100644
--- /dev/null
+++ b/cromite_flags/third_party/blink/common/features_cc/Fonts-fingerprinting-mitigation.inc
@@ -0,0 +1,5 @@
@@ -0,0 +1,10 @@
+SET_CROMITE_FEATURE_DISABLED(kGMSCoreEmoji);
+
+CROMITE_FEATURE(kFontsFingerprintMitigation,
+ "FontsFingerprintMitigation",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+#if BUILDFLAG(IS_ANDROID)
+ base::FEATURE_DISABLED_BY_DEFAULT
+#else
+ base::FEATURE_ENABLED_BY_DEFAULT
+#endif
+);
diff --git a/skia/ext/skia_utils_win.cc b/skia/ext/skia_utils_win.cc
--- a/skia/ext/skia_utils_win.cc
+++ b/skia/ext/skia_utils_win.cc
+6 -3
View File
@@ -31,7 +31,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
services/firewall/tools/codegen.py | 82 +++
services/firewall/tools/decode_template.py | 85 +++
services/firewall/tools/gen_builders.py | 65 +++
services/firewall/tools/rules.xml | 93 ++++
services/firewall/tools/rules.xml | 96 ++++
services/firewall/tools/rules_model.py | 35 ++
services/network/network_context.cc | 73 +++
.../network/public/cpp/simple_url_loader.cc | 18 +
@@ -40,7 +40,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
.../loader/fetch/url_loader/url_loader.cc | 4 +-
.../scripts/auditor/auditor.py | 1 +
.../scripts/auditor/util.py | 1 +
31 files changed, 1652 insertions(+), 22 deletions(-)
31 files changed, 1655 insertions(+), 22 deletions(-)
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Internal-firewall.inc
create mode 100644 services/firewall/public/BUILD.gn
create mode 100644 services/firewall/public/firewall_features.cc
@@ -1514,7 +1514,7 @@ diff --git a/services/firewall/tools/rules.xml b/services/firewall/tools/rules.x
new file mode 100644
--- /dev/null
+++ b/services/firewall/tools/rules.xml
@@ -0,0 +1,93 @@
@@ -0,0 +1,96 @@
+<?xml version="1.0"?>
+<!--
+ This file is part of Bromite.
@@ -1607,6 +1607,9 @@ new file mode 100644
+ <!-- Needed -->
+ <item id="open_search" allowed="1"/>
+ <item id="favicon_loader" allowed="1"/>
+
+ <!-- Component Updater-->
+ <item id="update_client" allowed="1"/>
+</rules>
diff --git a/services/firewall/tools/rules_model.py b/services/firewall/tools/rules_model.py
new file mode 100644
@@ -1,81 +0,0 @@
From: Jan Engelhardt <jengelh@inai.de>
Date: Tue, 2 Jun 2015 11:01:50 +0200
Subject: updater: disable updater pings
Despite auto-updater being arguably disabled (see previous commit),
Chromium would still send background requests. Kill it.
(trk:170, trk:171)
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
.../component_updater/component_updater_url_constants.cc | 4 ++--
components/component_updater/configurator_impl.cc | 9 +++------
components/component_updater/configurator_impl.h | 2 --
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/components/component_updater/component_updater_url_constants.cc b/components/component_updater/component_updater_url_constants.cc
--- a/components/component_updater/component_updater_url_constants.cc
+++ b/components/component_updater/component_updater_url_constants.cc
@@ -15,9 +15,9 @@ namespace component_updater {
// The value of |kDefaultUrlSource| can be overridden with
// --component-updater=url-source=someurl.
const char kUpdaterJSONDefaultUrl[] =
- "https://update.googleapis.com/service/update2/json";
+ "about:blank";
const char kUpdaterJSONFallbackUrl[] =
- "http://update.googleapis.com/service/update2/json";
+ "about:blank";
} // namespace component_updater
diff --git a/components/component_updater/configurator_impl.cc b/components/component_updater/configurator_impl.cc
--- a/components/component_updater/configurator_impl.cc
+++ b/components/component_updater/configurator_impl.cc
@@ -40,8 +40,6 @@ ConfiguratorImpl::ConfiguratorImpl(
: background_downloads_enabled_(config_policy.BackgroundDownloadsEnabled()),
deltas_enabled_(config_policy.DeltaUpdatesEnabled()),
fast_update_(config_policy.FastUpdate()),
- pings_enabled_(config_policy.PingsEnabled()),
- require_encryption_(require_encryption),
url_source_override_(config_policy.UrlSourceOverride()),
initial_delay_(config_policy.InitialDelay()) {
if (config_policy.TestRequest()) {
@@ -77,22 +75,21 @@ base::TimeDelta ConfiguratorImpl::UpdateDelay() const {
std::vector<GURL> ConfiguratorImpl::UpdateUrl() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ if ((true)) return std::vector<GURL>();
if (url_source_override_.is_valid()) {
return {GURL(url_source_override_)};
}
std::vector<GURL> urls{GURL(kUpdaterJSONDefaultUrl),
GURL(kUpdaterJSONFallbackUrl)};
- if (require_encryption_) {
- update_client::RemoveUnsecureUrls(&urls);
- }
+ update_client::RemoveUnsecureUrls(&urls);
return urls;
}
std::vector<GURL> ConfiguratorImpl::PingUrl() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- return pings_enabled_ ? UpdateUrl() : std::vector<GURL>();
+ return std::vector<GURL>();
}
const base::Version& ConfiguratorImpl::GetBrowserVersion() const {
diff --git a/components/component_updater/configurator_impl.h b/components/component_updater/configurator_impl.h
--- a/components/component_updater/configurator_impl.h
+++ b/components/component_updater/configurator_impl.h
@@ -106,8 +106,6 @@ class ConfiguratorImpl {
const bool background_downloads_enabled_;
const bool deltas_enabled_;
const bool fast_update_;
- const bool pings_enabled_;
- const bool require_encryption_;
const GURL url_source_override_;
const base::TimeDelta initial_delay_;
};
--
+2 -1
View File
@@ -25,7 +25,6 @@ Also disable gamepadconnected and gamepaddisconnected, see https://jshelter.org/
- Disable WebGL by default
- Disable WebRTC by default
- Disable MIDI permission by default
- Disable the use of non-standard and local fonts
- Enable Canvas and Rect API fingerprinting mitigations
- Enable Media API fingerprinting mitigations
- AudioBuffer and AnalyserNode fingerprinting mitigations (https://fingerprint.com/blog/audio-fingerprinting/)
@@ -49,6 +48,8 @@ Also disable gamepadconnected and gamepaddisconnected, see https://jshelter.org/
- (WINDOWS) Hide the presence of the webcam if the user has not given permission
- (WINDOWS) PublicKeyCredential fingerprinting mitigations, see #1758
- (DESKTOP) Disable Bluetooth API by default
- (WINDOWS) Disable the use of non-standard and local fonts
- (ANDROID) Replaces system fonts with a predefined set (https://github.com/uazo/cromite/issues/1829)
#### Tracking navigation
- Enable network isolation features
+4 -1
View File
@@ -75,7 +75,10 @@ On desktop platforms it is possible to activate the automatic update of extensio
In Android, the installation of PWAs is disabled and cannot be re-enabled.
Cromite does not download or update any external components.
Cromite does not download or update any google components.
Cromite, by default, downloads from www.cromite.org a zip containing the fonts it uses for anti-fingerpriting protection. If the zip has already been downloaded, no connection is made again.
In www.cromite.org, no log is active.
#### NETWORK TIME
Cromite never uses network time to verify SSL certificates, and no call is made to verify it.