OLD | NEW |
---|---|
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> | |
Ryan Sleevi
2014/06/19 00:34:08
Do you actually still need vector? Seems like no.
Eran Messeri
2014/06/19 08:28:37
std::vector is actually used in a different method
| |
8 | |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
9 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
10 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
11 #include "net/base/net_log.h" | 13 #include "net/base/net_log.h" |
12 #include "net/cert/ct_log_verifier.h" | 14 #include "net/cert/ct_log_verifier.h" |
13 #include "net/cert/ct_objects_extractor.h" | 15 #include "net/cert/ct_objects_extractor.h" |
14 #include "net/cert/ct_serialization.h" | 16 #include "net/cert/ct_serialization.h" |
15 #include "net/cert/ct_signed_certificate_timestamp_log_param.h" | 17 #include "net/cert/ct_signed_certificate_timestamp_log_param.h" |
16 #include "net/cert/ct_verify_result.h" | 18 #include "net/cert/ct_verify_result.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 | 61 |
60 void MultiLogCTVerifier::AddLog(scoped_ptr<CTLogVerifier> log_verifier) { | 62 void MultiLogCTVerifier::AddLog(scoped_ptr<CTLogVerifier> log_verifier) { |
61 DCHECK(log_verifier); | 63 DCHECK(log_verifier); |
62 if (!log_verifier) | 64 if (!log_verifier) |
63 return; | 65 return; |
64 | 66 |
65 linked_ptr<CTLogVerifier> log(log_verifier.release()); | 67 linked_ptr<CTLogVerifier> log(log_verifier.release()); |
66 logs_[log->key_id()] = log; | 68 logs_[log->key_id()] = log; |
67 } | 69 } |
68 | 70 |
71 void MultiLogCTVerifier::AddLogs( | |
72 ScopedVector<CTLogVerifier> log_verifiers) { | |
73 for (ScopedVector<CTLogVerifier>::iterator it = | |
74 log_verifiers.begin(); it != log_verifiers.end(); ++it) { | |
75 linked_ptr<CTLogVerifier> log(*it); | |
76 VLOG(1) << "Adding CT log: " << log->description(); | |
77 logs_[log->key_id()] = log; | |
78 } | |
79 | |
80 log_verifiers.weak_clear(); | |
Ryan Sleevi
2014/06/19 00:34:08
nit: add comment
// Ownership of the pointers in |
Eran Messeri
2014/06/19 08:28:37
Done.
| |
81 } | |
82 | |
69 int MultiLogCTVerifier::Verify( | 83 int MultiLogCTVerifier::Verify( |
70 X509Certificate* cert, | 84 X509Certificate* cert, |
71 const std::string& stapled_ocsp_response, | 85 const std::string& stapled_ocsp_response, |
72 const std::string& sct_list_from_tls_extension, | 86 const std::string& sct_list_from_tls_extension, |
73 ct::CTVerifyResult* result, | 87 ct::CTVerifyResult* result, |
74 const BoundNetLog& net_log) { | 88 const BoundNetLog& net_log) { |
75 DCHECK(cert); | 89 DCHECK(cert); |
76 DCHECK(result); | 90 DCHECK(result); |
77 | 91 |
78 result->verified_scts.clear(); | 92 result->verified_scts.clear(); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
212 LogSCTStatusToUMA(ct::SCT_STATUS_INVALID); | 226 LogSCTStatusToUMA(ct::SCT_STATUS_INVALID); |
213 return false; | 227 return false; |
214 } | 228 } |
215 | 229 |
216 LogSCTStatusToUMA(ct::SCT_STATUS_OK); | 230 LogSCTStatusToUMA(ct::SCT_STATUS_OK); |
217 result->verified_scts.push_back(sct); | 231 result->verified_scts.push_back(sct); |
218 return true; | 232 return true; |
219 } | 233 } |
220 | 234 |
221 } // namespace net | 235 } // namespace net |
OLD | NEW |