diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 0c0f7796b734..9754dc8e028b 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -3024,8 +3024,7 @@ var BrowserOnClick = { case "Browser:CertExceptionError": this.onCertError(msg.target, msg.data.elementId, msg.data.isTopFrame, msg.data.location, - msg.data.securityInfoAsString, - msg.data.originAttributesAsString); + msg.data.securityInfoAsString); break; case "Browser:OpenCaptivePortalPage": CaptivePortalWatcher.ensureCaptivePortalTab(); @@ -3089,8 +3088,7 @@ var BrowserOnClick = { uri.host, uri.port); }, - onCertError(browser, elementId, isTopFrame, location, securityInfoAsString, - originAttributesAsString) { + onCertError(browser, elementId, isTopFrame, location, securityInfoAsString) { let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI"); let securityInfo; @@ -3140,8 +3138,7 @@ var BrowserOnClick = { securityInfo = getSecurityInfo(securityInfoAsString); let errorInfo = getDetailedCertErrorInfo(location, - securityInfo, - JSON.parse(originAttributesAsString)); + securityInfo); browser.messageManager.sendAsyncMessage( "CertErrorDetails", { code: securityInfo.errorCode, info: errorInfo @@ -3153,8 +3150,7 @@ var BrowserOnClick = { .getService(Ci.nsIClipboardHelper); securityInfo = getSecurityInfo(securityInfoAsString); let detailedInfo = getDetailedCertErrorInfo(location, - securityInfo, - JSON.parse(originAttributesAsString)); + securityInfo); gClipboardHelper.copyString(detailedInfo); break; @@ -3419,7 +3415,7 @@ function getSecurityInfo(securityInfoAsString) { * 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, originAttributes) { +function getDetailedCertErrorInfo(location, securityInfo) { if (!securityInfo) return ""; @@ -3440,8 +3436,8 @@ function getDetailedCertErrorInfo(location, securityInfo, originAttributes) { let uri = Services.io.newURI(location); - let hasHSTS = sss.isSecureURI(sss.HEADER_HSTS, uri, flags, originAttributes); - let hasHPKP = sss.isSecureURI(sss.HEADER_HPKP, uri, flags, originAttributes); + let hasHSTS = sss.isSecureURI(sss.HEADER_HSTS, uri, flags); + let hasHPKP = sss.isSecureURI(sss.HEADER_HPKP, uri, flags); certErrorDetails += "\r\n\r\n" + gNavigatorBundle.getFormattedString("certErrorDetailsHSTS.label", [hasHSTS]); diff --git a/browser/base/content/content.js b/browser/base/content/content.js index d2f311f9aba1..6abc4d4a12e4 100644 --- a/browser/base/content/content.js +++ b/browser/base/content/content.js @@ -293,14 +293,6 @@ addMessageListener("DeceptiveBlockedDetails", (message) => { }); }); -function getSerializedOriginAttributes(docShell) { - let originAttributes = {}; - if (docShell.failedChannel) { - originAttributes = docShell.failedChannel.loadInfo.originAttributes; - } - return JSON.stringify(originAttributes); -} - var AboutNetAndCertErrorListener = { init(chromeGlobal) { addMessageListener("CertErrorDetails", this); @@ -609,7 +601,6 @@ var ClickEventHandler = { elementId: targetElement.getAttribute("id"), isTopFrame: (ownerDoc.defaultView.parent === ownerDoc.defaultView), securityInfoAsString: getSerializedSecurityInfo(docShell), - originAttributesAsString: getSerializedOriginAttributes(docShell), }); }, diff --git a/browser/base/content/test/general/browser_aboutCertError.js b/browser/base/content/test/general/browser_aboutCertError.js index ce80bb021f42..47235c4b0123 100644 --- a/browser/base/content/test/general/browser_aboutCertError.js +++ b/browser/base/content/test/general/browser_aboutCertError.js @@ -259,13 +259,10 @@ add_task(function* checkAdvancedDetails() { .QueryInterface(Ci.nsITransportSecurityInfo) .QueryInterface(Ci.nsISerializable); let serializedSecurityInfo = serhelper.serializeToString(serializable); - let originAttributes = docShell.failedChannel.loadInfo.originAttributes; - let serializedOriginAttributes = JSON.stringify(originAttributes); return { divDisplay: content.getComputedStyle(div).display, text: text.textContent, - securityInfoAsString: serializedSecurityInfo, - originAttributesAsString: serializedOriginAttributes, + securityInfoAsString: serializedSecurityInfo }; }); isnot(message.divDisplay, "none", "Debug information is visible"); @@ -331,13 +328,10 @@ add_task(function* checkAdvancedDetailsForHSTS() { .QueryInterface(Ci.nsITransportSecurityInfo) .QueryInterface(Ci.nsISerializable); let serializedSecurityInfo = serhelper.serializeToString(serializable); - let originAttributes = docShell.failedChannel.loadInfo.originAttributes; - let serializedOriginAttributes = JSON.stringify(originAttributes); return { divDisplay: content.getComputedStyle(div).display, text: text.textContent, - securityInfoAsString: serializedSecurityInfo, - originAttributesAsString: serializedOriginAttributes, + securityInfoAsString: serializedSecurityInfo }; }); isnot(message.divDisplay, "none", "Debug information is visible"); diff --git a/devtools/client/debugger/new/debugger.js b/devtools/client/debugger/new/debugger.js index 41172e17cee2..3ba7bb00ef96 100644 --- a/devtools/client/debugger/new/debugger.js +++ b/devtools/client/debugger/new/debugger.js @@ -8940,20 +8940,10 @@ return /******/ (function(modules) { // webpackBootstrap let flags = (httpActivity.private) ? Ci.nsISocketProvider.NO_PERMANENT_STORAGE : 0; - if (!uri) { - // isSecureURI only cares about the host, not the scheme. - let host = httpActivity.hostname; - uri = Services.io.newURI("https://" + host); - } + let host = httpActivity.hostname; - let originAttributes = {}; - if (httpActivity.channel) { - originAttributes = httpActivity.channel.loadInfo.originAttributes; - } - info.hsts = sss.isSecureURI(sss.HEADER_HSTS, uri, flags, - originAttributes); - info.hpkp = sss.isSecureURI(sss.HEADER_HPKP, uri, flags, - originAttributes); + info.hsts = sss.isSecureHost(sss.HEADER_HSTS, host, flags); + info.hpkp = sss.isSecureHost(sss.HEADER_HPKP, host, flags); } else { DevToolsUtils.reportException("NetworkHelper.parseSecurityInfo", "Could not get HSTS/HPKP status as hostname is not available."); diff --git a/devtools/shared/webconsole/network-helper.js b/devtools/shared/webconsole/network-helper.js index 67c2f1a1d724..68dec5485de0 100644 --- a/devtools/shared/webconsole/network-helper.js +++ b/devtools/shared/webconsole/network-helper.js @@ -644,14 +644,8 @@ var NetworkHelper = { uri = Services.io.newURI("https://" + host); } - let originAttributes = {}; - if (httpActivity.channel) { - originAttributes = httpActivity.channel.loadInfo.originAttributes; - } - info.hsts = sss.isSecureURI(sss.HEADER_HSTS, uri, flags, - originAttributes); - info.hpkp = sss.isSecureURI(sss.HEADER_HPKP, uri, flags, - originAttributes); + info.hsts = sss.isSecureURI(sss.HEADER_HSTS, uri, flags); + info.hpkp = sss.isSecureURI(sss.HEADER_HPKP, uri, flags); } else { DevToolsUtils.reportException("NetworkHelper.parseSecurityInfo", "Could not get HSTS/HPKP status as hostname is not available.");