зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset ef2824384b3d (bug 1647360) for multiple failures. CLOSED TREE
This commit is contained in:
Родитель
5871df542a
Коммит
62010bbf25
|
@ -21,9 +21,6 @@ const PREF_LANGPACK_SIGNATURES = "extensions.langpacks.signatures.required";
|
|||
const PREF_ALLOW_EXPERIMENTS = "extensions.experiments.enabled";
|
||||
const PREF_EM_SIDELOAD_SCOPES = "extensions.sideloadScopes";
|
||||
const PREF_IS_EMBEDDED = "extensions.isembedded";
|
||||
const PREF_UPDATE_REQUIREBUILTINCERTS = "extensions.update.requireBuiltInCerts";
|
||||
const PREF_INSTALL_REQUIREBUILTINCERTS =
|
||||
"extensions.install.requireBuiltInCerts";
|
||||
|
||||
var AddonSettings = {};
|
||||
|
||||
|
@ -56,27 +53,6 @@ if (AppConstants.MOZ_REQUIRE_SIGNING && !Cu.isInAutomation) {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Require the use of certs shipped with Firefox for
|
||||
* addon install and update, if the distribution does
|
||||
* not require addon signing and is not ESR.
|
||||
*/
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
AddonSettings,
|
||||
"INSTALL_REQUIREBUILTINCERTS",
|
||||
PREF_INSTALL_REQUIREBUILTINCERTS,
|
||||
!AppConstants.MOZ_REQUIRE_SIGNING &&
|
||||
!AppConstants.MOZ_APP_VERSION_DISPLAY.endsWith("esr")
|
||||
);
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
AddonSettings,
|
||||
"UPDATE_REQUIREBUILTINCERTS",
|
||||
PREF_UPDATE_REQUIREBUILTINCERTS,
|
||||
!AppConstants.MOZ_REQUIRE_SIGNING &&
|
||||
!AppConstants.MOZ_APP_VERSION_DISPLAY.endsWith("esr")
|
||||
);
|
||||
|
||||
// Whether or not we're running in GeckoView embedded in an Android app
|
||||
if (Cu.isInAutomation) {
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
|
|
|
@ -14,6 +14,8 @@ var EXPORTED_SYMBOLS = ["AddonUpdateChecker"];
|
|||
const TIMEOUT = 60 * 1000;
|
||||
const TOOLKIT_ID = "toolkit@mozilla.org";
|
||||
|
||||
const PREF_UPDATE_REQUIREBUILTINCERTS = "extensions.update.requireBuiltInCerts";
|
||||
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
|
@ -43,8 +45,8 @@ ChromeUtils.defineModuleGetter(
|
|||
);
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"AddonSettings",
|
||||
"resource://gre/modules/AddonSettings.jsm"
|
||||
"AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm"
|
||||
);
|
||||
|
||||
const { Log } = ChromeUtils.import("resource://gre/modules/Log.jsm");
|
||||
|
@ -271,12 +273,18 @@ function UpdateParser(aId, aUrl, aObserver) {
|
|||
this.observer = aObserver;
|
||||
this.url = aUrl;
|
||||
|
||||
let requireBuiltIn = Services.prefs.getBoolPref(
|
||||
PREF_UPDATE_REQUIREBUILTINCERTS,
|
||||
!AppConstants.MOZ_REQUIRE_SIGNING &&
|
||||
!AppConstants.MOZ_APP_VERSION_DISPLAY.endsWith("esr")
|
||||
);
|
||||
|
||||
logger.debug("Requesting " + aUrl);
|
||||
try {
|
||||
this.request = new ServiceRequest({ mozAnon: true });
|
||||
this.request.open("GET", this.url, true);
|
||||
this.request.channel.notificationCallbacks = new CertUtils.BadCertHandler(
|
||||
!AddonSettings.UPDATE_REQUIREBUILTINCERTS
|
||||
!requireBuiltIn
|
||||
);
|
||||
this.request.channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
|
||||
// Prevent the request from writing to cache.
|
||||
|
@ -306,11 +314,14 @@ UpdateParser.prototype = {
|
|||
this.request = null;
|
||||
this._doneAt = new Error("place holder");
|
||||
|
||||
let requireBuiltIn = Services.prefs.getBoolPref(
|
||||
PREF_UPDATE_REQUIREBUILTINCERTS,
|
||||
!AppConstants.MOZ_REQUIRE_SIGNING &&
|
||||
!AppConstants.MOZ_APP_VERSION_DISPLAY.endsWith("esr")
|
||||
);
|
||||
|
||||
try {
|
||||
CertUtils.checkCert(
|
||||
request.channel,
|
||||
!AddonSettings.UPDATE_REQUIREBUILTINCERTS
|
||||
);
|
||||
CertUtils.checkCert(request.channel, !requireBuiltIn);
|
||||
} catch (e) {
|
||||
logger.warn("Request failed: " + this.url + " - " + e);
|
||||
this.notifyError(AddonManager.ERROR_DOWNLOAD_ERROR);
|
||||
|
|
|
@ -185,6 +185,8 @@ function flushJarCache(aJarFile) {
|
|||
const PREF_EM_UPDATE_BACKGROUND_URL = "extensions.update.background.url";
|
||||
const PREF_EM_UPDATE_URL = "extensions.update.url";
|
||||
const PREF_XPI_SIGNATURES_DEV_ROOT = "xpinstall.signatures.dev-root";
|
||||
const PREF_INSTALL_REQUIREBUILTINCERTS =
|
||||
"extensions.install.requireBuiltInCerts";
|
||||
|
||||
const KEY_TEMPDIR = "TmpD";
|
||||
|
||||
|
@ -2227,9 +2229,12 @@ var DownloadAddonInstall = class extends AddonInstall {
|
|||
].createInstance(Ci.nsIStreamListenerTee);
|
||||
listener.init(this, this.stream);
|
||||
try {
|
||||
this.badCertHandler = new CertUtils.BadCertHandler(
|
||||
!AddonSettings.INSTALL_REQUIREBUILTINCERTS
|
||||
let requireBuiltIn = Services.prefs.getBoolPref(
|
||||
PREF_INSTALL_REQUIREBUILTINCERTS,
|
||||
!AppConstants.MOZ_REQUIRE_SIGNING &&
|
||||
!AppConstants.MOZ_APP_VERSION_DISPLAY.endsWith("esr")
|
||||
);
|
||||
this.badCertHandler = new CertUtils.BadCertHandler(!requireBuiltIn);
|
||||
|
||||
this.channel = NetUtil.newChannel({
|
||||
uri: this.sourceURI,
|
||||
|
@ -2398,7 +2403,11 @@ var DownloadAddonInstall = class extends AddonInstall {
|
|||
try {
|
||||
CertUtils.checkCert(
|
||||
aRequest,
|
||||
!AddonSettings.INSTALL_REQUIREBUILTINCERTS
|
||||
!Services.prefs.getBoolPref(
|
||||
PREF_INSTALL_REQUIREBUILTINCERTS,
|
||||
!AppConstants.MOZ_REQUIRE_SIGNING &&
|
||||
!AppConstants.MOZ_APP_VERSION_DISPLAY.endsWith("esr")
|
||||
)
|
||||
);
|
||||
} catch (e) {
|
||||
this.downloadFailed(AddonManager.ERROR_NETWORK_FAILURE, e);
|
||||
|
|
Загрузка…
Ссылка в новой задаче