зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1811633 - use updated, vendored version of PKI.js, remove old version 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
This commit is contained in:
Родитель
27dea1181b
Коммит
78cdb5eb07
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 };
|
||||
});
|
||||
|
|
|
@ -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"
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
/* 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/. */
|
||||
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
sourceType: "module",
|
||||
},
|
||||
env: {
|
||||
node: true,
|
||||
},
|
||||
globals: {
|
||||
asn1js: true,
|
||||
pvutils: true,
|
||||
pkijs: true,
|
||||
},
|
||||
};
|
|
@ -1,14 +0,0 @@
|
|||
# Certificate Viewer
|
||||
|
||||
## Dependencies
|
||||
|
||||
[PKI.js](https://github.com/PeculiarVentures/PKI.js)
|
||||
[ASN1.js](https://github.com/PeculiarVentures/ASN1.js)
|
||||
[pvutils.js](https://github.com/PeculiarVentures/pvutils)
|
||||
[Browserify](http://browserify.org/)
|
||||
|
||||
## Updating dependencies
|
||||
|
||||
Install all the dependencies doing `npm i`.
|
||||
|
||||
Run `npm run build` any time you add something new to `pvutils.js`, `pkijs.js`, `asn1.js` or any other file required in that one.
|
|
@ -1,9 +0,0 @@
|
|||
/* 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/. */
|
||||
|
||||
const asn1js = require("asn1js"); // version 2.0.22
|
||||
|
||||
module.exports = {
|
||||
asn1js,
|
||||
};
|
|
@ -1,19 +0,0 @@
|
|||
#!/bin/bash
|
||||
# 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 https://mozilla.org/MPL/2.0/.
|
||||
|
||||
# Helper script to bundle the given library and amend it to be loadable in more
|
||||
# contexts.
|
||||
|
||||
WHICH="${1}"
|
||||
|
||||
# Run the browserify command
|
||||
./node_modules/browserify/bin/cmd.js "$WHICH".js --standalone "$WHICH" -o ./vendor/"$WHICH"_bundle.jsm
|
||||
|
||||
# Amend 'this' in the first line to 'globalThis'
|
||||
sed -e '1s/{g=this}/{g=globalThis}/' -i "" ./vendor/"$WHICH"_bundle.jsm
|
||||
|
||||
# Append code to export the library
|
||||
echo "var $WHICH = globalThis.$WHICH;" >> ./vendor/"$WHICH"_bundle.jsm
|
||||
echo "var EXPORTED_SYMBOLS = [\"$WHICH\"];" >> ./vendor/"$WHICH"_bundle.jsm
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -11,9 +11,9 @@
|
|||
<meta name="color-scheme" content="light dark" />
|
||||
<link rel="localization" href="toolkit/about/certviewer.ftl">
|
||||
<link rel="localization" href="branding/brand.ftl">
|
||||
<script type="module" src="chrome://global/content/certviewer/certviewer.js"></script>
|
||||
<script type="module" src="chrome://global/content/certviewer/components/certificate-section.js"></script>
|
||||
<script type="module" src="chrome://global/content/certviewer/components/about-certificate-section.js"></script>
|
||||
<script type="module" src="chrome://global/content/certviewer/certviewer.mjs"></script>
|
||||
<script type="module" src="chrome://global/content/certviewer/components/certificate-section.mjs"></script>
|
||||
<script type="module" src="chrome://global/content/certviewer/components/about-certificate-section.mjs"></script>
|
||||
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css">
|
||||
<link rel="stylesheet" href="chrome://global/content/certviewer/certviewer.css">
|
||||
<title id="certTitle">about:certificate</title>
|
||||
|
|
|
@ -4,26 +4,11 @@
|
|||
|
||||
/* eslint-env mozilla/remote-page */
|
||||
|
||||
"use strict";
|
||||
|
||||
import { normalizeToKebabCase } from "./components/utils.js";
|
||||
|
||||
import "chrome://global/content/certviewer/pvutils_bundle.jsm";
|
||||
import "chrome://global/content/certviewer/asn1js_bundle.jsm";
|
||||
import "chrome://global/content/certviewer/pkijs_bundle.jsm";
|
||||
import "chrome://global/content/certviewer/certDecoder.jsm";
|
||||
|
||||
const { Integer, fromBER } = globalThis.asn1js.asn1js;
|
||||
const { Certificate } = globalThis.pkijs.pkijs;
|
||||
const { fromBase64, stringToArrayBuffer } = globalThis.pvutils.pvutils;
|
||||
const { parse, pemToDER } = globalThis.certDecoderInitializer(
|
||||
Integer,
|
||||
fromBER,
|
||||
Certificate,
|
||||
fromBase64,
|
||||
stringToArrayBuffer,
|
||||
crypto
|
||||
);
|
||||
import { normalizeToKebabCase } from "./components/utils.mjs";
|
||||
import {
|
||||
parse,
|
||||
pemToDER,
|
||||
} from "chrome://global/content/certviewer/certDecoder.mjs";
|
||||
|
||||
document.addEventListener("DOMContentLoaded", async e => {
|
||||
let url = new URL(document.URL);
|
||||
|
@ -378,15 +363,18 @@ export const adjustCertInformation = cert => {
|
|||
items.push(createEntryItem("value", entry.value));
|
||||
if (entry.qualifiers) {
|
||||
entry.qualifiers.forEach(qualifier => {
|
||||
if (qualifier.name && qualifier.id) {
|
||||
if (qualifier.qualifierName && qualifier.qualifierId) {
|
||||
items.push(
|
||||
createEntryItem(
|
||||
"qualifier",
|
||||
qualifier.name + " ( " + qualifier.id + " )"
|
||||
qualifier.qualifierName +
|
||||
" ( " +
|
||||
qualifier.qualifierId +
|
||||
" )"
|
||||
)
|
||||
);
|
||||
}
|
||||
items.push(createEntryItem("value", qualifier.value));
|
||||
items.push(createEntryItem("value", qualifier.qualifierValue));
|
||||
});
|
||||
}
|
||||
});
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
/* eslint-env mozilla/remote-page */
|
||||
|
||||
import { ListItem } from "./list-item.js";
|
||||
import { ListItem } from "./list-item.mjs";
|
||||
|
||||
export class AboutCertificateItems extends HTMLElement {
|
||||
constructor(id, data) {
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
/* eslint-env mozilla/remote-page */
|
||||
|
||||
import { InfoGroupContainer } from "./info-group-container.js";
|
||||
import { CertificateTabsSection } from "./certificate-tabs-section.js";
|
||||
import { InfoGroupContainer } from "./info-group-container.mjs";
|
||||
import { CertificateTabsSection } from "./certificate-tabs-section.mjs";
|
||||
|
||||
const TYPE_CA = 1;
|
||||
const TYPE_USER = 2;
|
|
@ -2,9 +2,9 @@
|
|||
* 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/. */
|
||||
|
||||
import { ErrorSection } from "./error-section.js";
|
||||
import { InfoGroupContainer } from "./info-group-container.js";
|
||||
import { CertificateTabsSection } from "./certificate-tabs-section.js";
|
||||
import { ErrorSection } from "./error-section.mjs";
|
||||
import { InfoGroupContainer } from "./info-group-container.mjs";
|
||||
import { CertificateTabsSection } from "./certificate-tabs-section.mjs";
|
||||
|
||||
class CertificateSection extends HTMLElement {
|
||||
constructor(certs, error) {
|
|
@ -2,8 +2,8 @@
|
|||
* 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/. */
|
||||
|
||||
import { normalizeToKebabCase } from "./utils.js";
|
||||
import { updateSelectedItem } from "../certviewer.js";
|
||||
import { normalizeToKebabCase } from "./utils.mjs";
|
||||
import { updateSelectedItem } from "../certviewer.mjs";
|
||||
|
||||
export class CertificateTabsSection extends HTMLElement {
|
||||
constructor(isAboutCertificate) {
|
||||
|
@ -59,7 +59,7 @@ export class CertificateTabsSection extends HTMLElement {
|
|||
|
||||
// If it is the first tab, allow it to be tabbable by the user.
|
||||
// If it isn't the first tab, do not allow tab functionality,
|
||||
// as arrow functionality is implemented in certviewer.js.
|
||||
// as arrow functionality is implemented in certviewer.mjs.
|
||||
if (i === 0) {
|
||||
tab.classList.add("selected");
|
||||
tab.setAttribute("tabindex", 0);
|
|
@ -2,8 +2,8 @@
|
|||
* 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/. */
|
||||
|
||||
import { InfoGroup } from "./info-group.js";
|
||||
import { AboutCertificateItems } from "./about-certificate-items.js";
|
||||
import { InfoGroup } from "./info-group.mjs";
|
||||
import { AboutCertificateItems } from "./about-certificate-items.mjs";
|
||||
|
||||
export class InfoGroupContainer extends HTMLElement {
|
||||
constructor(isAboutCertificate = false) {
|
|
@ -2,9 +2,9 @@
|
|||
* 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/. */
|
||||
|
||||
import { InfoItem } from "./info-item.js";
|
||||
import { updateSelectedItem } from "../certviewer.js";
|
||||
import { normalizeToKebabCase } from "./utils.js";
|
||||
import { InfoItem } from "./info-item.mjs";
|
||||
import { updateSelectedItem } from "../certviewer.mjs";
|
||||
import { normalizeToKebabCase } from "./utils.mjs";
|
||||
|
||||
export class InfoGroup extends HTMLElement {
|
||||
constructor(item, final) {
|
|
@ -2,7 +2,7 @@
|
|||
* 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/. */
|
||||
|
||||
import { b64ToPEM, normalizeToKebabCase } from "./utils.js";
|
||||
import { b64ToPEM, normalizeToKebabCase } from "./utils.mjs";
|
||||
|
||||
export class InfoItem extends HTMLElement {
|
||||
constructor(item) {
|
|
@ -2,7 +2,7 @@
|
|||
* 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/. */
|
||||
|
||||
import { normalizeToKebabCase } from "./utils.js";
|
||||
import { normalizeToKebabCase } from "./utils.mjs";
|
||||
|
||||
export class ListItem extends HTMLElement {
|
||||
constructor(item) {
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"name": "certviewer",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"build-pvutils": "./bundle.sh pvutils",
|
||||
"build-asn1js": "./bundle.sh asn1js",
|
||||
"build-pkijs": "./bundle.sh pkijs",
|
||||
"build": "npm run build-pvutils && npm run build-asn1js && npm run build-pkijs"
|
||||
},
|
||||
"license": "MPL-2.0",
|
||||
"dependencies": {
|
||||
"asn1js": "^2.0.22",
|
||||
"pkijs": "^2.1.81",
|
||||
"pvutils": "^1.0.17"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^16.2.3"
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
/* 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/. */
|
||||
|
||||
const pkijs = require("pkijs"); // version 2.1.78
|
||||
|
||||
module.exports = {
|
||||
pkijs,
|
||||
};
|
|
@ -1,9 +0,0 @@
|
|||
/* 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/. */
|
||||
|
||||
const pvutils = require("pvutils"); // version 1.0.17
|
||||
|
||||
module.exports = {
|
||||
pvutils,
|
||||
};
|
|
@ -5,10 +5,8 @@
|
|||
toolkit.jar:
|
||||
content/global/certviewer/certviewer.html (content/certviewer.html)
|
||||
content/global/certviewer/certviewer.css (content/certviewer.css)
|
||||
content/global/certviewer/certviewer.js (content/certviewer.js)
|
||||
content/global/certviewer/components/ (content/components/*.js)
|
||||
content/global/certviewer/certviewer.mjs (content/certviewer.mjs)
|
||||
content/global/certviewer/components/ (content/components/*.mjs)
|
||||
content/global/certviewer/components/ (content/components/*.css)
|
||||
content/global/certviewer/certDecoder.jsm (content/certDecoder.jsm)
|
||||
content/global/certviewer/pvutils_bundle.jsm (content/vendor/pvutils_bundle.jsm)
|
||||
content/global/certviewer/asn1js_bundle.jsm (content/vendor/asn1js_bundle.jsm)
|
||||
content/global/certviewer/pkijs_bundle.jsm (content/vendor/pkijs_bundle.jsm)
|
||||
content/global/certviewer/certDecoder.mjs (content/certDecoder.mjs)
|
||||
content/global/certviewer/vendor/pkijs.js (content/vendor/pkijs.js)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
/*
|
||||
To change this file you will have to add a function to download a file in toolkit/components/certviewer/content/certviewer.js (e.g: https://ourcodeworld.com/articles/read/189/how-to-create-a-file-and-generate-a-download-with-javascript-in-the-browser-without-a-server),
|
||||
download adjustedCerts (e.g: download("out.txt", JSON.stringify(adjustedCerts)), do it after this line https://searchfox.org/mozilla-central/rev/e3fc8f8970491aef14d3212b2d052942f4d29818/toolkit/components/certviewer/content/certviewer.js#428),
|
||||
To change this file you will have to add a function to download a file in toolkit/components/certviewer/content/certviewer.mjs (e.g: https://ourcodeworld.com/articles/read/189/how-to-create-a-file-and-generate-a-download-with-javascript-in-the-browser-without-a-server),
|
||||
download adjustedCerts (e.g: download("out.txt", JSON.stringify(adjustedCerts)), do it after this line https://searchfox.org/mozilla-central/rev/e3fc8f8970491aef14d3212b2d052942f4d29818/toolkit/components/certviewer/content/certviewer.mjs#428),
|
||||
then open Nightly and go to about:certificate?cert=MIIHQjCCBiqgAwIBAgIQCgYwQn9bvO1pVzllk7ZFHzANBgkqhkiG9w0BAQsFADB1MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMTQwMgYDVQQDEytEaWdpQ2VydCBTSEEyIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VydmVyIENBMB4XDTE4MDUwODAwMDAwMFoXDTIwMDYwMzEyMDAwMFowgccxHTAbBgNVBA8MFFByaXZhdGUgT3JnYW5pemF0aW9uMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRkwFwYLKwYBBAGCNzwCAQITCERlbGF3YXJlMRAwDgYDVQQFEwc1MTU3NTUwMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEVMBMGA1UEChMMR2l0SHViLCBJbmMuMRMwEQYDVQQDEwpnaXRodWIuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxjyq8jyXDDrBTyitcnB90865tWBzpHSbindG%2FXqYQkzFMBlXmq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3AKPDWYBPkb37jjd80OyA3cEAAAAWNBYm0KAAAEAwBHMEUCIQDRZp38cTWsWH2GdBpe%2FuPTWnsu%2Fm4BEC2%2BdIcvSykZYgIgCP5gGv6yzaazxBK2NwGdmmyuEFNSg2pARbMJlUFgU5UAdgBWFAaaL9fC7NP14b1Esj7HRna5vJkRXMDvlJhV1onQ3QAAAWNBYm0tAAAEAwBHMEUCIQCi7omUvYLm0b2LobtEeRAYnlIo7n6JxbYdrtYdmPUWJQIgVgw1AZ51vK9ENinBg22FPxb82TvNDO05T17hxXRC2IYAdgC72d%2B8H4pxtZOUI5eqkntHOFeVCqtS6BqQlmQ2jh7RhQAAAWNBYm3fAAAEAwBHMEUCIQChzdTKUU2N%2BXcqcK0OJYrN8EYynloVxho4yPk6Dq3EPgIgdNH5u8rC3UcslQV4B9o0a0w204omDREGKTVuEpxGeOQwDQYJKoZIhvcNAQELBQADggEBAHAPWpanWOW%2Fip2oJ5grAH8mqQfaunuCVE%2Bvac%2B88lkDK%2FLVdFgl2B6kIHZiYClzKtfczG93hWvKbST4NRNHP9LiaQqdNC17e5vNHnXVUGw%2ByxyjMLGqkgepOnZ2Rb14kcTOGp4i5AuJuuaMwXmCo7jUwPwfLe1NUlVBKqg6LK0Hcq4K0sZnxE8HFxiZ92WpV2AVWjRMEc%2F2z2shNoDvxvFUYyY1Oe67xINkmyQKc%2BygSBZzyLnXSFVWmHr3u5dcaaQGGAR42v6Ydr4iL38Hd4dOiBma%2BFXsXBIqWUjbST4VXmdaol7uzFMojA4zkxQDZAvF5XgJlAFadfySna%2Fteik%3D
|
||||
open the file, and finally copy and paste it here like
|
||||
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
sourceType: "module",
|
||||
},
|
||||
};
|
|
@ -35,9 +35,9 @@ export const certOutputCS = [
|
|||
name: "ANSI Organizational Identifier",
|
||||
qualifiers: [
|
||||
{
|
||||
id: "1.3.6.1.5.5.7.2.1",
|
||||
name: "Practices Statement",
|
||||
value: "https://www.digicert.com/CPS",
|
||||
qualifierId: "1.3.6.1.5.5.7.2.1",
|
||||
qualifierName: "Practices Statement",
|
||||
qualifierValue: "https://www.digicert.com/CPS",
|
||||
},
|
||||
],
|
||||
value: "2.16.840.1.114412.1.1",
|
|
@ -2,11 +2,11 @@
|
|||
scheme=https
|
||||
[test_adjustCertInformation.html]
|
||||
support-files =
|
||||
parseOutput.js
|
||||
parseOutput.mjs
|
||||
[test_certDecoder.html]
|
||||
[test_certDecoderFields.html]
|
||||
support-files =
|
||||
CSoutput.js
|
||||
CSoutput.mjs
|
||||
[test_kebabCaseInAdjustCertInformation.html]
|
||||
support-files =
|
||||
parseOutput.js
|
||||
parseOutput.mjs
|
||||
|
|
|
@ -8,9 +8,6 @@
|
|||
</head>
|
||||
<body>
|
||||
<script type="module">
|
||||
import { adjustCertInformation } from "chrome://global/content/certviewer/certviewer.js";
|
||||
import { parseOutput } from "./parseOutput.js";
|
||||
|
||||
function hasNullElements(obj) {
|
||||
for (let key of Object.keys(obj)) {
|
||||
if (obj[key] == null) return false;
|
||||
|
@ -24,6 +21,9 @@
|
|||
}
|
||||
|
||||
async function doTest() {
|
||||
const { adjustCertInformation } = await import("chrome://global/content/certviewer/certviewer.mjs");
|
||||
const { parseOutput } = await import("./parseOutput.mjs");
|
||||
|
||||
ok(adjustCertInformation, "adjustCertInformation should be available in this context");
|
||||
ok(parseOutput, "parseOutput should be available in this context");
|
||||
is(typeof(parseOutput), 'object', "parseOutput must be an object");
|
||||
|
|
|
@ -8,30 +8,14 @@
|
|||
</head>
|
||||
<body>
|
||||
<script type="module">
|
||||
import "chrome://global/content/certviewer/pvutils_bundle.jsm";
|
||||
import "chrome://global/content/certviewer/asn1js_bundle.jsm";
|
||||
import "chrome://global/content/certviewer/pkijs_bundle.jsm";
|
||||
import "chrome://global/content/certviewer/certDecoder.jsm";
|
||||
|
||||
const { Integer, fromBER } = globalThis.asn1js.asn1js;
|
||||
const { Certificate } = globalThis.pkijs.pkijs;
|
||||
const { fromBase64, stringToArrayBuffer } = globalThis.pvutils.pvutils;
|
||||
|
||||
const { parse, pemToDER } = globalThis.certDecoderInitializer(
|
||||
Integer,
|
||||
fromBER,
|
||||
Certificate,
|
||||
fromBase64,
|
||||
stringToArrayBuffer,
|
||||
crypto
|
||||
);
|
||||
|
||||
// inputPEM is the same input to CS extension (https://github.com/april/certainly-something)
|
||||
const inputPEM = "MIIGRjCCBS6gAwIBAgIQDJduPkI49CDWPd+G7+u6kDANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5EaWdpQ2VydCBTSEEyIFNlY3VyZSBTZXJ2ZXIgQ0EwHhcNMTgxMTA1MDAwMDAwWhcNMTkxMTEzMTIwMDAwWjCBgzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxHDAaBgNVBAoTE01vemlsbGEgQ29ycG9yYXRpb24xDzANBgNVBAsTBldlYk9wczEYMBYGA1UEAxMPd3d3Lm1vemlsbGEub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuKruymkkmkqCJh7QjmXlUOBcLFRyw5LG/vUUWVrsxC2gsbR8WJq+cYoYBpoNVStKrO4U2rBh1GEbccvT6qKOQI+pjjDxx9cmRdubGTGp8L0MF1ohVvhIvYLumOEoRDDPU4PvGJjGhek/ojvedPWe8dhciHkxOC2qPFZvVFMwg1/o/b80147BwZQmzB18mnHsmcyKlpsCN8pxw86uao9Iun8gZQrsllW64rTZlRR56pHdAcuGAoZjYZxwS9Z+lvrSjEgrddemWyGGalqyFp1rXlVM1Tf4/IYWAQXTgTUN303u3xMjss7QK7eUDsACRxiWPLW9XQDd1c+yvaYJKzgJ2wIDAQABo4IC6TCCAuUwHwYDVR0jBBgwFoAUD4BhHIIxYdUvKOeN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0Agw8AAAFm5haJAgAABAMARjBEAiAxGLXkUaOAkZhXNeNR3pWyahZeKmSaMXadgu18%0D%0ASfK1ZAIgKtwu5eGxK76rgaszLCZ9edBIjuU0DKorzPUuxUXFY0QwDQYJKoZIhvcN%0D%0AAQELBQADggEBAKLJAFO3wuaP5MM/ed1lhk5Uc2aDokhcM7XyvdhEKSHbgPhcgMoT%0D%0A9YIVoPa70gNC6KHcwoXu0g8wt7X6Vm1ql/68G5q844kFuC6JPl4LVT9mciD+VW6b%0D%0AHUSXD9xifL9DqdJ0Ic0SllTlM+oq5aAeOxUQGXhXIqj6fSQv9fQN6mXxQIoc/gjx%0D%0Ateskq/Vl8YmY1FIZP9Bh7g27kxZ9GAAGQtjTL03RzKAuSg6yeImYVdQWasc7UPnB%0D%0AXlRAzZ8+OJThUbzK16a2CI3Rg4agKSJk+uA47h1/ImmngpFLRb/MvRX6H1oWcUuy%0D%0AH6O7PZdl0YpwTpw1THIuqCGl/wpPgyQgcTM=%0D%0A-----END%20CERTIFICATE-----%0D%0A";
|
||||
|
||||
|
||||
async function doTest() {
|
||||
const { parse, pemToDER } = await import("chrome://global/content/certviewer/certDecoder.mjs");
|
||||
|
||||
ok(parse, "parse should be available in this context");
|
||||
ok(pemToDER, "pemToDER should be available in this context");
|
||||
|
||||
|
|
|
@ -4,37 +4,21 @@
|
|||
<title>certviewer parse test</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="module" src="CSoutput.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<script type="module">
|
||||
import "chrome://global/content/certviewer/pvutils_bundle.jsm";
|
||||
import "chrome://global/content/certviewer/asn1js_bundle.jsm";
|
||||
import "chrome://global/content/certviewer/pkijs_bundle.jsm";
|
||||
import "chrome://global/content/certviewer/certDecoder.jsm";
|
||||
|
||||
const { Integer, fromBER } = globalThis.asn1js.asn1js;
|
||||
const { Certificate } = globalThis.pkijs.pkijs;
|
||||
const { fromBase64, stringToArrayBuffer } = globalThis.pvutils.pvutils;
|
||||
|
||||
const { parse, pemToDER } = globalThis.certDecoderInitializer(
|
||||
Integer,
|
||||
fromBER,
|
||||
Certificate,
|
||||
fromBase64,
|
||||
stringToArrayBuffer,
|
||||
crypto
|
||||
);
|
||||
|
||||
import { certOutputCS } from "./CSoutput.js";
|
||||
|
||||
// inputPEM is the same input to CS extension (https://github.com/april/certainly-something)
|
||||
const inputPEM = "MIIGRjCCBS6gAwIBAgIQDJduPkI49CDWPd+G7+u6kDANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5EaWdpQ2VydCBTSEEyIFNlY3VyZSBTZXJ2ZXIgQ0EwHhcNMTgxMTA1MDAwMDAwWhcNMTkxMTEzMTIwMDAwWjCBgzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxHDAaBgNVBAoTE01vemlsbGEgQ29ycG9yYXRpb24xDzANBgNVBAsTBldlYk9wczEYMBYGA1UEAxMPd3d3Lm1vemlsbGEub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuKruymkkmkqCJh7QjmXlUOBcLFRyw5LG/vUUWVrsxC2gsbR8WJq+cYoYBpoNVStKrO4U2rBh1GEbccvT6qKOQI+pjjDxx9cmRdubGTGp8L0MF1ohVvhIvYLumOEoRDDPU4PvGJjGhek/ojvedPWe8dhciHkxOC2qPFZvVFMwg1/o/b80147BwZQmzB18mnHsmcyKlpsCN8pxw86uao9Iun8gZQrsllW64rTZlRR56pHdAcuGAoZjYZxwS9Z+lvrSjEgrddemWyGGalqyFp1rXlVM1Tf4/IYWAQXTgTUN303u3xMjss7QK7eUDsACRxiWPLW9XQDd1c+yvaYJ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a2CI3Rg4agKSJk+uA47h1/ImmngpFLRb/MvRX6H1oWcUuyH6O7PZdl0YpwTpw1THIuqCGl/wpPgyQgcTM=";
|
||||
|
||||
async function run(input, expected) {
|
||||
const { parse, pemToDER } = await import("chrome://global/content/certviewer/certDecoder.mjs");
|
||||
|
||||
ok(parse, "parse should be available in this context");
|
||||
ok(pemToDER, "pemToDER should be available in this context");
|
||||
|
||||
let certDER;
|
||||
try {
|
||||
certDER = pemToDER(input);
|
||||
|
@ -68,8 +52,8 @@
|
|||
}
|
||||
|
||||
async function doTest() {
|
||||
ok(parse, "parse should be available in this context");
|
||||
ok(pemToDER, "pemToDER should be available in this context");
|
||||
const { certOutputCS } = await import("./CSoutput.mjs");
|
||||
|
||||
ok(certOutputCS, "certOutputCS should be available in this context");
|
||||
is(typeof(certOutputCS), 'object', "certOutputCS must be an object");
|
||||
|
||||
|
|
|
@ -8,9 +8,6 @@
|
|||
</head>
|
||||
<body>
|
||||
<script type="module">
|
||||
import { adjustCertInformation } from "chrome://global/content/certviewer/certviewer.js";
|
||||
import { parseOutput } from "./parseOutput.js";
|
||||
|
||||
function isKebabCase(str) {
|
||||
if (str === "") return true;
|
||||
return /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.test(str);
|
||||
|
@ -79,6 +76,9 @@
|
|||
}
|
||||
|
||||
async function doTest() {
|
||||
const { adjustCertInformation } = await import("chrome://global/content/certviewer/certviewer.mjs");
|
||||
const { parseOutput } = await import("./parseOutput.mjs");
|
||||
|
||||
ok(adjustCertInformation, "adjustCertInformation should be available in this context");
|
||||
ok(parseOutput, "parseOutput should be available in this context");
|
||||
is(typeof(parseOutput), 'object', "parseOutput must be an object");
|
||||
|
|
|
@ -5,22 +5,10 @@
|
|||
/* eslint-env mozilla/remote-page */
|
||||
/* eslint-disable import/no-unassigned-import */
|
||||
|
||||
import "chrome://global/content/certviewer/pvutils_bundle.jsm";
|
||||
import "chrome://global/content/certviewer/asn1js_bundle.jsm";
|
||||
import "chrome://global/content/certviewer/pkijs_bundle.jsm";
|
||||
import "chrome://global/content/certviewer/certDecoder.jsm";
|
||||
|
||||
const { Integer, fromBER } = globalThis.asn1js.asn1js;
|
||||
const { Certificate } = globalThis.pkijs.pkijs;
|
||||
const { fromBase64, stringToArrayBuffer } = globalThis.pvutils.pvutils;
|
||||
const { parse, pemToDER } = globalThis.certDecoderInitializer(
|
||||
Integer,
|
||||
fromBER,
|
||||
Certificate,
|
||||
fromBase64,
|
||||
stringToArrayBuffer,
|
||||
crypto
|
||||
);
|
||||
import {
|
||||
parse,
|
||||
pemToDER,
|
||||
} from "chrome://global/content/certviewer/certDecoder.mjs";
|
||||
|
||||
const formatter = new Intl.DateTimeFormat();
|
||||
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
{
|
||||
"chrome://devtools-startup/content/DevToolsShim.jsm":
|
||||
"devtools/startup/DevToolsShim.jsm",
|
||||
"chrome://global/content/certviewer/asn1js_bundle.jsm":
|
||||
"toolkit/components/certviewer/content/vendor/asn1js_bundle.jsm",
|
||||
"chrome://global/content/certviewer/certDecoder.jsm":
|
||||
"toolkit/components/certviewer/content/certDecoder.jsm",
|
||||
"chrome://global/content/certviewer/pkijs_bundle.jsm":
|
||||
"toolkit/components/certviewer/content/vendor/pkijs_bundle.jsm",
|
||||
"chrome://global/content/certviewer/pvutils_bundle.jsm":
|
||||
"toolkit/components/certviewer/content/vendor/pvutils_bundle.jsm",
|
||||
"chrome://global/content/tabprompts.jsm":
|
||||
"toolkit/components/prompts/content/tabprompts.jsm",
|
||||
"chrome://mochikit/content/ShutdownLeaksCollector.jsm":
|
||||
|
|
Загрузка…
Ссылка в новой задаче