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

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

Issue 2241213002: Distinguish between SCT invalidity reasons in UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changing _MAX to be the last value Created 4 years, 4 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
Index: chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc
diff --git a/chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc b/chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc
index fcd4872dca24a49b1d8c3a40761ceeb7aefbd146..a5bdeb3867fb9fa68b4176d3841fd5e801fc64e3 100644
--- a/chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc
+++ b/chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc
@@ -133,7 +133,8 @@ void FindSCTInReportList(
found = true;
break;
- case net::ct::SCT_STATUS_INVALID: {
+ case net::ct::SCT_STATUS_INVALID_SIGNATURE:
+ case net::ct::SCT_STATUS_INVALID_TIMESTAMP: {
// Invalid SCTs have a log id and an origin and nothing else.
EXPECT_FALSE(report_sct->HasKey("sct"));
std::string id_base64;
@@ -197,9 +198,15 @@ void CheckReportSCTs(
ASSERT_NO_FATAL_FAILURE(FindSCTInReportList(
expected_sct.sct, net::ct::SCT_STATUS_LOG_UNKNOWN, unknown_scts));
break;
- case net::ct::SCT_STATUS_INVALID:
+ case net::ct::SCT_STATUS_INVALID_SIGNATURE:
ASSERT_NO_FATAL_FAILURE(FindSCTInReportList(
- expected_sct.sct, net::ct::SCT_STATUS_INVALID, invalid_scts));
+ expected_sct.sct, net::ct::SCT_STATUS_INVALID_SIGNATURE,
+ invalid_scts));
+ break;
+ case net::ct::SCT_STATUS_INVALID_TIMESTAMP:
+ ASSERT_NO_FATAL_FAILURE(FindSCTInReportList(
+ expected_sct.sct, net::ct::SCT_STATUS_INVALID_TIMESTAMP,
+ invalid_scts));
break;
case net::ct::SCT_STATUS_OK:
ASSERT_NO_FATAL_FAILURE(FindSCTInReportList(
@@ -441,10 +448,18 @@ TEST(ChromeExpectCTReporterTest, SendReport) {
MakeTestSCTAndStatus(
net::ct::SignedCertificateTimestamp::SCT_FROM_TLS_EXTENSION,
"invalid_log_id1", "extensions1", "signature1", now,
- net::ct::SCT_STATUS_INVALID, &ssl_info.signed_certificate_timestamps);
+ net::ct::SCT_STATUS_INVALID_TIMESTAMP,
+ &ssl_info.signed_certificate_timestamps);
+
+ MakeTestSCTAndStatus(
+ net::ct::SignedCertificateTimestamp::SCT_FROM_TLS_EXTENSION,
+ "invalid_log_id1", "extensions1", "signature1", now,
+ net::ct::SCT_STATUS_INVALID_SIGNATURE,
+ &ssl_info.signed_certificate_timestamps);
+
MakeTestSCTAndStatus(net::ct::SignedCertificateTimestamp::SCT_EMBEDDED,
"invalid_log_id2", "extensions2", "signature2", now,
- net::ct::SCT_STATUS_INVALID,
+ net::ct::SCT_STATUS_INVALID_SIGNATURE,
&ssl_info.signed_certificate_timestamps);
MakeTestSCTAndStatus(
« no previous file with comments | « chrome/browser/ssl/chrome_expect_ct_reporter.cc ('k') | chrome/browser/ui/website_settings/website_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698