Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: chrome/browser/ssl/certificate_error_report_unittest.cc

Issue 1191743002: Revert of Include unverified server-sent cert chain in reports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ssl/certificate_error_report.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/certificate_error_report_unittest.cc
diff --git a/chrome/browser/ssl/certificate_error_report_unittest.cc b/chrome/browser/ssl/certificate_error_report_unittest.cc
index 72d379c0d75226324468546810438b3cac8c0331..e5110c1e4b31ca22f40384e0065cc79608364b3f 100644
--- a/chrome/browser/ssl/certificate_error_report_unittest.cc
+++ b/chrome/browser/ssl/certificate_error_report_unittest.cc
@@ -35,22 +35,10 @@
const CertLoggerRequest::CertError kSecondReportedCertError =
CertLoggerRequest::ERR_CERT_REVOKED;
-// Whether to include an unverified certificate chain in the test
-// SSLInfo. In production code, an unverified cert chain will not be
-// present if the resource was loaded from cache.
-enum UnverifiedCertChainStatus {
- INCLUDE_UNVERIFIED_CERT_CHAIN,
- EXCLUDE_UNVERIFIED_CERT_CHAIN
-};
-
-SSLInfo GetTestSSLInfo(UnverifiedCertChainStatus unverified_cert_chain_status) {
+SSLInfo GetTestSSLInfo() {
SSLInfo info;
info.cert =
net::ImportCertFromFile(net::GetTestCertsDirectory(), kTestCertFilename);
- if (unverified_cert_chain_status == INCLUDE_UNVERIFIED_CERT_CHAIN) {
- info.unverified_cert = net::ImportCertFromFile(net::GetTestCertsDirectory(),
- kTestCertFilename);
- }
info.is_issued_by_known_root = true;
info.cert_status = kCertStatus;
info.pinning_failure_log = kDummyFailureLog;
@@ -69,7 +57,7 @@
// a CertLoggerRequest protobuf (which is the format that the receiving
// server expects it in) with the right data in it.
TEST(CertificateErrorReportTest, SerializedReportAsProtobuf) {
- SSLInfo ssl_info = GetTestSSLInfo(INCLUDE_UNVERIFIED_CERT_CHAIN);
+ SSLInfo ssl_info = GetTestSSLInfo();
std::string serialized_report;
CertificateErrorReport report(kDummyHostname, ssl_info);
@@ -79,7 +67,6 @@
ASSERT_TRUE(deserialized_report.ParseFromString(serialized_report));
EXPECT_EQ(kDummyHostname, deserialized_report.hostname());
EXPECT_EQ(GetPEMEncodedChain(), deserialized_report.cert_chain());
- EXPECT_EQ(GetPEMEncodedChain(), deserialized_report.unverified_cert_chain());
EXPECT_EQ(1, deserialized_report.pin().size());
EXPECT_EQ(kDummyFailureLog, deserialized_report.pin().Get(0));
@@ -95,10 +82,7 @@
TEST(CertificateErrorReportTest,
SerializedReportAsProtobufWithInterstitialInfo) {
- // Use EXCLUDE_UNVERIFIED_CERT_CHAIN here to exercise the code path
- // where SSLInfo does not contain the unverified cert chain. (The test
- // above exercises the path where it does.)
- SSLInfo ssl_info = GetTestSSLInfo(EXCLUDE_UNVERIFIED_CERT_CHAIN);
+ SSLInfo ssl_info = GetTestSSLInfo();
std::string serialized_report;
CertificateErrorReport report(kDummyHostname, ssl_info);
@@ -118,7 +102,6 @@
ASSERT_TRUE(deserialized_report.ParseFromString(serialized_report));
EXPECT_EQ(kDummyHostname, deserialized_report.hostname());
EXPECT_EQ(GetPEMEncodedChain(), deserialized_report.cert_chain());
- EXPECT_EQ(std::string(), deserialized_report.unverified_cert_chain());
EXPECT_EQ(1, deserialized_report.pin().size());
EXPECT_EQ(kDummyFailureLog, deserialized_report.pin().Get(0));
@@ -139,7 +122,7 @@
// Test that a serialized report can be parsed.
TEST(CertificateErrorReportTest, ParseSerializedReport) {
- SSLInfo ssl_info = GetTestSSLInfo(EXCLUDE_UNVERIFIED_CERT_CHAIN);
+ SSLInfo ssl_info = GetTestSSLInfo();
std::string serialized_report;
CertificateErrorReport report(kDummyHostname, ssl_info);
« no previous file with comments | « chrome/browser/ssl/certificate_error_report.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698