Backed out changeset bc87945ba833 (bug 1342178)

MozReview-Commit-ID: 2TLlzk8hOZY
This commit is contained in:
Sebastian Hengst 2017-04-11 11:28:05 +02:00
Родитель 4f49916ca1
Коммит 51beeffdec
5 изменённых файлов: 14 добавлений и 49 удалений

Просмотреть файл

@ -3024,8 +3024,7 @@ var BrowserOnClick = {
case "Browser:CertExceptionError": case "Browser:CertExceptionError":
this.onCertError(msg.target, msg.data.elementId, this.onCertError(msg.target, msg.data.elementId,
msg.data.isTopFrame, msg.data.location, msg.data.isTopFrame, msg.data.location,
msg.data.securityInfoAsString, msg.data.securityInfoAsString);
msg.data.originAttributesAsString);
break; break;
case "Browser:OpenCaptivePortalPage": case "Browser:OpenCaptivePortalPage":
CaptivePortalWatcher.ensureCaptivePortalTab(); CaptivePortalWatcher.ensureCaptivePortalTab();
@ -3089,8 +3088,7 @@ var BrowserOnClick = {
uri.host, uri.port); uri.host, uri.port);
}, },
onCertError(browser, elementId, isTopFrame, location, securityInfoAsString, onCertError(browser, elementId, isTopFrame, location, securityInfoAsString) {
originAttributesAsString) {
let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI"); let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI");
let securityInfo; let securityInfo;
@ -3140,8 +3138,7 @@ var BrowserOnClick = {
securityInfo = getSecurityInfo(securityInfoAsString); securityInfo = getSecurityInfo(securityInfoAsString);
let errorInfo = getDetailedCertErrorInfo(location, let errorInfo = getDetailedCertErrorInfo(location,
securityInfo, securityInfo);
JSON.parse(originAttributesAsString));
browser.messageManager.sendAsyncMessage( "CertErrorDetails", { browser.messageManager.sendAsyncMessage( "CertErrorDetails", {
code: securityInfo.errorCode, code: securityInfo.errorCode,
info: errorInfo info: errorInfo
@ -3153,8 +3150,7 @@ var BrowserOnClick = {
.getService(Ci.nsIClipboardHelper); .getService(Ci.nsIClipboardHelper);
securityInfo = getSecurityInfo(securityInfoAsString); securityInfo = getSecurityInfo(securityInfoAsString);
let detailedInfo = getDetailedCertErrorInfo(location, let detailedInfo = getDetailedCertErrorInfo(location,
securityInfo, securityInfo);
JSON.parse(originAttributesAsString));
gClipboardHelper.copyString(detailedInfo); gClipboardHelper.copyString(detailedInfo);
break; break;
@ -3419,7 +3415,7 @@ function getSecurityInfo(securityInfoAsString) {
* Returns a string with detailed information about the certificate validation * Returns a string with detailed information about the certificate validation
* failure from the specified URI that can be used to send a report. * failure from the specified URI that can be used to send a report.
*/ */
function getDetailedCertErrorInfo(location, securityInfo, originAttributes) { function getDetailedCertErrorInfo(location, securityInfo) {
if (!securityInfo) if (!securityInfo)
return ""; return "";
@ -3440,8 +3436,8 @@ function getDetailedCertErrorInfo(location, securityInfo, originAttributes) {
let uri = Services.io.newURI(location); let uri = Services.io.newURI(location);
let hasHSTS = sss.isSecureURI(sss.HEADER_HSTS, uri, flags, originAttributes); let hasHSTS = sss.isSecureURI(sss.HEADER_HSTS, uri, flags);
let hasHPKP = sss.isSecureURI(sss.HEADER_HPKP, uri, flags, originAttributes); let hasHPKP = sss.isSecureURI(sss.HEADER_HPKP, uri, flags);
certErrorDetails += "\r\n\r\n" + certErrorDetails += "\r\n\r\n" +
gNavigatorBundle.getFormattedString("certErrorDetailsHSTS.label", gNavigatorBundle.getFormattedString("certErrorDetailsHSTS.label",
[hasHSTS]); [hasHSTS]);

Просмотреть файл

@ -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 = { var AboutNetAndCertErrorListener = {
init(chromeGlobal) { init(chromeGlobal) {
addMessageListener("CertErrorDetails", this); addMessageListener("CertErrorDetails", this);
@ -609,7 +601,6 @@ var ClickEventHandler = {
elementId: targetElement.getAttribute("id"), elementId: targetElement.getAttribute("id"),
isTopFrame: (ownerDoc.defaultView.parent === ownerDoc.defaultView), isTopFrame: (ownerDoc.defaultView.parent === ownerDoc.defaultView),
securityInfoAsString: getSerializedSecurityInfo(docShell), securityInfoAsString: getSerializedSecurityInfo(docShell),
originAttributesAsString: getSerializedOriginAttributes(docShell),
}); });
}, },

Просмотреть файл

@ -259,13 +259,10 @@ add_task(function* checkAdvancedDetails() {
.QueryInterface(Ci.nsITransportSecurityInfo) .QueryInterface(Ci.nsITransportSecurityInfo)
.QueryInterface(Ci.nsISerializable); .QueryInterface(Ci.nsISerializable);
let serializedSecurityInfo = serhelper.serializeToString(serializable); let serializedSecurityInfo = serhelper.serializeToString(serializable);
let originAttributes = docShell.failedChannel.loadInfo.originAttributes;
let serializedOriginAttributes = JSON.stringify(originAttributes);
return { return {
divDisplay: content.getComputedStyle(div).display, divDisplay: content.getComputedStyle(div).display,
text: text.textContent, text: text.textContent,
securityInfoAsString: serializedSecurityInfo, securityInfoAsString: serializedSecurityInfo
originAttributesAsString: serializedOriginAttributes,
}; };
}); });
isnot(message.divDisplay, "none", "Debug information is visible"); isnot(message.divDisplay, "none", "Debug information is visible");
@ -331,13 +328,10 @@ add_task(function* checkAdvancedDetailsForHSTS() {
.QueryInterface(Ci.nsITransportSecurityInfo) .QueryInterface(Ci.nsITransportSecurityInfo)
.QueryInterface(Ci.nsISerializable); .QueryInterface(Ci.nsISerializable);
let serializedSecurityInfo = serhelper.serializeToString(serializable); let serializedSecurityInfo = serhelper.serializeToString(serializable);
let originAttributes = docShell.failedChannel.loadInfo.originAttributes;
let serializedOriginAttributes = JSON.stringify(originAttributes);
return { return {
divDisplay: content.getComputedStyle(div).display, divDisplay: content.getComputedStyle(div).display,
text: text.textContent, text: text.textContent,
securityInfoAsString: serializedSecurityInfo, securityInfoAsString: serializedSecurityInfo
originAttributesAsString: serializedOriginAttributes,
}; };
}); });
isnot(message.divDisplay, "none", "Debug information is visible"); isnot(message.divDisplay, "none", "Debug information is visible");

Просмотреть файл

@ -8940,20 +8940,10 @@ return /******/ (function(modules) { // webpackBootstrap
let flags = (httpActivity.private) ? let flags = (httpActivity.private) ?
Ci.nsISocketProvider.NO_PERMANENT_STORAGE : 0; Ci.nsISocketProvider.NO_PERMANENT_STORAGE : 0;
if (!uri) {
// isSecureURI only cares about the host, not the scheme.
let host = httpActivity.hostname; let host = httpActivity.hostname;
uri = Services.io.newURI("https://" + host);
}
let originAttributes = {}; info.hsts = sss.isSecureHost(sss.HEADER_HSTS, host, flags);
if (httpActivity.channel) { info.hpkp = sss.isSecureHost(sss.HEADER_HPKP, host, flags);
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);
} else { } else {
DevToolsUtils.reportException("NetworkHelper.parseSecurityInfo", DevToolsUtils.reportException("NetworkHelper.parseSecurityInfo",
"Could not get HSTS/HPKP status as hostname is not available."); "Could not get HSTS/HPKP status as hostname is not available.");

Просмотреть файл

@ -644,14 +644,8 @@ var NetworkHelper = {
uri = Services.io.newURI("https://" + host); uri = Services.io.newURI("https://" + host);
} }
let originAttributes = {}; info.hsts = sss.isSecureURI(sss.HEADER_HSTS, uri, flags);
if (httpActivity.channel) { info.hpkp = sss.isSecureURI(sss.HEADER_HPKP, uri, flags);
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);
} else { } else {
DevToolsUtils.reportException("NetworkHelper.parseSecurityInfo", DevToolsUtils.reportException("NetworkHelper.parseSecurityInfo",
"Could not get HSTS/HPKP status as hostname is not available."); "Could not get HSTS/HPKP status as hostname is not available.");