Skip to content

Commit

Permalink
Bug 1811633 - use updated, vendored version of PKI.js, remove old ver…
Browse files Browse the repository at this point in the history
…sion r=Gijs

This also converts certDecoder.jsm to an ES module (as certDecoder.mjs) and
updates all uses of it.

Differential Revision: https://phabricator.services.mozilla.com/D167466
  • Loading branch information
mozkeeler committed Jan 27, 2023
1 parent 2f59e91 commit 4d2b1f7
Show file tree
Hide file tree
Showing 37 changed files with 1,342 additions and 1,592 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1716,8 +1716,8 @@ module.exports = {
"toolkit/components/antitracking/test/browser/head.js",
"toolkit/components/antitracking/test/browser/storageAccessAPIHelpers.js",
"toolkit/components/certviewer/tests/browser/adjustedCerts.js",
"toolkit/components/certviewer/tests/chrome/CSoutput.js",
"toolkit/components/certviewer/tests/chrome/parseOutput.js",
"toolkit/components/certviewer/tests/chrome/CSoutput.mjs",
"toolkit/components/certviewer/tests/chrome/parseOutput.mjs",
"toolkit/components/cleardata/tests/browser/browser_css_cache.js",
"toolkit/components/cleardata/tests/browser/browser_image_cache.js",
"toolkit/components/cleardata/tests/browser/browser_preflight_cache.js",
Expand Down
4 changes: 0 additions & 4 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,6 @@ gfx/wgpu/target
gfx/wgpu/.*/build
gfx/wr/target/

# Ignore this files in certviewer
toolkit/components/certviewer/content/node_modules/
toolkit/components/certviewer/content/package-lock.json

# Ignore Rust/Cargo output from running `cargo` directly for image_builder docker image
^taskcluster/docker/image_builder/build-image/target

Expand Down
28 changes: 4 additions & 24 deletions devtools/shared/network-observer/NetworkHelper.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,31 +73,11 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
NetUtil: "resource://gre/modules/NetUtil.jsm",
});

// It would make sense to put this in the above
// ChromeUtils.defineESModuleGetters, but that doesn't seem to work.
XPCOMUtils.defineLazyGetter(lazy, "certDecoder", () => {
const { asn1js } = ChromeUtils.import(
"chrome://global/content/certviewer/asn1js_bundle.jsm"
);
const { pkijs } = ChromeUtils.import(
"chrome://global/content/certviewer/pkijs_bundle.jsm"
);
const { pvutils } = ChromeUtils.import(
"chrome://global/content/certviewer/pvutils_bundle.jsm"
);

const { Integer, fromBER } = asn1js.asn1js;
const { Certificate } = pkijs.pkijs;
const { fromBase64, stringToArrayBuffer } = pvutils.pvutils;

const { certDecoderInitializer } = ChromeUtils.import(
"chrome://global/content/certviewer/certDecoder.jsm"
);
const { parse, pemToDER } = certDecoderInitializer(
Integer,
fromBER,
Certificate,
fromBase64,
stringToArrayBuffer,
crypto
const { parse, pemToDER } = ChromeUtils.importESModule(
"chrome://global/content/certviewer/certDecoder.mjs"
);
return { parse, pemToDER };
});
Expand Down
26 changes: 2 additions & 24 deletions security/manager/pki/resources/content/clientauthask.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,8 @@
/* import-globals-from pippki.js */
"use strict";

const { asn1js } = ChromeUtils.import(
"chrome://global/content/certviewer/asn1js_bundle.jsm"
);
const { pkijs } = ChromeUtils.import(
"chrome://global/content/certviewer/pkijs_bundle.jsm"
);
const { pvutils } = ChromeUtils.import(
"chrome://global/content/certviewer/pvutils_bundle.jsm"
);

const { Integer, fromBER } = asn1js.asn1js;
const { Certificate } = pkijs.pkijs;
const { fromBase64, stringToArrayBuffer } = pvutils.pvutils;

const { certDecoderInitializer } = ChromeUtils.import(
"chrome://global/content/certviewer/certDecoder.jsm"
);
const { parse, pemToDER } = certDecoderInitializer(
Integer,
fromBER,
Certificate,
fromBase64,
stringToArrayBuffer,
crypto
const { parse, pemToDER } = ChromeUtils.importESModule(
"chrome://global/content/certviewer/certDecoder.mjs"
);

/**
Expand Down
17 changes: 0 additions & 17 deletions toolkit/components/certviewer/content/.eslintrc.js

This file was deleted.

14 changes: 0 additions & 14 deletions toolkit/components/certviewer/content/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions toolkit/components/certviewer/content/asn1js.js

This file was deleted.

19 changes: 0 additions & 19 deletions toolkit/components/certviewer/content/bundle.sh

This file was deleted.

Loading

0 comments on commit 4d2b1f7

Please sign in to comment.