зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset bc87945ba833 (bug 1342178)
MozReview-Commit-ID: 2TLlzk8hOZY
This commit is contained in:
Родитель
4f49916ca1
Коммит
51beeffdec
|
@ -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]);
|
||||
|
|
|
@ -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),
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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.");
|
||||
|
|
|
@ -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.");
|
||||
|
|
Загрузка…
Ссылка в новой задаче