bug 1351604 - don't ship DER.jsm and X509.jsm until they're actually used in production r?Cykesiopka
MozReview-Commit-ID: 2DlMrB5TfKU
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,9 +17,9 @@
#
# Modifying this file will now automatically clobber the buildbot machines \o/
#
# Are you updating CLOBBER because you think it's needed for your WebIDL
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
-Bug 1337331 - Required because of removed cc files like security/sandbox/chromium/base/threading/platform_thread_linux.cc
+Bug 1351604 - required because DER.jsm and X509.jsm are no longer shipped with the browser
--- a/browser/base/content/test/static/browser_all_files_referenced.js
+++ b/browser/base/content/test/static/browser_all_files_referenced.js
@@ -252,18 +252,16 @@ var whitelist = new Set([
// Bug 1351093
{file: "resource://gre/modules/Sntp.jsm"},
// Bug 1351980
{file: "resource://gre/modules/UserAgentOverrides.jsm"},
// Bug 1351097
{file: "resource://gre/modules/accessibility/AccessFu.jsm"},
// Bug 1351099
{file: "resource://gre/modules/addons/AddonLogging.jsm"},
- // Bug 1351604
- {file: "resource://gre/modules/psm/X509.jsm"},
// Bug 1351637
{file: "resource://gre/modules/sdk/bootstrap.js"},
// Bug 1351657
{file: "resource://gre/res/langGroups.properties", platforms: ["macosx"]},
].filter(item =>
("isFromDevTools" in item) == isDevtools &&
(!item.platforms || item.platforms.includes(AppConstants.platform))
--- a/security/manager/ssl/X509.jsm
+++ b/security/manager/ssl/X509.jsm
@@ -1,16 +1,18 @@
/* 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/. */
"use strict";
const Cu = Components.utils;
-var { DER } = Cu.import("resource://gre/modules/psm/DER.jsm", {});
+// Until DER.jsm is actually used in production code, this is where we have to
+// import it from.
+var { DER } = Cu.import("resource://testing-common/psm/DER.jsm", {});
const ERROR_UNSUPPORTED_ASN1 = "unsupported asn.1";
const ERROR_TIME_NOT_VALID = "Time not valid";
const ERROR_LIBRARY_FAILURE = "library failure";
const X509v3 = 2;
/**
--- a/security/manager/ssl/moz.build
+++ b/security/manager/ssl/moz.build
@@ -50,17 +50,19 @@ XPIDL_SOURCES += [
if CONFIG['MOZ_XUL']:
XPIDL_SOURCES += [
'nsICertTree.idl',
]
XPIDL_MODULE = 'pipnss'
-EXTRA_JS_MODULES.psm += [
+# These aren't actually used in production code yet, so we don't want to
+# ship them with the browser.
+TESTING_JS_MODULES.psm += [
'DER.jsm',
'X509.jsm',
]
EXPORTS += [
'CryptoTask.h',
'nsClientAuthRemember.h',
'nsCrypto.h',
--- a/security/manager/ssl/tests/unit/test_der.js
+++ b/security/manager/ssl/tests/unit/test_der.js
@@ -1,16 +1,18 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests DER.jsm functionality.
-var { DER } = Cu.import("resource://gre/modules/psm/DER.jsm", {});
+// Until DER.jsm is actually used in production code, this is where we have to
+// import it from.
+var { DER } = Cu.import("resource://testing-common/psm/DER.jsm", {});
function run_simple_tests() {
throws(() => new DER.DER("this is not an array"), /invalid input/,
"should throw given non-array input");
throws(() => new DER.DER([0, "invalid input", 1]), /invalid input/,
"should throw given non-byte data (string case)");
throws(() => new DER.DER([31, 1, {}]), /invalid input/,
"should throw given non-byte data (object case)");
--- a/security/manager/ssl/tests/unit/test_x509.js
+++ b/security/manager/ssl/tests/unit/test_x509.js
@@ -1,16 +1,18 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests X509.jsm functionality.
-var { X509 } = Cu.import("resource://gre/modules/psm/X509.jsm", {});
+// Until X509.jsm is actually used in production code, this is where we have to
+// import it from.
+var { X509 } = Cu.import("resource://testing-common/psm/X509.jsm", {});
function stringToBytes(s) {
let b = [];
for (let i = 0; i < s.length; i++) {
b.push(s.charCodeAt(i));
}
return b;
}