| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.PanelWithSidebar} | 7 * @extends {WebInspector.PanelWithSidebar} |
| 8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
| 9 */ | 9 */ |
| 10 WebInspector.SecurityPanel = function() | 10 WebInspector.SecurityPanel = function() |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 var validFromString = new Date(1000 * certificateDetails.validFrom).
toUTCString(); | 795 var validFromString = new Date(1000 * certificateDetails.validFrom).
toUTCString(); |
| 796 var validUntilString = new Date(1000 * certificateDetails.validTo).t
oUTCString(); | 796 var validUntilString = new Date(1000 * certificateDetails.validTo).t
oUTCString(); |
| 797 | 797 |
| 798 var table = new WebInspector.SecurityDetailsTable(); | 798 var table = new WebInspector.SecurityDetailsTable(); |
| 799 certificateSection.appendChild(table.element()); | 799 certificateSection.appendChild(table.element()); |
| 800 table.addRow(WebInspector.UIString("Subject"), certificateDetails.su
bject.name); | 800 table.addRow(WebInspector.UIString("Subject"), certificateDetails.su
bject.name); |
| 801 table.addRow(WebInspector.UIString("SAN"), sanDiv); | 801 table.addRow(WebInspector.UIString("SAN"), sanDiv); |
| 802 table.addRow(WebInspector.UIString("Valid From"), validFromString); | 802 table.addRow(WebInspector.UIString("Valid From"), validFromString); |
| 803 table.addRow(WebInspector.UIString("Valid Until"), validUntilString)
; | 803 table.addRow(WebInspector.UIString("Valid Until"), validUntilString)
; |
| 804 table.addRow(WebInspector.UIString("Issuer"), certificateDetails.iss
uer); | 804 table.addRow(WebInspector.UIString("Issuer"), certificateDetails.iss
uer); |
| 805 table.addRow(WebInspector.UIString("SCTs"), this.sctSummary(originSt
ate.securityDetails.certificateValidationDetails)); | |
| 806 table.addRow("", WebInspector.SecurityPanel.createCertificateViewerB
utton(WebInspector.UIString("Open full certificate details"), originState.securi
tyDetails.certificateId)); | 805 table.addRow("", WebInspector.SecurityPanel.createCertificateViewerB
utton(WebInspector.UIString("Open full certificate details"), originState.securi
tyDetails.certificateId)); |
| 807 | 806 |
| 808 if (!originState.securityDetails.signedCertificateTimestampList.leng
th) | 807 if (!originState.securityDetails.signedCertificateTimestampList.leng
th) |
| 809 return; | 808 return; |
| 810 | 809 |
| 811 // Show summary of SCT(s) of Certificate Transparency. | 810 // Show summary of SCT(s) of Certificate Transparency. |
| 812 var sctSummaryTable = new WebInspector.SecurityDetailsTable(); | 811 var sctSummaryTable = new WebInspector.SecurityDetailsTable(); |
| 813 sctSummaryTable.element().classList.add("sct-summary"); | 812 sctSummaryTable.element().classList.add("sct-summary"); |
| 814 sctSection.appendChild(sctSummaryTable.element()); | 813 sctSection.appendChild(sctSummaryTable.element()); |
| 815 for (var i = 0; i < originState.securityDetails.signedCertificateTim
estampList.length; i++) | 814 for (var i = 0; i < originState.securityDetails.signedCertificateTim
estampList.length; i++) |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 setSecurityState: function(newSecurityState) | 922 setSecurityState: function(newSecurityState) |
| 924 { | 923 { |
| 925 for (var className of Array.prototype.slice.call(this._originLockIcon.cl
assList)) { | 924 for (var className of Array.prototype.slice.call(this._originLockIcon.cl
assList)) { |
| 926 if (className.startsWith("security-property-")) | 925 if (className.startsWith("security-property-")) |
| 927 this._originLockIcon.classList.remove(className); | 926 this._originLockIcon.classList.remove(className); |
| 928 } | 927 } |
| 929 | 928 |
| 930 this._originLockIcon.classList.add("security-property-" + newSecuritySta
te); | 929 this._originLockIcon.classList.add("security-property-" + newSecuritySta
te); |
| 931 }, | 930 }, |
| 932 | 931 |
| 933 /** | |
| 934 * @constructor | |
| 935 * @param {?NetworkAgent.CertificateValidationDetails} details | |
| 936 * @return {string} | |
| 937 */ | |
| 938 sctSummary: function(details) | |
| 939 { | |
| 940 if (!details) | |
| 941 return WebInspector.UIString("N/A"); | |
| 942 | |
| 943 var sctTypeList = []; | |
| 944 if (details.numValidScts) | |
| 945 sctTypeList.push(WebInspector.UIString("%d valid SCT%s", details.num
ValidScts, (details.numValidScts > 1) ? "s" : "")); | |
| 946 if (details.numInvalidScts) | |
| 947 sctTypeList.push(WebInspector.UIString("%d invalid SCT%s", details.n
umInvalidScts, (details.numInvalidScts > 1) ? "s" : "")); | |
| 948 if (details.numUnknownScts) | |
| 949 sctTypeList.push(WebInspector.UIString("%d SCT%s from unknown logs",
details.numUnknownScts, (details.numUnknownScts > 1) ? "s" : "")); | |
| 950 return sctTypeList.length ? sctTypeList.join(", ") : WebInspector.UIStri
ng("0 SCTs"); | |
| 951 }, | |
| 952 | |
| 953 __proto__: WebInspector.VBox.prototype | 932 __proto__: WebInspector.VBox.prototype |
| 954 } | 933 } |
| 955 | 934 |
| 956 /** | 935 /** |
| 957 * @constructor | 936 * @constructor |
| 958 */ | 937 */ |
| 959 WebInspector.SecurityDetailsTable = function() | 938 WebInspector.SecurityDetailsTable = function() |
| 960 { | 939 { |
| 961 this._element = createElement("table"); | 940 this._element = createElement("table"); |
| 962 this._element.classList.add("details-table"); | 941 this._element.classList.add("details-table"); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 982 row.createChild("div").textContent = key; | 961 row.createChild("div").textContent = key; |
| 983 | 962 |
| 984 var valueDiv = row.createChild("div"); | 963 var valueDiv = row.createChild("div"); |
| 985 if (typeof value === "string") { | 964 if (typeof value === "string") { |
| 986 valueDiv.textContent = value; | 965 valueDiv.textContent = value; |
| 987 } else { | 966 } else { |
| 988 valueDiv.appendChild(value); | 967 valueDiv.appendChild(value); |
| 989 } | 968 } |
| 990 } | 969 } |
| 991 } | 970 } |
| OLD | NEW |