зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 3 changesets (bug 1515712) for build bustages at 'cpp_guard'.
Backed out changeset 3e46d5fddd21 (bug 1515712) Backed out changeset acb99631797a (bug 1515712) Backed out changeset a2d24fd1fd67 (bug 1515712)
This commit is contained in:
Родитель
b18f4b64c3
Коммит
53ae3683c8
|
@ -1879,10 +1879,3 @@ pref("browser.toolbars.keyboard_navigation", true);
|
|||
// quick access to sign-in and manage your Firefox Account.
|
||||
pref("identity.fxaccounts.toolbar.enabled", true);
|
||||
pref("identity.fxaccounts.toolbar.accessed", false);
|
||||
|
||||
// Check bundled JAR and XPI files for corruption.
|
||||
#ifdef RELEASE_OR_BETA
|
||||
pref("corroborator.enabled", false);
|
||||
#else
|
||||
pref("corroborator.enabled", true);
|
||||
#endif
|
||||
|
|
|
@ -391,7 +391,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
|||
BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm",
|
||||
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
|
||||
ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm",
|
||||
Corroborate: "resource://gre/modules/Corroborate.jsm",
|
||||
DateTimePickerParent: "resource://gre/modules/DateTimePickerParent.jsm",
|
||||
Discovery: "resource:///modules/Discovery.jsm",
|
||||
ExtensionsUI: "resource:///modules/ExtensionsUI.jsm",
|
||||
|
@ -1575,10 +1574,6 @@ BrowserGlue.prototype = {
|
|||
this._monitorScreenshotsPref();
|
||||
this._monitorWebcompatReporterPref();
|
||||
|
||||
if (Services.prefs.getBoolPref("corroborator.enabled", true)) {
|
||||
Corroborate.init().catch(Cu.reportError);
|
||||
}
|
||||
|
||||
let pService = Cc["@mozilla.org/toolkit/profile-service;1"].
|
||||
getService(Ci.nsIToolkitProfileService);
|
||||
if (pService.createdAlternateProfile) {
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
const {FileUtils} = ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
|
||||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetters(this, {
|
||||
gCertDB: ["@mozilla.org/security/x509certdb;1", "nsIX509CertDB"],
|
||||
});
|
||||
|
||||
var EXPORTED_SYMBOLS = ["Corroborate"];
|
||||
|
||||
/**
|
||||
* Tools for verifying internal files in Mozilla products.
|
||||
*/
|
||||
this.Corroborate = {
|
||||
async init() {
|
||||
const appOmniJar = FileUtils.getFile("XCurProcD", [AppConstants.OMNIJAR_NAME]);
|
||||
const greOmniJar = FileUtils.getFile("GreD", [AppConstants.OMNIJAR_NAME]);
|
||||
const systemAddons = FileUtils.getFile("XCurProcD", ["features"]);
|
||||
|
||||
let corruptOmnijar = true;
|
||||
// If an omni jar is missing, we consider that corrupt. Firefox could be running with
|
||||
// an omni jar unpacked, but it would never be signed correctly in that case so there
|
||||
// isn't a point checking further.
|
||||
if (appOmniJar.exists() && greOmniJar.exists()) {
|
||||
corruptOmnijar = !(await this.verifyJar(appOmniJar) && await this.verifyJar(greOmniJar));
|
||||
}
|
||||
|
||||
// It's not necessarily a problem if all built-in system add-ons have been removed,
|
||||
// more that we want to know if any unsigned add-ons are present. The Telemetry Environment
|
||||
// shows which system add-ons are present, anyway.
|
||||
let corruptSystemAddons = false;
|
||||
for (let file of systemAddons.directoryEntries) {
|
||||
if (!await this.verifyJar(file)) {
|
||||
corruptSystemAddons = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.reportTelemetry(corruptOmnijar, corruptSystemAddons);
|
||||
},
|
||||
|
||||
/**
|
||||
* Verify signed state of arbitrary JAR file. Currently only JAR files signed
|
||||
* with Mozilla-internal keys are supported.
|
||||
*
|
||||
* @argument file - an nsIFile pointing to the JAR to verify.
|
||||
*
|
||||
* @returns {Promise} - resolves true if file exists and is valid, false otherwise.
|
||||
* Never rejects.
|
||||
*/
|
||||
verifyJar(file) {
|
||||
let root = Ci.nsIX509CertDB.AddonsPublicRoot;
|
||||
let expectedOrganizationalUnit = "Mozilla Components";
|
||||
|
||||
return new Promise(resolve => {
|
||||
gCertDB.openSignedAppFileAsync(root, file, (rv, _zipReader, cert) => {
|
||||
resolve(Components.isSuccessCode(rv) && cert.organizationalUnit === expectedOrganizationalUnit);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
reportTelemetry(corruptOmnijar, corruptSystemAddons) {
|
||||
Services.telemetry.scalarSet("corroborate.omnijar_corrupted", corruptOmnijar);
|
||||
Services.telemetry.scalarSet("corroborate.system_addons_corrupted", corruptSystemAddons);
|
||||
},
|
||||
};
|
|
@ -1,17 +0,0 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
|
||||
with Files('**'):
|
||||
BUG_COMPONENT = ('Toolkit', 'General')
|
||||
|
||||
EXTRA_JS_MODULES += [
|
||||
'Corroborate.jsm',
|
||||
]
|
||||
|
||||
XPCSHELL_TESTS_MANIFESTS += [
|
||||
'test/xpcshell/xpcshell.ini',
|
||||
]
|
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичные данные
toolkit/components/corroborator/test/xpcshell/data/unsigned.xpi
Двоичные данные
toolkit/components/corroborator/test/xpcshell/data/unsigned.xpi
Двоичный файл не отображается.
|
@ -1,39 +0,0 @@
|
|||
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set sts=2 sw=2 et tw=80: */
|
||||
"use strict";
|
||||
|
||||
const {Corroborate} = ChromeUtils.import("resource://gre/modules/Corroborate.jsm");
|
||||
const {FileUtils} = ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
|
||||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
|
||||
add_task(async function test_various_jars() {
|
||||
let result = await Corroborate.verifyJar(do_get_file("data/unsigned.xpi"));
|
||||
equal(result, false, "unsigned files do not verify");
|
||||
|
||||
result = await Corroborate.verifyJar(do_get_file("data/signed-amo.xpi"));
|
||||
equal(result, false, "AMO signed files do not verify");
|
||||
|
||||
result = await Corroborate.verifyJar(do_get_file("data/signed-privileged.xpi"));
|
||||
equal(result, false, "Privileged signed files do not verify");
|
||||
|
||||
let missingFile = do_get_file("data");
|
||||
missingFile.append("missing.xpi");
|
||||
|
||||
result = await Corroborate.verifyJar(missingFile);
|
||||
equal(result, false, "Missing (but expected) files do not verify");
|
||||
|
||||
result = await Corroborate.verifyJar(do_get_file("data/signed-components.xpi"));
|
||||
equal(result, true, "Components signed files do verify");
|
||||
});
|
||||
|
||||
add_task(async function test_telemetry() {
|
||||
Corroborate.reportTelemetry(true, false);
|
||||
|
||||
const scalars = Services.telemetry.getSnapshotForScalars("main", false).parent;
|
||||
|
||||
ok("corroborate.omnijar_corrupted" in scalars,
|
||||
"omni jar should be corrupted");
|
||||
ok("corroborate.system_addons_corrupted" in scalars,
|
||||
"system addons should not be corrupted");
|
||||
});
|
|
@ -1,6 +0,0 @@
|
|||
[DEFAULT]
|
||||
tags = corroborator
|
||||
support-files =
|
||||
data/**
|
||||
|
||||
[test_verify_jar.js]
|
|
@ -119,7 +119,3 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
|
|||
|
||||
if CONFIG['MOZ_BUILD_APP'] == 'browser':
|
||||
DIRS += ['normandy']
|
||||
|
||||
# This is only packaged for browser since corrupt JAR and XPI files tend to be a desktop-OS problem.
|
||||
if CONFIG['MOZ_BUILD_APP'] == 'browser':
|
||||
DIRS += ['corroborator']
|
||||
|
|
|
@ -4040,34 +4040,6 @@ telemetry.test:
|
|||
- 'main'
|
||||
- 'sync'
|
||||
|
||||
# The following section contains counters for corruption of internal JAR and XPI files.
|
||||
corroborate:
|
||||
omnijar_corrupted:
|
||||
bug_numbers:
|
||||
- 1515712
|
||||
description: >-
|
||||
Whether the omni jar (omni.ja) was found to be missing or corrupt when checked during startup.
|
||||
expires: "71"
|
||||
kind: boolean
|
||||
notification_emails:
|
||||
- rhelmer@mozilla.com
|
||||
release_channel_collection: opt-out
|
||||
record_in_processes:
|
||||
- main
|
||||
|
||||
system_addons_corrupted:
|
||||
bug_numbers:
|
||||
- 1515712
|
||||
description: >-
|
||||
Whether any system add-on (XPI files) were found to be missing or corrupt when checked during startup.
|
||||
expires: "71"
|
||||
kind: boolean
|
||||
notification_emails:
|
||||
- rhelmer@mozilla.com
|
||||
release_channel_collection: opt-out
|
||||
record_in_processes:
|
||||
- main
|
||||
|
||||
# NOTE: Please don't add new definitions below this point. Consider adding
|
||||
# them earlier in the file and leave the telemetry.test category as the last
|
||||
# one for readability.
|
||||
|
|
|
@ -325,8 +325,6 @@ this.AppConstants = Object.freeze({
|
|||
|
||||
BROWSER_CHROME_URL: "@BROWSER_CHROME_URL@",
|
||||
|
||||
OMNIJAR_NAME: "@OMNIJAR_NAME@",
|
||||
|
||||
// URL to the hg revision this was built from (e.g.
|
||||
// "https://hg.mozilla.org/mozilla-central/rev/6256ec9113c1")
|
||||
// On unofficial builds, this is an empty string.
|
||||
|
|
|
@ -309,8 +309,7 @@ for var in ('ANDROID_PACKAGE_NAME',
|
|||
'MOZ_WIDGET_TOOLKIT',
|
||||
'DLL_PREFIX',
|
||||
'DLL_SUFFIX',
|
||||
'DEBUG_JS_MODULES',
|
||||
'OMNIJAR_NAME'):
|
||||
'DEBUG_JS_MODULES'):
|
||||
DEFINES[var] = CONFIG[var]
|
||||
|
||||
for var in ('MOZ_TOOLKIT_SEARCH',
|
||||
|
|
Загрузка…
Ссылка в новой задаче