From a4341a67b5e30dd783c0b9fee2ab88282e7c9978 Mon Sep 17 00:00:00 2001 From: Kathy Brade Date: Fri, 20 May 2016 11:08:51 -0400 Subject: [PATCH] Bug 19121: reinstate the update.xml hash check This is a partial revert of commit f1241db6986e4b54473a1ed870f7584c75d51122. 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. --- toolkit/mozapps/update/nsUpdateService.js | 7 ------- .../test_0061_check_verifyFailPartial_noComplete.xul | 4 ++-- .../test_0062_check_verifyFailComplete_noPartial.xul | 4 ++-- .../test_0063_check_verifyFailPartialComplete.xul | 6 +++--- ...st_0064_check_verifyFailPartial_successComplete.xul | 4 ++-- .../test_0071_notify_verifyFailPartial_noComplete.xul | 4 ++-- .../test_0072_notify_verifyFailComplete_noPartial.xul | 4 ++-- .../test_0073_notify_verifyFailPartialComplete.xul | 6 +++--- ...t_0074_notify_verifyFailPartial_successComplete.xul | 4 ++-- ...test_0084_error_patchApplyFailure_verify_failed.xul | 2 +- toolkit/mozapps/update/tests/chrome/update.sjs | 10 +++++----- .../tests/unit_aus_update/downloadAndHashCheckMar.js | 8 +------- 12 files changed, 25 insertions(+), 38 deletions(-) diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js index 10eb1d100b235..43980aba95541 100644 --- a/toolkit/mozapps/update/nsUpdateService.js +++ b/toolkit/mozapps/update/nsUpdateService.js @@ -3554,13 +3554,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); diff --git a/toolkit/mozapps/update/tests/chrome/test_0061_check_verifyFailPartial_noComplete.xul b/toolkit/mozapps/update/tests/chrome/test_0061_check_verifyFailPartial_noComplete.xul index 1040c19e3a9c4..f4f486eb0480f 100644 --- a/toolkit/mozapps/update/tests/chrome/test_0061_check_verifyFailPartial_noComplete.xul +++ b/toolkit/mozapps/update/tests/chrome/test_0061_check_verifyFailPartial_noComplete.xul @@ -8,7 +8,7 @@ -