[tbb-commits] [tor-browser/tor-browser-60.3.0esr-8.5-1] Bug 1470516 - remove or fix localized values in securityInfo, r=rpl

gk at torproject.org gk at torproject.org
Mon Dec 3 16:18:46 UTC 2018


commit 05cbc6e53b30707e32af750eb082a90f715cbf95
Author: Shane Caraveo <scaraveo at mozilla.com>
Date:   Mon Jul 2 15:45:18 2018 -0300

    Bug 1470516 - remove or fix localized values in securityInfo, r=rpl
    
    MozReview-Commit-ID: 3xURSfbPTmS
    
    --HG--
    extra : rebase_source : aeb333a0c72120724a5a7d988f460e3c703b09c3
---
 toolkit/components/extensions/schemas/web_request.json           | 9 +++------
 .../extensions/test/mochitest/test_ext_webrequest_hsts.html      | 2 ++
 toolkit/modules/addons/SecurityInfo.jsm                          | 5 ++---
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/toolkit/components/extensions/schemas/web_request.json b/toolkit/components/extensions/schemas/web_request.json
index ed1840cabe2a..508ca8b05f8f 100644
--- a/toolkit/components/extensions/schemas/web_request.json
+++ b/toolkit/components/extensions/schemas/web_request.json
@@ -189,10 +189,10 @@
           },
           "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": {
@@ -214,9 +214,6 @@
               "sha256": { "type": "string" }
             }
           },
-          "keyUsages": {
-            "type": "string"
-          },
           "rawDER": {
             "optional": true,
             "type": "array",
diff --git a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_hsts.html b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_hsts.html
index 849527ea4a80..df8b541808f9 100644
--- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_hsts.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_hsts.html
@@ -37,6 +37,8 @@ function getExtension() {
       } 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");
diff --git a/toolkit/modules/addons/SecurityInfo.jsm b/toolkit/modules/addons/SecurityInfo.jsm
index 4984f76dd463..8c5cef18754d 100644
--- a/toolkit/modules/addons/SecurityInfo.jsm
+++ b/toolkit/modules/addons/SecurityInfo.jsm
@@ -210,8 +210,8 @@ const SecurityInfo = {
       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,
@@ -222,7 +222,6 @@ const SecurityInfo = {
       subjectPublicKeyInfoDigest: {
         sha256: cert.sha256SubjectPublicKeyInfoDigest,
       },
-      keyUsages: cert.keyUsages,
     };
     if (options.rawDER) {
       certData.rawDER = cert.getRawDER({});





More information about the tbb-commits mailing list