Skip to content

Commit

Permalink
Bug 1321778 - Remove vestigial RC4 fallback frontend. r=Dolske
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: G0KF4j2OtyY
  • Loading branch information
vyv03354 committed Nov 19, 2016
1 parent 11a3752 commit 303d429
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 132 deletions.
49 changes: 8 additions & 41 deletions browser/base/content/aboutNetError.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@
buttonEl.disabled = true;
}

function doOverride(buttonEl) {
var event = new CustomEvent("AboutNetErrorOverride", {bubbles:true});
document.dispatchEvent(event);
retryThis(buttonEl);
}

function toggleDisplay(node) {
const toggle = {
"": "block",
Expand All @@ -107,10 +101,9 @@
});
}

function setupAdvancedButton(allowOverride) {
function setupAdvancedButton() {
// Get the hostname and add it to the panel
var panelId = gIsCertError ? "badCertAdvancedPanel" : "weakCryptoAdvancedPanel";
var panel = document.getElementById(panelId);
var panel = document.getElementById("badCertAdvancedPanel");
for (var span of panel.querySelectorAll("span.hostname")) {
span.textContent = document.location.hostname;
}
Expand Down Expand Up @@ -138,12 +131,6 @@
}
});

if (allowOverride) {
document.getElementById("overrideWeakCryptoPanel").style.display = "flex";
var overrideLink = document.getElementById("overrideWeakCrypto");
overrideLink.addEventListener("click", () => doOverride(overrideLink));
}

if (!gIsCertError) {
return;
}
Expand Down Expand Up @@ -226,10 +213,6 @@
document.body.className = "certerror";
}

if (err == "weakCryptoUsed") {
document.body.className = "certerror";
}

// remove undisplayed errors to avoid bug 39098
var errContainer = document.getElementById("errorContainer");
errContainer.remove();
Expand Down Expand Up @@ -265,17 +248,14 @@

window.addEventListener("AboutNetErrorOptions", function(evt) {
// Pinning errors are of type nssFailure2
if (getErrorCode() == "nssFailure2" || getErrorCode() == "weakCryptoUsed") {
if (getErrorCode() == "nssFailure2") {
document.getElementById("learnMoreContainer").style.display = "block";
let learnMoreLink = document.getElementById("learnMoreLink");
// nssFailure2 also gets us other non-overrideable errors. Choose
// a "learn more" link based on description:
if (getDescription().includes("mozilla_pkix_error_key_pinning_failure")) {
learnMoreLink.href = "https://support.mozilla.org/kb/certificate-pinning-reports";
}
if (getErrorCode() == "weakCryptoUsed") {
learnMoreLink.href = "https://support.mozilla.org/kb/how-resolve-weak-crypto-error-messages-firefox";
}

var options = JSON.parse(evt.detail);
if (options && options.enabled) {
Expand Down Expand Up @@ -305,8 +285,8 @@
showPrefChangeContainer();
}
}
if (getErrorCode() == "weakCryptoUsed" || getErrorCode() == "sslv3Used") {
setupAdvancedButton(getErrorCode() == "weakCryptoUsed");
if (getErrorCode() == "sslv3Used") {
setupAdvancedButton();
}
}, true, true);

Expand Down Expand Up @@ -337,7 +317,7 @@
document.dispatchEvent(event);
});

setupAdvancedButton(true);
setupAdvancedButton();

addDomainErrorLinks();

Expand All @@ -355,7 +335,7 @@
host.textContent = document.location.hostname;
}

setupAdvancedButton(true);
setupAdvancedButton();

document.getElementById("learnMoreContainer").style.display = "block";

