Please contact the website owners to inform them of this problem.
">
diff --git a/application/palemoon/locales/en-US/chrome/overrides/netError.dtd b/application/palemoon/locales/en-US/chrome/overrides/netError.dtd
index c97bd1b59d..04bfe99251 100644
--- a/application/palemoon/locales/en-US/chrome/overrides/netError.dtd
+++ b/application/palemoon/locales/en-US/chrome/overrides/netError.dtd
@@ -226,16 +226,6 @@ functionality specific to firefox. -->
">
-
- will help us identify and block malicious sites. Thanks for helping create a safer web!">
-
-
-
-
-
-
-
-
Please contact the website owners to inform them of this problem.
">
diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in
index 188682d3b7..af4a155a9d 100644
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -217,7 +217,6 @@
@BINPATH@/components/toolkit_finalizationwitness.xpt
@BINPATH@/components/toolkit_formautofill.xpt
@BINPATH@/components/toolkit_osfile.xpt
-@BINPATH@/components/toolkit_securityreporter.xpt
@BINPATH@/components/toolkit_perfmonitoring.xpt
@BINPATH@/components/toolkit_xulstore.xpt
@BINPATH@/components/toolkitprofile.xpt
@@ -422,10 +421,6 @@
@BINPATH@/components/PrivateBrowsing.manifest
@BINPATH@/components/PrivateBrowsingTrackingProtectionWhitelist.js
-; Security Reports
-@BINPATH@/components/SecurityReporter.manifest
-@BINPATH@/components/SecurityReporter.js
-
; [Browser Chrome Files]
@BINPATH@/chrome/toolkit@JAREXT@
@BINPATH@/chrome/toolkit.manifest
diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
index 7bcec146d4..ac855b478f 100644
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -24,7 +24,6 @@
#include "nsICryptoHash.h"
#include "nsINetworkInterceptController.h"
#include "nsINSSErrorsService.h"
-#include "nsISecurityReporter.h"
#include "nsIStringBundle.h"
#include "nsIStreamListenerTee.h"
#include "nsISeekableStream.h"
@@ -1733,56 +1732,6 @@ nsHttpChannel::ProcessContentSignatureHeader(nsHttpResponseHead *aResponseHead)
return NS_OK;
}
-/**
- * Decide whether or not to send a security report and, if so, give the
- * SecurityReporter the information required to send such a report.
- */
-void
-nsHttpChannel::ProcessSecurityReport(nsresult status) {
- uint32_t errorClass;
- nsCOMPtr errSvc =
- do_GetService("@mozilla.org/nss_errors_service;1");
- // getErrorClass will throw a generic NS_ERROR_FAILURE if the error code is
- // not in the set of errors covered by the NSS errors service.
- nsresult rv = errSvc->GetErrorClass(status, &errorClass);
- if (!NS_SUCCEEDED(rv)) {
- return;
- }
-
- // if the content was not loaded succesfully and we have security info,
- // send a TLS error report - we must do this early as other parts of
- // OnStopRequest can return early
- bool reportingEnabled =
- Preferences::GetBool("security.ssl.errorReporting.enabled");
- bool reportingAutomatic =
- Preferences::GetBool("security.ssl.errorReporting.automatic");
- if (!mSecurityInfo || !reportingEnabled || !reportingAutomatic) {
- return;
- }
-
- nsCOMPtr secInfo =
- do_QueryInterface(mSecurityInfo);
- nsCOMPtr errorReporter =
- do_GetService("@mozilla.org/securityreporter;1");
-
- if (!secInfo || !mURI) {
- return;
- }
-
- nsAutoCString hostStr;
- int32_t port;
- rv = mURI->GetHost(hostStr);
- if (!NS_SUCCEEDED(rv)) {
- return;
- }
-
- rv = mURI->GetPort(&port);
-
- if (NS_SUCCEEDED(rv)) {
- errorReporter->ReportTLSError(secInfo, hostStr, port);
- }
-}
-
bool
nsHttpChannel::IsHTTPS()
{
@@ -6687,10 +6636,6 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult st
MOZ_ASSERT(NS_IsMainThread(),
"OnStopRequest should only be called from the main thread");
- if (NS_FAILED(status)) {
- ProcessSecurityReport(status);
- }
-
// If this load failed because of a security error, it may be because we
// are in a captive portal - trigger an async check to make sure.
int32_t nsprError = -1 * NS_ERROR_GET_CODE(status);
diff --git a/security/manager/ssl/tests/unit/test_toolkit_securityreporter.js b/security/manager/ssl/tests/unit/test_toolkit_securityreporter.js
deleted file mode 100644
index d7ffd17bd4..0000000000
--- a/security/manager/ssl/tests/unit/test_toolkit_securityreporter.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* This test is for the TLS error reporting functionality exposed by
- * SecurityReporter.js in /toolkit/components/securityreporter. The test is
- * here because we make use of the tlsserver functionality that lives with the
- * PSM ssl tests.
- *
- * The testing here will be augmented by the existing mochitests for the
- * error reporting functionality in aboutNetError.xhtml and
- * aboutCertError.xhtml once these make use of this component.
- */
-
-"use strict";
-const CC = Components.Constructor;
-const Cm = Components.manager;
-
-Cu.import("resource://testing-common/AppInfo.jsm");
-/*global updateAppInfo:false*/ // Imported via AppInfo.jsm.
-updateAppInfo();
-
-// We must get the profile before performing operations on the cert db.
-do_get_profile();
-
-const certdb = Cc["@mozilla.org/security/x509certdb;1"]
- .getService(Ci.nsIX509CertDB);
-const reporter = Cc["@mozilla.org/securityreporter;1"]
- .getService(Ci.nsISecurityReporter);
-
-
-const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
- "nsIBinaryInputStream", "setInputStream");
-
-var server;
-
-// this allows us to create a callback which checks that a report is as
-// expected.
-function getReportCheck(expectReport, expectedError) {
- return function sendReportWithInfo(transportSecurityInfo) {
- // register a path handler on the server
- server.registerPathHandler("/submit/sslreports",
- function(request, response) {
- if (expectReport) {
- let report = JSON.parse(readDataFromRequest(request));
- do_check_eq(report.errorCode, expectedError);
- response.setStatusLine(null, 201, "Created");
- response.write("Created");
- } else {
- do_throw("No report should have been received");
- }
- });
-
- reporter.reportTLSError(transportSecurityInfo, "example.com", -1);
- };
-}
-
-// read the request body from a request
-function readDataFromRequest(aRequest) {
- if (aRequest.method == "POST" || aRequest.method == "PUT") {
- if (aRequest.bodyInputStream) {
- let inputStream = new BinaryInputStream(aRequest.bodyInputStream);
- let bytes = [];
- let available;
-
- while ((available = inputStream.available()) > 0) {
- Array.prototype.push.apply(bytes, inputStream.readByteArray(available));
- }
-
- return String.fromCharCode.apply(null, bytes);
- }
- }
- return null;
-}
-
-function run_test() {
- // start a report server
- server = new HttpServer();
- server.start(-1);
-
- let port = server.identity.primaryPort;
-
- // Set the reporting URL to ensure any reports are sent to the test server
- Services.prefs.setCharPref("security.ssl.errorReporting.url",
- `http://localhost:${port}/submit/sslreports`);
- // set strict-mode pinning enforcement so we can cause connection failures.
- Services.prefs.setIntPref("security.cert_pinning.enforcement_level", 2);
-
- // start a TLS server
- add_tls_server_setup("BadCertServer", "bad_certs");
-
- // Add a user-specified trust anchor.
- addCertFromFile(certdb, "bad_certs/other-test-ca.pem", "CTu,u,u");
-
-
- // Cause a reportable condition with error reporting disabled. No report
- // should be sent.
- Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", false);
- add_connection_test("expired.example.com",
- SEC_ERROR_EXPIRED_CERTIFICATE, null,
- getReportCheck(false));
-
- // Now enable reporting
- add_test(function () {
- Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", true);
- run_next_test();
- });
-
- // test calling the component with no transportSecurityInfo. No report should
- // be sent even though reporting is enabled.
- add_test(function() {
- server.registerPathHandler("/submit/sslreports",
- function(request, response) {
- do_throw("No report should be sent");
- });
- reporter.reportTLSError(null, "example.com", -1);
- run_next_test();
- });
-
- // Test sending a report with no error. This allows us to check the case
- // where there is no failed cert chain
- add_connection_test("good.include-subdomains.pinning.example.com",
- PRErrorCodeSuccess, null,
- getReportCheck(true, PRErrorCodeSuccess));
-
- // Test sending a report where there is an error and a failed cert chain.
- add_connection_test("expired.example.com",
- SEC_ERROR_EXPIRED_CERTIFICATE, null,
- getReportCheck(true, SEC_ERROR_EXPIRED_CERTIFICATE));
-
- run_next_test();
-}
diff --git a/security/manager/ssl/tests/unit/xpcshell.ini b/security/manager/ssl/tests/unit/xpcshell.ini
index b2f3de420e..bdf9933f43 100644
--- a/security/manager/ssl/tests/unit/xpcshell.ini
+++ b/security/manager/ssl/tests/unit/xpcshell.ini
@@ -144,6 +144,3 @@ skip-if = toolkit == 'android'
[test_validity.js]
run-sequentially = hardcoded ports
[test_x509.js]
-
-# The TLS error reporting functionality lives in /toolkit but needs tlsserver
-[test_toolkit_securityreporter.js]
diff --git a/toolkit/components/moz.build b/toolkit/components/moz.build
index c11f627926..953e6c6e30 100644
--- a/toolkit/components/moz.build
+++ b/toolkit/components/moz.build
@@ -51,7 +51,6 @@ DIRS += [
'reader',
'remotebrowserutils',
'reflect',
- 'securityreporter',
'sqlite',
'startup',
'statusfilter',
diff --git a/toolkit/components/securityreporter/SecurityReporter.js b/toolkit/components/securityreporter/SecurityReporter.js
deleted file mode 100644
index 9ca1e55466..0000000000
--- a/toolkit/components/securityreporter/SecurityReporter.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const { classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.importGlobalProperties(['fetch']);
-
-const { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
-const protocolHandler = Cc["@mozilla.org/network/protocol;1?name=http"]
- .getService(Ci.nsIHttpProtocolHandler);
-const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
-
-const TLS_ERROR_REPORT_TELEMETRY_SUCCESS = 6;
-const TLS_ERROR_REPORT_TELEMETRY_FAILURE = 7;
-const HISTOGRAM_ID = "TLS_ERROR_REPORT_UI";
-
-
-XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
- "resource://gre/modules/UpdateUtils.jsm");
-
-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 SecurityReporter() { }
-
-SecurityReporter.prototype = {
- classDescription: "Security reporter component",
- classID: Components.ID("{8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b}"),
- contractID: "@mozilla.org/securityreporter;1",
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISecurityReporter]),
- reportTLSError: function(transportSecurityInfo, hostname, port) {
- // don't send if there's no transportSecurityInfo (since the report cannot
- // contain anything of interest)
- if (!transportSecurityInfo) {
- return;
- }
-
- // don't send a report if the pref is not enabled
- if (!Services.prefs.getBoolPref("security.ssl.errorReporting.enabled")) {
- return;
- }
-
- // Don't send a report if the host we're connecting to is the report
- // server (otherwise we'll get loops when this fails)
- let endpoint =
- Services.prefs.getCharPref("security.ssl.errorReporting.url");
- let reportURI = Services.io.newURI(endpoint, null, null);
-
- if (reportURI.host == hostname) {
- return;
- }
-
- // Convert the nsIX509CertList into a format that can be parsed into
- // JSON
- let asciiCertChain = [];
-
- if (transportSecurityInfo.failedCertChain) {
- let certs = transportSecurityInfo.failedCertChain.getEnumerator();
- while (certs.hasMoreElements()) {
- let cert = certs.getNext();
- cert.QueryInterface(Ci.nsIX509Cert);
- asciiCertChain.push(btoa(getDERString(cert)));
- }
- }
-
- let report = {
- hostname: hostname,
- port: port,
- timestamp: Math.round(Date.now() / 1000),
- errorCode: transportSecurityInfo.errorCode,
- failedCertChain: asciiCertChain,
- userAgent: protocolHandler.userAgent,
- version: 1,
- build: Services.appinfo.appBuildID,
- product: Services.appinfo.name,
- channel: UpdateUtils.UpdateChannel
- }
-
- fetch(endpoint, {
- method: "POST",
- body: JSON.stringify(report),
- headers: {
- 'Content-Type': 'application/json'
- }
- }).then(function (aResponse) {
- if (!aResponse.ok) {
- // request returned non-success status
- Services.telemetry.getHistogramById(HISTOGRAM_ID)
- .add(TLS_ERROR_REPORT_TELEMETRY_FAILURE);
- } else {
- Services.telemetry.getHistogramById(HISTOGRAM_ID)
- .add(TLS_ERROR_REPORT_TELEMETRY_SUCCESS);
- }
- }).catch(function (e) {
- // error making request to reportURL
- Services.telemetry.getHistogramById(HISTOGRAM_ID)
- .add(TLS_ERROR_REPORT_TELEMETRY_FAILURE);
- });
- }
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SecurityReporter]);
diff --git a/toolkit/components/securityreporter/SecurityReporter.manifest b/toolkit/components/securityreporter/SecurityReporter.manifest
deleted file mode 100644
index d4e080dc7c..0000000000
--- a/toolkit/components/securityreporter/SecurityReporter.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b} SecurityReporter.js
-contract @mozilla.org/securityreporter;1 {8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b}
diff --git a/toolkit/components/securityreporter/moz.build b/toolkit/components/securityreporter/moz.build
deleted file mode 100644
index 7ef56a115e..0000000000
--- a/toolkit/components/securityreporter/moz.build
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPIDL_MODULE = 'toolkit_securityreporter'
-
-XPIDL_SOURCES += [
- 'nsISecurityReporter.idl',
-]
-
-EXTRA_COMPONENTS += [
- 'SecurityReporter.js',
- 'SecurityReporter.manifest',
-]
diff --git a/toolkit/components/securityreporter/nsISecurityReporter.idl b/toolkit/components/securityreporter/nsISecurityReporter.idl
deleted file mode 100644
index 462dd1e480..0000000000
--- a/toolkit/components/securityreporter/nsISecurityReporter.idl
+++ /dev/null
@@ -1,14 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-#include "nsITransportSecurityInfo.idl"
-
-[scriptable, uuid(8a997c9a-bea1-11e5-a1fa-be6aBc8e7f8b)]
-interface nsISecurityReporter : nsISupports
-{
- void reportTLSError(in nsITransportSecurityInfo aSecurityInfo,
- in AUTF8String aHostname,
- in long aPort);
-};