Commit 7c0478f3 authored by Kathleen Brade's avatar Kathleen Brade Committed by Georg Koppen
Browse files

Bug 19121: reinstate the update.xml hash check

This is a partial revert of commit f1241db6.

Revert most changes from Mozilla Bug 862173 "don't verify mar file hash
when using mar signing to verify the mar file (lessens main thread I/O)."

We kept the addition to the AppConstants API in case other JS code
references it in the future.
parent 1f3ac3f7
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -3534,13 +3534,6 @@ Downloader.prototype = {
    }

    LOG("Downloader:_verifyDownload downloaded size == expected size.");

    // The hash check is not necessary when mar signatures are used to verify
    // the downloaded mar file.
    if (AppConstants.MOZ_VERIFY_MAR_SIGNATURE) {
      return true;
    }

    let fileStream = Cc["@mozilla.org/network/file-input-stream;1"].
                     createInstance(Ci.nsIFileInputStream);
    fileStream.init(destination, FileUtils.MODE_RDONLY, FileUtils.PERMS_FILE, 0);
+2 −2
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>

<window title="Update Wizard pages: update check, basic, download, and errors (partial patch with an invalid size)"
<window title="Update Wizard pages: update check, basic, download, and errors (partial patch with an invalid hash)"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        onload="runTestDefault();">
<script type="application/javascript"
@@ -35,7 +35,7 @@ function runTest() {
  debugDump("entering");

  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&partialPatchOnly=1" +
            "&invalidPartialSize=1" + getVersionParams();
            "&invalidPartialHash=1" + getVersionParams();
  setUpdateURL(url);

  gUP.checkForUpdates();
+2 −2
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>

<window title="Update Wizard pages: update check, basic, download, and errors (complete patch with an invalid size)"
<window title="Update Wizard pages: update check, basic, download, and errors (complete patch with an invalid hash)"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        onload="runTestDefault();">
<script type="application/javascript"
@@ -35,7 +35,7 @@ function runTest() {
  debugDump("entering");

  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&completePatchOnly=1" +
            "&invalidCompleteSize=1" + getVersionParams();
            "&invalidCompleteHash=1" + getVersionParams();
  setUpdateURL(url);

  gUP.checkForUpdates();
+3 −3
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>

<window title="Update Wizard pages: update check, basic, download, and errors (partial and complete patches with invalid sizes)"
<window title="Update Wizard pages: update check, basic, download, and errors (partial and complete patches with invalid hashes)"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        onload="runTestDefault();">
<script type="application/javascript"
@@ -34,8 +34,8 @@ const TESTS = [ {
function runTest() {
  debugDump("entering");

  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&invalidPartialSize=1" +
            "&invalidCompleteSize=1" + getVersionParams();
  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&invalidPartialHash=1" +
            "&invalidCompleteHash=1" + getVersionParams();
  setUpdateURL(url);

  gUP.checkForUpdates();
+2 −2
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>

<window title="Update Wizard pages: update check, basic, download, and finished (partial patch with an invalid size and successful complete patch)"
<window title="Update Wizard pages: update check, basic, download, and finished (partial patch with an invalid hash and successful complete patch)"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        onload="runTestDefault();">
<script type="application/javascript"
@@ -34,7 +34,7 @@ const TESTS = [ {
function runTest() {
  debugDump("entering");

  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&invalidPartialSize=1" +
  let url = URL_HTTP_UPDATE_XML + "?showDetails=1&invalidPartialHash=1" +
            getVersionParams();
  setUpdateURL(url);

Loading