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

Side by Side Diff: chrome/browser/ssl/chrome_expect_ct_reporter.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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ssl/chrome_expect_ct_reporter.h" 5 #include "chrome/browser/ssl/chrome_expect_ct_reporter.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 std::unique_ptr<base::ListValue> unknown_scts(new base::ListValue()); 146 std::unique_ptr<base::ListValue> unknown_scts(new base::ListValue());
147 std::unique_ptr<base::ListValue> invalid_scts(new base::ListValue()); 147 std::unique_ptr<base::ListValue> invalid_scts(new base::ListValue());
148 std::unique_ptr<base::ListValue> valid_scts(new base::ListValue()); 148 std::unique_ptr<base::ListValue> valid_scts(new base::ListValue());
149 149
150 for (const auto& sct_and_status : ssl_info.signed_certificate_timestamps) { 150 for (const auto& sct_and_status : ssl_info.signed_certificate_timestamps) {
151 switch (sct_and_status.status) { 151 switch (sct_and_status.status) {
152 case net::ct::SCT_STATUS_LOG_UNKNOWN: 152 case net::ct::SCT_STATUS_LOG_UNKNOWN:
153 AddUnknownSCT(sct_and_status, unknown_scts.get()); 153 AddUnknownSCT(sct_and_status, unknown_scts.get());
154 break; 154 break;
155 case net::ct::SCT_STATUS_INVALID: 155 case net::ct::SCT_STATUS_INVALID_SIGNATURE:
156 case net::ct::SCT_STATUS_INVALID_TIMESTAMP:
156 AddInvalidSCT(sct_and_status, invalid_scts.get()); 157 AddInvalidSCT(sct_and_status, invalid_scts.get());
157 break; 158 break;
158 case net::ct::SCT_STATUS_OK: 159 case net::ct::SCT_STATUS_OK:
159 AddValidSCT(sct_and_status, valid_scts.get()); 160 AddValidSCT(sct_and_status, valid_scts.get());
160 break; 161 break;
161 default: 162 default:
162 NOTREACHED(); 163 NOTREACHED();
163 } 164 }
164 } 165 }
165 166
166 report.Set("unknown-scts", std::move(unknown_scts)); 167 report.Set("unknown-scts", std::move(unknown_scts));
167 report.Set("invalid-scts", std::move(invalid_scts)); 168 report.Set("invalid-scts", std::move(invalid_scts));
168 report.Set("valid-scts", std::move(valid_scts)); 169 report.Set("valid-scts", std::move(valid_scts));
169 170
170 std::string serialized_report; 171 std::string serialized_report;
171 if (!base::JSONWriter::Write(report, &serialized_report)) { 172 if (!base::JSONWriter::Write(report, &serialized_report)) {
172 LOG(ERROR) << "Failed to serialize Expect CT report"; 173 LOG(ERROR) << "Failed to serialize Expect CT report";
173 return; 174 return;
174 } 175 }
175 176
176 UMA_HISTOGRAM_BOOLEAN("SSL.ExpectCTReportSendingAttempt", true); 177 UMA_HISTOGRAM_BOOLEAN("SSL.ExpectCTReportSendingAttempt", true);
177 178
178 report_sender_->Send(report_uri, serialized_report); 179 report_sender_->Send(report_uri, serialized_report);
179 } 180 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ssl/chrome_expect_ct_reporter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698