Bug 1371762 Part 1 Let cert shim code selectively identify some xpis as privileged r=rhelmer
authorAndrew Swan <aswan@mozilla.com>
Wed, 19 Jul 2017 10:27:21 -0700
changeset 369974 47ebbbac4f990cca0dd681d18ff9be77bbb2fdca
parent 369973 0ee08a9803fc13145128cfa0625a63bd464ccd32
child 369975 7255faf1c8a4b0c34d6b01c1fe3af78444d1c750
push id46919
push userrhelmer@mozilla.com
push dateFri, 21 Jul 2017 00:26:55 +0000
treeherderautoland@7255faf1c8a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhelmer
bugs1371762
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1371762 Part 1 Let cert shim code selectively identify some xpis as privileged r=rhelmer MozReview-Commit-ID: L628sUEyHcL
toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
--- a/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
@@ -499,17 +499,21 @@ var AddonTestUtils = {
 
         try {
           let manifestURI = this.getManifestURI(file);
 
           let id = await this.getIDFromManifest(manifestURI);
 
           let fakeCert = {commonName: id};
           if (this.usePrivilegedSignatures) {
-            fakeCert.organizationalUnit = "Mozilla Extensions";
+            let privileged = typeof this.usePrivilegedSignatures == "function" ?
+                             this.usePrivilegedSignatures(id) : this.usePrivilegedSignatures;
+            if (privileged) {
+              fakeCert.organizationalUnit = "Mozilla Extensions";
+            }
           }
 
           return [callback, Cr.NS_OK, fakeCert];
         } catch (e) {
           // If there is any error then just pass along the original results
         } finally {
           // Make sure to close the open zip file or it will be locked.
           if (file.isFile())