diff options
author | estark <estark@chromium.org> | 2015-05-13 15:01:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-13 22:02:50 +0000 |
commit | 4282f117db4ddb6b307efad849ec6635095e9cd1 (patch) | |
tree | 16e84773eda4a7e4568f1ef234e71f2482054fee /chrome/browser/ssl/ssl_blocking_page.cc | |
parent | 8a9efca9b5451c75da244f62f073206c97ef6dd4 (diff) | |
download | chromium_src-4282f117db4ddb6b307efad849ec6635095e9cd1.zip chromium_src-4282f117db4ddb6b307efad849ec6635095e9cd1.tar.gz chromium_src-4282f117db4ddb6b307efad849ec6635095e9cd1.tar.bz2 |
Split cert reporter class into report building/serializing and sending
The pre-existing |CertificateErrorReporter| class (in
//chrome/browser/net) is now only in charge of sending reports over the
network. A new class (|CertificateErrorReport| in //chrome/browser/ssl)
is in charge of building and serializing the reports.
The motivation for this change is to allow reports to include
interstitial-specific information (such as the type of interstitial that
was shown, whether the user clicked through, etc.). So as to avoid
introducing interstitial knowledge into //c/b/net, all the report
building and serializing knowledge (including the report protobuf) has
been moved into //c/b/ssl. |SSLBlockingPage| now sends a serialized report
through |ChromeContentBrowserClient| to the SafeBrowsing UIManager to be
sent over the network.
|ChromeFraudulentCertificateReporter| (responsible for reporting
Google-property pinning violations) has also been moved into //c/b/ssl
so that it can use the new |CertificateErrorReport| class to build
reports before sending them with a |CertificateErrorReporter|.
BUG=462713,461588
Review URL: https://codereview.chromium.org/1117173004
Cr-Commit-Position: refs/heads/master@{#329723}
Diffstat (limited to 'chrome/browser/ssl/ssl_blocking_page.cc')
-rw-r--r-- | chrome/browser/ssl/ssl_blocking_page.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc index 46ad971..c81e436 100644 --- a/chrome/browser/ssl/ssl_blocking_page.cc +++ b/chrome/browser/ssl/ssl_blocking_page.cc @@ -28,6 +28,7 @@ #include "chrome/browser/interstitials/security_interstitial_metrics_helper.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/renderer_preferences_util.h" +#include "chrome/browser/ssl/certificate_error_report.h" #include "chrome/browser/ssl/ssl_cert_reporter.h" #include "chrome/browser/ssl/ssl_error_classification.h" #include "chrome/browser/ssl/ssl_error_info.h" @@ -663,8 +664,15 @@ void SSLBlockingPage::FinishCertCollection() { SecurityInterstitialMetricsHelper::EXTENDED_REPORTING_IS_ENABLED); if (ShouldReportCertificateError()) { - ssl_cert_reporter_->ReportInvalidCertificateChain(request_url().host(), - ssl_info_); + std::string serialized_report; + CertificateErrorReport report(request_url().host(), ssl_info_); + + if (!report.Serialize(&serialized_report)) { + LOG(ERROR) << "Failed to serialize certificate report."; + return; + } + + ssl_cert_reporter_->ReportInvalidCertificateChain(serialized_report); } } |