From e8725cdb624b77761556ceed9c165fb09fe3c376 Mon Sep 17 00:00:00 2001 From: Carolina Date: Wed, 31 Jul 2019 11:23:48 -0300 Subject: [PATCH 1/2] Add UTC times, this is helpful for testing in Firefox. See https://phabricator.services.mozilla.com/D39004#inline-242754 --- src/viewer/js/der.js | 6 +++++- src/viewer/js/render.js | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/viewer/js/der.js b/src/viewer/js/der.js index f2b5537..54bb775 100644 --- a/src/viewer/js/der.js +++ b/src/viewer/js/der.js @@ -266,11 +266,13 @@ export const parse = async (certificate) => { if (scts) { scts = Object.keys(scts.timestamps).map(x => { let logId = scts.timestamps[x].logID.toLowerCase(); + let sctsTimestamp = scts.timestamps[x].timestamp; return { logId: hashify(logId), name: ctLogNames.hasOwnProperty(logId) ? ctLogNames[logId] : undefined, signatureAlgorithm: `${scts.timestamps[x].hashAlgorithm.replace('sha', 'SHA-')} ${scts.timestamps[x].signatureAlgorithm.toUpperCase()}`, - timestamp: `${scts.timestamps[x].timestamp.toLocaleString()} (${timeZone})`, + timestamp: `${sctsTimestamp.toLocaleString()} (${timeZone})`, + timestampUTC: sctsTimestamp.toUTCString(), version: scts.timestamps[x].version + 1, } }); @@ -434,7 +436,9 @@ export const parse = async (certificate) => { }, issuer: parseSubsidiary(x509.issuer.typesAndValues), notBefore: `${x509.notBefore.value.toLocaleString()} (${timeZone})`, + notBeforeUTC: x509.notBefore.value.toUTCString(), notAfter: `${x509.notAfter.value.toLocaleString()} (${timeZone})`, + notAfterUTC: x509.notAfter.value.toUTCString(), subject: parseSubsidiary(x509.subject.typesAndValues), serialNumber: hashify(getObjPath(x509, 'serialNumber.valueBlock.valueHex')), signature: { diff --git a/src/viewer/js/render.js b/src/viewer/js/render.js index c48cd3b..36d6ebc 100644 --- a/src/viewer/js/render.js +++ b/src/viewer/js/render.js @@ -159,6 +159,7 @@ const handleDOMContentLoaded = async () => { // stuff the parsed certificate chain into securityInfo response['certs'] = await buildChain(response['certificates']); + console.log("certs ", response['certs']); // now we need to copy over any isBuiltInRoot stuff response.certificates.forEach((certificate, i) => { From 05a83a513257003f6f941d721ad219df4a1031d4 Mon Sep 17 00:00:00 2001 From: Carolina Date: Wed, 31 Jul 2019 11:25:16 -0300 Subject: [PATCH 2/2] Removes console.log --- src/viewer/js/render.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/viewer/js/render.js b/src/viewer/js/render.js index 36d6ebc..c48cd3b 100644 --- a/src/viewer/js/render.js +++ b/src/viewer/js/render.js @@ -159,7 +159,6 @@ const handleDOMContentLoaded = async () => { // stuff the parsed certificate chain into securityInfo response['certs'] = await buildChain(response['certificates']); - console.log("certs ", response['certs']); // now we need to copy over any isBuiltInRoot stuff response.certificates.forEach((certificate, i) => {