From afc6741a32a96911f421bf8c02b0f932131fd14b Mon Sep 17 00:00:00 2001 From: yan Date: Wed, 4 Jan 2017 20:16:46 +0000 Subject: [PATCH] Handle cert fingerprints that contain '/' The cert fingerprint emitted by Muon/Electron is base64 encoded [1], so it may contain '/'. I think we were truncating the certificate fingerprint when this was the case, which may have caused the decoding error in #6524. [1] https://cs.chromium.org/chromium/src/net/base/hash_value.h?q=net::HashValue&sq=package:chromium&l=58 Auditors: @darkdh --- js/about/certerror.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/about/certerror.js b/js/about/certerror.js index ac2f9c240b9..1ed217a3109 100644 --- a/js/about/certerror.js +++ b/js/about/certerror.js @@ -57,6 +57,8 @@ class CertErrorPage extends React.Component { var validExpiry = new Date() validStart.setTime(detail.validStart * 1000) validExpiry.setTime(detail.validExpiry * 1000) + var fingerprint = detail.fingerprint.split('/') + var algorithm = fingerprint.shift() this.setState({ certDetail: true, certIssuerName: detail.issuerName, @@ -64,7 +66,7 @@ class CertErrorPage extends React.Component { certSerialNumber: seperateHex(detail.serialNumber), certValidStart: validStart.toString(), certValidExpiry: validExpiry.toString(), - certFingerprint: detail.fingerprint.split('/') + certFingerprint: [algorithm, fingerprint.join('/')] }) }) }