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> | 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 for (const auto& log_verifier : log_verifiers) { | 73 for (const auto& log_verifier : log_verifiers) { |
74 VLOG(1) << "Adding CT log: " << log_verifier->description(); | 74 VLOG(1) << "Adding CT log: " << log_verifier->description(); |
75 logs_[log_verifier->key_id()] = log_verifier; | 75 logs_[log_verifier->key_id()] = log_verifier; |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 void MultiLogCTVerifier::SetObserver(Observer* observer) { | 79 void MultiLogCTVerifier::SetObserver(Observer* observer) { |
80 observer_ = observer; | 80 observer_ = observer; |
81 } | 81 } |
82 | 82 |
83 int MultiLogCTVerifier::Verify( | 83 int MultiLogCTVerifier::Verify(X509Certificate* cert, |
84 X509Certificate* cert, | 84 const std::string& stapled_ocsp_response, |
85 const std::string& stapled_ocsp_response, | 85 const std::string& sct_list_from_tls_extension, |
86 const std::string& sct_list_from_tls_extension, | 86 ct::CTVerifyResult* result, |
87 ct::CTVerifyResult* result, | 87 const NetLogWithSource& net_log) { |
88 const BoundNetLog& net_log) { | |
89 DCHECK(cert); | 88 DCHECK(cert); |
90 DCHECK(result); | 89 DCHECK(result); |
91 | 90 |
92 result->scts.clear(); | 91 result->scts.clear(); |
93 | 92 |
94 bool has_verified_scts = false; | 93 bool has_verified_scts = false; |
95 | 94 |
96 std::string embedded_scts; | 95 std::string embedded_scts; |
97 if (!cert->GetIntermediateCertificates().empty() && | 96 if (!cert->GetIntermediateCertificates().empty() && |
98 ct::ExtractEmbeddedSCTList( | 97 ct::ExtractEmbeddedSCTList( |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 return false; | 212 return false; |
214 } | 213 } |
215 | 214 |
216 AddSCTAndLogStatus(sct, ct::SCT_STATUS_OK, &(result->scts)); | 215 AddSCTAndLogStatus(sct, ct::SCT_STATUS_OK, &(result->scts)); |
217 if (observer_) | 216 if (observer_) |
218 observer_->OnSCTVerified(cert, sct.get()); | 217 observer_->OnSCTVerified(cert, sct.get()); |
219 return true; | 218 return true; |
220 } | 219 } |
221 | 220 |
222 } // namespace net | 221 } // namespace net |
OLD | NEW |