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/quic/chromium/crypto/proof_verifier_chromium.h" | 5 #include "net/quic/chromium/crypto/proof_verifier_chromium.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // ProofVerifier. If the verification can not complete synchronously, it | 53 // ProofVerifier. If the verification can not complete synchronously, it |
54 // will notify the ProofVerifier upon completion. | 54 // will notify the ProofVerifier upon completion. |
55 class ProofVerifierChromium::Job { | 55 class ProofVerifierChromium::Job { |
56 public: | 56 public: |
57 Job(ProofVerifierChromium* proof_verifier, | 57 Job(ProofVerifierChromium* proof_verifier, |
58 CertVerifier* cert_verifier, | 58 CertVerifier* cert_verifier, |
59 CTPolicyEnforcer* ct_policy_enforcer, | 59 CTPolicyEnforcer* ct_policy_enforcer, |
60 TransportSecurityState* transport_security_state, | 60 TransportSecurityState* transport_security_state, |
61 CTVerifier* cert_transparency_verifier, | 61 CTVerifier* cert_transparency_verifier, |
62 int cert_verify_flags, | 62 int cert_verify_flags, |
63 const BoundNetLog& net_log); | 63 const NetLogWithSource& net_log); |
64 ~Job(); | 64 ~Job(); |
65 | 65 |
66 // Starts the proof verification. If |QUIC_PENDING| is returned, then | 66 // Starts the proof verification. If |QUIC_PENDING| is returned, then |
67 // |callback| will be invoked asynchronously when the verification completes. | 67 // |callback| will be invoked asynchronously when the verification completes. |
68 QuicAsyncStatus VerifyProof( | 68 QuicAsyncStatus VerifyProof( |
69 const std::string& hostname, | 69 const std::string& hostname, |
70 const uint16_t port, | 70 const uint16_t port, |
71 const std::string& server_config, | 71 const std::string& server_config, |
72 QuicVersion quic_version, | 72 QuicVersion quic_version, |
73 base::StringPiece chlo_hash, | 73 base::StringPiece chlo_hash, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // passed to CertVerifier::Verify. | 148 // passed to CertVerifier::Verify. |
149 int cert_verify_flags_; | 149 int cert_verify_flags_; |
150 | 150 |
151 // If set to true, enforces policy checking in DoVerifyCertComplete(). | 151 // If set to true, enforces policy checking in DoVerifyCertComplete(). |
152 bool enforce_policy_checking_; | 152 bool enforce_policy_checking_; |
153 | 153 |
154 State next_state_; | 154 State next_state_; |
155 | 155 |
156 base::TimeTicks start_time_; | 156 base::TimeTicks start_time_; |
157 | 157 |
158 BoundNetLog net_log_; | 158 NetLogWithSource net_log_; |
159 | 159 |
160 DISALLOW_COPY_AND_ASSIGN(Job); | 160 DISALLOW_COPY_AND_ASSIGN(Job); |
161 }; | 161 }; |
162 | 162 |
163 ProofVerifierChromium::Job::Job( | 163 ProofVerifierChromium::Job::Job( |
164 ProofVerifierChromium* proof_verifier, | 164 ProofVerifierChromium* proof_verifier, |
165 CertVerifier* cert_verifier, | 165 CertVerifier* cert_verifier, |
166 CTPolicyEnforcer* ct_policy_enforcer, | 166 CTPolicyEnforcer* ct_policy_enforcer, |
167 TransportSecurityState* transport_security_state, | 167 TransportSecurityState* transport_security_state, |
168 CTVerifier* cert_transparency_verifier, | 168 CTVerifier* cert_transparency_verifier, |
169 int cert_verify_flags, | 169 int cert_verify_flags, |
170 const BoundNetLog& net_log) | 170 const NetLogWithSource& net_log) |
171 : proof_verifier_(proof_verifier), | 171 : proof_verifier_(proof_verifier), |
172 verifier_(cert_verifier), | 172 verifier_(cert_verifier), |
173 policy_enforcer_(ct_policy_enforcer), | 173 policy_enforcer_(ct_policy_enforcer), |
174 transport_security_state_(transport_security_state), | 174 transport_security_state_(transport_security_state), |
175 cert_transparency_verifier_(cert_transparency_verifier), | 175 cert_transparency_verifier_(cert_transparency_verifier), |
176 cert_verify_flags_(cert_verify_flags), | 176 cert_verify_flags_(cert_verify_flags), |
177 enforce_policy_checking_(true), | 177 enforce_policy_checking_(true), |
178 next_state_(STATE_NONE), | 178 next_state_(STATE_NONE), |
179 start_time_(base::TimeTicks::Now()), | 179 start_time_(base::TimeTicks::Now()), |
180 net_log_(net_log) { | 180 net_log_(net_log) { |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 active_jobs_.insert(job.release()); | 614 active_jobs_.insert(job.release()); |
615 return status; | 615 return status; |
616 } | 616 } |
617 | 617 |
618 void ProofVerifierChromium::OnJobComplete(Job* job) { | 618 void ProofVerifierChromium::OnJobComplete(Job* job) { |
619 active_jobs_.erase(job); | 619 active_jobs_.erase(job); |
620 delete job; | 620 delete job; |
621 } | 621 } |
622 | 622 |
623 } // namespace net | 623 } // namespace net |
OLD | NEW |