summaryrefslogtreecommitdiffstats
path: root/application/basilisk/base/content/browser.js
diff options
context:
space:
mode:
authoryami <34216515+kn-yami@users.noreply.github.com>2018-07-22 15:46:32 +0200
committeryami <34216515+kn-yami@users.noreply.github.com>2018-07-22 15:46:32 +0200
commite313e5e2ec19355988c3d59745c202f4604670d3 (patch)
tree341a9fa3e9f4b9d484925bdf3205782b0c5b08b7 /application/basilisk/base/content/browser.js
parentbdcae58fa6d4e96eddf1b115f58a4ff53446f78f (diff)
downloadUXP-e313e5e2ec19355988c3d59745c202f4604670d3.tar
UXP-e313e5e2ec19355988c3d59745c202f4604670d3.tar.gz
UXP-e313e5e2ec19355988c3d59745c202f4604670d3.tar.lz
UXP-e313e5e2ec19355988c3d59745c202f4604670d3.tar.xz
UXP-e313e5e2ec19355988c3d59745c202f4604670d3.zip
remove dead code
Diffstat (limited to 'application/basilisk/base/content/browser.js')
-rw-r--r--application/basilisk/base/content/browser.js92
1 files changed, 0 insertions, 92 deletions
diff --git a/application/basilisk/base/content/browser.js b/application/basilisk/base/content/browser.js
index 9ec7715fa..031144dfd 100644
--- a/application/basilisk/base/content/browser.js
+++ b/application/basilisk/base/content/browser.js
@@ -2888,24 +2888,7 @@ var BrowserOnClick = {
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_BAD_CERT_TOP_UNDERSTAND_RISKS);
}
- securityInfo = getSecurityInfo(securityInfoAsString);
- let errorInfo = getDetailedCertErrorInfo(location,
- securityInfo);
- browser.messageManager.sendAsyncMessage( "CertErrorDetails", {
- code: securityInfo.errorCode,
- info: errorInfo
- });
- break;
-
- case "copyToClipboard":
- const gClipboardHelper = Cc["@mozilla.org/widget/clipboardhelper;1"]
- .getService(Ci.nsIClipboardHelper);
- securityInfo = getSecurityInfo(securityInfoAsString);
- let detailedInfo = getDetailedCertErrorInfo(location,
- securityInfo);
- gClipboardHelper.copyString(detailedInfo);
break;
-
}
},
@@ -3145,81 +3128,6 @@ function getSecurityInfo(securityInfoAsString) {
return securityInfo;
}
-/**
- * Returns a string with detailed information about the certificate validation
- * failure from the specified URI that can be used to send a report.
- */
-function getDetailedCertErrorInfo(location, securityInfo) {
- if (!securityInfo)
- return "";
-
- let certErrorDetails = location;
- let code = securityInfo.errorCode;
- let errors = Cc["@mozilla.org/nss_errors_service;1"]
- .getService(Ci.nsINSSErrorsService);
-
- certErrorDetails += "\r\n\r\n" + errors.getErrorMessage(errors.getXPCOMFromNSSError(code));
-
- const sss = Cc["@mozilla.org/ssservice;1"]
- .getService(Ci.nsISiteSecurityService);
- // SiteSecurityService uses different storage if the channel is
- // private. Thus we must give isSecureHost correct flags or we
- // might get incorrect results.
- let flags = PrivateBrowsingUtils.isWindowPrivate(window) ?
- Ci.nsISocketProvider.NO_PERMANENT_STORAGE : 0;
-
- let uri = Services.io.newURI(location, null, null);
-
- let hasHSTS = sss.isSecureHost(sss.HEADER_HSTS, uri.host, flags);
- let hasHPKP = sss.isSecureHost(sss.HEADER_HPKP, uri.host, flags);
- certErrorDetails += "\r\n\r\n" +
- gNavigatorBundle.getFormattedString("certErrorDetailsHSTS.label",
- [hasHSTS]);
- certErrorDetails += "\r\n" +
- gNavigatorBundle.getFormattedString("certErrorDetailsKeyPinning.label",
- [hasHPKP]);
-
- let certChain = "";
- if (securityInfo.failedCertChain) {
- let certs = securityInfo.failedCertChain.getEnumerator();
- while (certs.hasMoreElements()) {
- let cert = certs.getNext();
- cert.QueryInterface(Ci.nsIX509Cert);
- certChain += getPEMString(cert);
- }
- }
-
- certErrorDetails += "\r\n\r\n" +
- gNavigatorBundle.getString("certErrorDetailsCertChain.label") +
- "\r\n\r\n" + certChain;
-
- return certErrorDetails;
-}
-
-// TODO: can we pull getDERString and getPEMString in from pippki.js instead of
-// duplicating them here?
-function getDERString(cert)
-{
- var length = {};
- var derArray = cert.getRawDER(length);
- var derString = '';
- for (var i = 0; i < derArray.length; i++) {
- derString += String.fromCharCode(derArray[i]);
- }
- return derString;
-}
-
-function getPEMString(cert)
-{
- var derb64 = btoa(getDERString(cert));
- // Wrap the Base64 string into lines of 64 characters,
- // with CRLF line breaks (as specified in RFC 1421).
- var wrapped = derb64.replace(/(\S{64}(?!$))/g, "$1\r\n");
- return "-----BEGIN CERTIFICATE-----\r\n"
- + wrapped
- + "\r\n-----END CERTIFICATE-----\r\n";
-}
-
var PrintPreviewListener = {
_printPreviewTab: null,
_tabBeforePrintPreview: null,