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

Side by Side Diff: net/cert/multi_log_ct_verifier.cc

Issue 503163002: Remove implicit conversions from scoped_refptr to T* in net/cert/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « net/cert/ct_objects_extractor_unittest.cc ('k') | net/cert/multi_log_ct_verifier_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "net/cert/multi_log_ct_verifier.h" 5 #include "net/cert/multi_log_ct_verifier.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 IDToLogMap::iterator it = logs_.find(sct->log_id); 206 IDToLogMap::iterator it = logs_.find(sct->log_id);
207 if (it == logs_.end()) { 207 if (it == logs_.end()) {
208 DVLOG(1) << "SCT does not match any known log."; 208 DVLOG(1) << "SCT does not match any known log.";
209 result->unknown_logs_scts.push_back(sct); 209 result->unknown_logs_scts.push_back(sct);
210 LogSCTStatusToUMA(ct::SCT_STATUS_LOG_UNKNOWN); 210 LogSCTStatusToUMA(ct::SCT_STATUS_LOG_UNKNOWN);
211 return false; 211 return false;
212 } 212 }
213 213
214 sct->log_description = it->second->description(); 214 sct->log_description = it->second->description();
215 215
216 if (!it->second->Verify(expected_entry, *sct)) { 216 if (!it->second->Verify(expected_entry, *sct.get())) {
217 DVLOG(1) << "Unable to verify SCT signature."; 217 DVLOG(1) << "Unable to verify SCT signature.";
218 result->invalid_scts.push_back(sct); 218 result->invalid_scts.push_back(sct);
219 LogSCTStatusToUMA(ct::SCT_STATUS_INVALID); 219 LogSCTStatusToUMA(ct::SCT_STATUS_INVALID);
220 return false; 220 return false;
221 } 221 }
222 222
223 // SCT verified ok, just make sure the timestamp is legitimate. 223 // SCT verified ok, just make sure the timestamp is legitimate.
224 if (sct->timestamp > base::Time::Now()) { 224 if (sct->timestamp > base::Time::Now()) {
225 DVLOG(1) << "SCT is from the future!"; 225 DVLOG(1) << "SCT is from the future!";
226 result->invalid_scts.push_back(sct); 226 result->invalid_scts.push_back(sct);
227 LogSCTStatusToUMA(ct::SCT_STATUS_INVALID); 227 LogSCTStatusToUMA(ct::SCT_STATUS_INVALID);
228 return false; 228 return false;
229 } 229 }
230 230
231 LogSCTStatusToUMA(ct::SCT_STATUS_OK); 231 LogSCTStatusToUMA(ct::SCT_STATUS_OK);
232 result->verified_scts.push_back(sct); 232 result->verified_scts.push_back(sct);
233 return true; 233 return true;
234 } 234 }
235 235
236 } // namespace net 236 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/ct_objects_extractor_unittest.cc ('k') | net/cert/multi_log_ct_verifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698