Bug 1470516 - remove or fix localized values in securityInfo, r?rpl
MozReview-Commit-ID: 3xURSfbPTmS
--- a/toolkit/components/extensions/schemas/web_request.json
+++ b/toolkit/components/extensions/schemas/web_request.json
@@ -184,20 +184,20 @@
"subject": {
"type": "string"
},
"issuer": {
"type": "string"
},
"validity": {
"type": "object",
- "description": "Contains start and end dates in GMT.",
+ "description": "Contains start and end timestamps.",
"properties": {
- "startGMT": { "type": "string" },
- "endGMT": { "type": "string" }
+ "start": { "type": "integer" },
+ "end": { "type": "integer" }
}
},
"fingerprint": {
"type": "object",
"properties": {
"sha1": { "type": "string" },
"sha256": { "type": "string" }
}
@@ -209,19 +209,16 @@
"type": "boolean"
},
"subjectPublicKeyInfoDigest": {
"type": "object",
"properties": {
"sha256": { "type": "string" }
}
},
- "keyUsages": {
- "type": "string"
- },
"rawDER": {
"optional": true,
"type": "array",
"items": {
"type": "integer"
}
}
}
--- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_hsts.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_hsts.html
@@ -32,16 +32,18 @@ function getExtension() {
"security info reflects https");
if (options.certificateChain) {
// Some of the tests here only produce a single cert in the chain.
browser.test.assertTrue(securityInfo.certificates.length >= 1, "have certificate chain");
} else {
browser.test.assertTrue(securityInfo.certificates.length == 1, "no certificate chain");
}
+ let cert = securityInfo.certificates[0];
+ browser.test.assertTrue(cert.validity.start < Date.now() < cert.validity.end, "cert validity is correct");
if (options.rawDER) {
for (let cert of securityInfo.certificates) {
browser.test.assertTrue(cert.rawDER.length > 0, "have rawDER");
}
}
}
browser.webRequest.onHeadersReceived.addListener(async (details) => {
--- a/toolkit/modules/addons/SecurityInfo.jsm
+++ b/toolkit/modules/addons/SecurityInfo.jsm
@@ -205,29 +205,28 @@ const SecurityInfo = {
if (!cert) {
return {};
}
let certData = {
subject: cert.subjectName,
issuer: cert.issuerName,
validity: {
- startGMT: cert.validity.notBeforeGMT,
- endGMT: cert.validity.notAfterGMT,
+ start: cert.validity.notBefore,
+ end: cert.validity.notAfter,
},
fingerprint: {
sha1: cert.sha1Fingerprint,
sha256: cert.sha256Fingerprint,
},
serialNumber: cert.serialNumber,
isBuiltInRoot: cert.isBuiltInRoot,
subjectPublicKeyInfoDigest: {
sha256: cert.sha256SubjectPublicKeyInfoDigest,
},
- keyUsages: cert.keyUsages,
};
if (options.rawDER) {
certData.rawDER = cert.getRawDER({});
}
return certData;
},
// Bug 1355903 Transparency is currently disabled using security.pki.certificate_transparency.mode