diff --git a/js/about/certerror.js b/js/about/certerror.js index f5584cc7209..46004f5eeb3 100644 --- a/js/about/certerror.js +++ b/js/about/certerror.js @@ -27,6 +27,17 @@ function toByteArray (str) { return bytes } +function seperateHex (hexStr) { + var result = [] + for (var i = 0; i < hexStr.length; ++i) { + result += hexStr[i] + if (i % 2 && i != hexStr.length - 1) { + result += ':' + } + } + return result +} + class CertErrorPage extends React.Component { constructor () { super() @@ -50,7 +61,7 @@ class CertErrorPage extends React.Component { certDetail: true, certIssuerName: detail.issuerName, certSubjectName: detail.subjectName, - certSerialNumber: toHexString(toByteArray(detail.serialNumber)), + certSerialNumber: seperateHex(detail.serialNumber), certValidStart: validStart.toString(), certValidExpiry: validExpiry.toString(), certFingerprint: detail.fingerprint.split('/')