Expand Down Expand Up @@ -489,8 +469,7 @@
// If we set a link, meaning there's something helpful for
// the user here, expand the section by default
if (link.href && getCSSClass() != "expertBadCert") {
var panelId = gIsCertError ? "badCertAdvancedPanel" : "weakCryptoAdvancedPanel"
toggleDisplay(document.getElementById(panelId));
toggleDisplay(document.getElementById("badCertAdvancedPanel"));
if (gIsCertError) {
// Toggling the advanced panel must ensure that the debugging
// information panel is hidden as well, since it's opened by the
Expand Down Expand Up @@ -545,7 +524,6 @@
<h1 id="et_remoteXUL">&remoteXUL.title;</h1>
<h1 id="et_corruptedContentErrorv2">&corruptedContentErrorv2.title;</h1>
<h1 id="et_sslv3Used">&sslv3Used.title;</h1>
<h1 id="et_weakCryptoUsed">&weakCryptoUsed.title;</h1>
<h1 id="et_inadequateSecurityError">&inadequateSecurityError.title;</h1>
</div>
<div id="errorDescriptionsContainer">
Expand Down Expand Up @@ -575,7 +553,6 @@
<div id="ed_remoteXUL">&remoteXUL.longDesc;</div>
<div id="ed_corruptedContentErrorv2">&corruptedContentErrorv2.longDesc;</div>
<div id="ed_sslv3Used">&sslv3Used.longDesc2;</div>
<div id="ed_weakCryptoUsed">&weakCryptoUsed.longDesc2;</div>
<div id="ed_inadequateSecurityError">&inadequateSecurityError.longDesc;</div>
</div>
</div>
Expand Down Expand Up @@ -654,16 +631,6 @@
</div>

<div id="advancedPanelContainer">
<div id="weakCryptoAdvancedPanel" class="advanced-panel">
<div id="weakCryptoAdvancedDescription">
<p>&weakCryptoAdvanced.longDesc;</p>
</div>
<div id="advancedLongDesc" />
<div id="overrideWeakCryptoPanel">
<a id="overrideWeakCrypto" href="#">&weakCryptoAdvanced.override;</a>
</div>
</div>

<div id="badCertAdvancedPanel" class="advanced-panel">
<p id="badCertTechnicalInfo"/>
<button id="exceptionDialogButton">&securityOverride.exceptionButtonLabel;</button>
Expand Down
59 changes: 0 additions & 59 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2846,7 +2846,6 @@ var BrowserOnClick = {
mm.addMessageListener("Browser:SetSSLErrorReportAuto", this);
mm.addMessageListener("Browser:ResetSSLPreferences", this);
mm.addMessageListener("Browser:SSLErrorReportTelemetry", this);
mm.addMessageListener("Browser:OverrideWeakCrypto", this);
mm.addMessageListener("Browser:SSLErrorGoBack", this);

Services.obs.addObserver(this, "captive-portal-login-abort", false);
Expand All @@ -2862,7 +2861,6 @@ var BrowserOnClick = {
mm.removeMessageListener("Browser:SetSSLErrorReportAuto", this);
mm.removeMessageListener("Browser:ResetSSLPreferences", this);
mm.removeMessageListener("Browser:SSLErrorReportTelemetry", this);
mm.removeMessageListener("Browser:OverrideWeakCrypto", this);
mm.removeMessageListener("Browser:SSLErrorGoBack", this);

Services.obs.removeObserver(this, "captive-portal-login-abort");
Expand Down Expand Up @@ -2943,13 +2941,6 @@ var BrowserOnClick = {
Services.telemetry.getHistogramById("TLS_ERROR_REPORT_UI")
.add(reportStatus);
break;
case "Browser:OverrideWeakCrypto":
let weakCryptoOverride = Cc["@mozilla.org/security/weakcryptooverride;1"]
.getService(Ci.nsIWeakCryptoOverride);
weakCryptoOverride.addWeakCryptoOverride(
msg.data.uri.host,
PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser));
break;
case "Browser:SSLErrorGoBack":
goBackFromErrorPage();
break;
Expand Down Expand Up @@ -6942,7 +6933,6 @@ var gIdentityHandler = {
if (shouldHidePopup) {
this._identityPopup.hidePopup();
}
this.showWeakCryptoInfoBar();

// NOTE: We do NOT update the identity popup (the control center) when
// we receive a new security state on the existing page (i.e. from a
Expand Down Expand Up @@ -7131,55 +7121,6 @@ var gIdentityHandler = {
this._identityIconLabel.parentNode.collapsed = icon_label ? false : true;
},

/**
* Show the weak crypto notification bar.
*/
showWeakCryptoInfoBar() {
if (!this._uriHasHost || !this._isBroken || !this._sslStatus.cipherName ||
this._sslStatus.cipherName.indexOf("_RC4_") < 0) {
return;
}

let notificationBox = gBrowser.getNotificationBox();
let notification = notificationBox.getNotificationWithValue("weak-crypto");
if (notification) {
return;
}

let brandBundle = document.getElementById("bundle_brand");
let brandShortName = brandBundle.getString("brandShortName");
let message = gNavigatorBundle.getFormattedString("weakCryptoOverriding.message",
[brandShortName]);

let host = this._uri.host;
let port = 443;
try {
if (this._uri.port > 0) {
port = this._uri.port;
}
} catch (e) {}

let buttons = [{
label: gNavigatorBundle.getString("revokeOverride.label"),
accessKey: gNavigatorBundle.getString("revokeOverride.accesskey"),
callback(aNotification, aButton) {
try {
let weakCryptoOverride = Cc["@mozilla.org/security/weakcryptooverride;1"]
.getService(Ci.nsIWeakCryptoOverride);
weakCryptoOverride.removeWeakCryptoOverride(host, port,
PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser));
BrowserReloadWithFlags(nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);
} catch (e) {
Cu.reportError(e);
}
}
}];

const priority = notificationBox.PRIORITY_WARNING_MEDIUM;
notificationBox.appendNotification(message, "weak-crypto", null,
priority, buttons);
},

/**
* Set up the title and content messages for the identity message popup,
* based on the specified mode, and the details of the SSL cert, where
Expand Down
9 changes: 0 additions & 9 deletions browser/base/content/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ var AboutNetAndCertErrorListener = {
chromeGlobal.addEventListener("AboutNetErrorLoad", this, false, true);
chromeGlobal.addEventListener("AboutNetErrorOpenCaptivePortal", this, false, true);
chromeGlobal.addEventListener("AboutNetErrorSetAutomatic", this, false, true);
chromeGlobal.addEventListener("AboutNetErrorOverride", this, false, true);
chromeGlobal.addEventListener("AboutNetErrorResetPreferences", this, false, true);
},

Expand Down Expand Up @@ -390,9 +389,6 @@ var AboutNetAndCertErrorListener = {
case "AboutNetErrorSetAutomatic":
this.onSetAutomatic(aEvent);
break;
case "AboutNetErrorOverride":
this.onOverride(aEvent);
break;
case "AboutNetErrorResetPreferences":
this.onResetPreferences(aEvent);
break;
Expand Down Expand Up @@ -453,11 +449,6 @@ var AboutNetAndCertErrorListener = {

}
},

onOverride(evt) {
let {host, port} = content.document.mozDocumentURIIfNotForErrorPages;
sendAsyncMessage("Browser:OverrideWeakCrypto", { uri: {host, port} });
}
}

AboutNetAndCertErrorListener.init(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ let gWhitelist = [{
file: "netError.dtd",
key: "certerror.introPara",
type: "single-quote"
}, {
file: "netError.dtd",
key: "weakCryptoAdvanced.longDesc",
type: "single-quote"
}, {
file: "netError.dtd",
key: "weakCryptoAdvanced.override",
type: "single-quote"
}, {
file: "netError.dtd",
key: "inadequateSecurityError.longDesc",
Expand Down
5 changes: 0 additions & 5 deletions browser/locales/en-US/chrome/browser/browser.properties
Original file line number Diff line number Diff line change
Expand Up @@ -818,11 +818,6 @@ unmuteTab.accesskey = m
playTab.label = Play Tab
playTab.accesskey = l

# LOCALIZATION NOTE (weakCryptoOverriding.message): %S is brandShortName
weakCryptoOverriding.message = %S recommends that you don’t enter your password, credit card and other personal information on this website.
revokeOverride.label = Don’t Trust This Website
revokeOverride.accesskey = D

# LOCALIZATION NOTE (certErrorDetails*.label): These are text strings that
# appear in the about:certerror page, so that the user can copy and send them to
# the server administrators for troubleshooting.
Expand Down
2 changes: 0 additions & 2 deletions browser/locales/en-US/chrome/overrides/appstrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,4 @@ corruptedContentErrorv2=The site at %S has experienced a network protocol violat
remoteXUL=This page uses an unsupported technology that is no longer available by default in Firefox.
## LOCALIZATION NOTE (sslv3Used) - Do not translate "%S".
sslv3Used=Firefox cannot guarantee the safety of your data on %S because it uses SSLv3, a broken security protocol.
## LOCALIZATION NOTE (weakCryptoUsed) - Do not translate "%S".
weakCryptoUsed=The owner of %S has configured their website improperly. To protect your information from being stolen, Firefox has not connected to this website.
inadequateSecurityError=The website tried to negotiate an inadequate level of security.
8 changes: 0 additions & 8 deletions browser/locales/en-US/chrome/overrides/netError.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,6 @@ was trying to connect. -->
"SSL_ERROR_UNSUPPORTED_VERSION". -->
<!ENTITY sslv3Used.longDesc2 "Advanced info: SSL_ERROR_UNSUPPORTED_VERSION">

<!ENTITY weakCryptoUsed.title "Your connection is not secure">
<!-- LOCALIZATION NOTE (weakCryptoUsed.longDesc2) - Do not translate
"SSL_ERROR_NO_CYPHER_OVERLAP". -->
<!ENTITY weakCryptoUsed.longDesc2 "Advanced info: SSL_ERROR_NO_CYPHER_OVERLAP">
<!ENTITY weakCryptoAdvanced.title "Advanced">
<!ENTITY weakCryptoAdvanced.longDesc "<span class='hostname'></span> uses security technology that is outdated and vulnerable to attack. An attacker could easily reveal information which you thought to be safe.">
<!ENTITY weakCryptoAdvanced.override "(Not secure) Try loading <span class='hostname'></span> using outdated security">

<!-- LOCALIZATION NOTE (certerror.wrongSystemTime2,
certerror.wrongSystemTimeWithoutReference) - The <span id='..' />
tags will be injected with actual values, please leave them unchanged. -->
Expand Down

0 comments on commit 303d429

Please sign in to comment.