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

Unified Diff: net/cert/multi_log_ct_verifier.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
« no previous file with comments | « net/cert/ct_sct_to_string.cc ('k') | net/cert/sct_status_flags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/multi_log_ct_verifier.cc
diff --git a/net/cert/multi_log_ct_verifier.cc b/net/cert/multi_log_ct_verifier.cc
index 8cba5b043ee64176926e4ebb4d04682996909233..7ce6e161d4e1f8909106229c2bd5e7e3bc785c50 100644
--- a/net/cert/multi_log_ct_verifier.cc
+++ b/net/cert/multi_log_ct_verifier.cc
@@ -27,8 +27,12 @@ namespace {
// Record SCT verification status. This metric would help detecting presence
// of unknown CT logs as well as bad deployments (invalid SCTs).
void LogSCTStatusToUMA(ct::SCTVerifyStatus status) {
- UMA_HISTOGRAM_ENUMERATION(
- "Net.CertificateTransparency.SCTStatus", status, ct::SCT_STATUS_MAX);
+ // Note SCT_STATUS_MAX + 1 is passed to the UMA_HISTOGRAM_ENUMERATION as that
+ // macro requires the values to be strictly less than the boundary value,
+ // and SCT_STATUS_MAX is the last valid value of the SCTVerifyStatus enum
+ // (since that enum is used for IPC as well).
+ UMA_HISTOGRAM_ENUMERATION("Net.CertificateTransparency.SCTStatus", status,
+ ct::SCT_STATUS_MAX + 1);
}
// Record SCT origin enum. This metric measure the popularity
@@ -199,14 +203,14 @@ bool MultiLogCTVerifier::VerifySingleSCT(
if (!it->second->Verify(expected_entry, *sct.get())) {
DVLOG(1) << "Unable to verify SCT signature.";
- AddSCTAndLogStatus(sct, ct::SCT_STATUS_INVALID, &(result->scts));
+ AddSCTAndLogStatus(sct, ct::SCT_STATUS_INVALID_SIGNATURE, &(result->scts));
return false;
}
// SCT verified ok, just make sure the timestamp is legitimate.
if (sct->timestamp > base::Time::Now()) {
DVLOG(1) << "SCT is from the future!";
- AddSCTAndLogStatus(sct, ct::SCT_STATUS_INVALID, &(result->scts));
+ AddSCTAndLogStatus(sct, ct::SCT_STATUS_INVALID_TIMESTAMP, &(result->scts));
return false;
}
« no previous file with comments | « net/cert/ct_sct_to_string.cc ('k') | net/cert/sct_status_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698