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_browser_tests.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_browser_tests.cc')
-rw-r--r-- | chrome/browser/ssl/ssl_browser_tests.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc index d536049..bbdd300 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc @@ -21,6 +21,8 @@ #include "chrome/browser/safe_browsing/ping_manager.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/safe_browsing/ui_manager.h" +#include "chrome/browser/ssl/cert_logger.pb.h" +#include "chrome/browser/ssl/certificate_error_report.h" #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" #include "chrome/browser/ssl/ssl_blocking_page.h" #include "chrome/browser/ui/browser.h" @@ -211,10 +213,11 @@ class MockReporter : public CertificateErrorReporter { cookies_preference) {} void SendReport(CertificateErrorReporter::ReportType type, - const std::string& hostname, - const net::SSLInfo& ssl_info) override { + const std::string& serialized_report) override { + CertificateErrorReport report; + ASSERT_TRUE(report.InitializeFromString(serialized_report)); EXPECT_EQ(CertificateErrorReporter::REPORT_TYPE_EXTENDED_REPORTING, type); - latest_hostname_reported_ = hostname; + latest_hostname_reported_ = report.hostname(); } const std::string& latest_hostname_reported() { @@ -247,12 +250,12 @@ class MockSSLCertReporter : public SSLCertReporter { ~MockSSLCertReporter() override { EXPECT_EQ(expect_report_, reported_); } // SSLCertReporter implementation - void ReportInvalidCertificateChain(const std::string& hostname, - const net::SSLInfo& ssl_info) override { + void ReportInvalidCertificateChain( + const std::string& serialized_report) override { reported_ = true; if (expect_report_) { safe_browsing_ui_manager_->ReportInvalidCertificateChain( - hostname, ssl_info, report_sent_callback_); + serialized_report, report_sent_callback_); } } |