[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_ | ||||
6 | #define NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_ | ||||
7 | |||||
[email protected] | 5c78ce6 | 2014-03-13 19:48:01 | [diff] [blame^] | 8 | #include <set> |
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 9 | #include <string> |
10 | #include <vector> | ||||
11 | |||||
12 | #include "base/basictypes.h" | ||||
13 | #include "base/compiler_specific.h" | ||||
14 | #include "base/memory/scoped_ptr.h" | ||||
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 15 | #include "net/base/net_export.h" |
16 | #include "net/base/net_log.h" | ||||
17 | #include "net/cert/cert_verify_result.h" | ||||
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 18 | #include "net/quic/crypto/proof_verifier.h" |
19 | |||||
20 | namespace net { | ||||
21 | |||||
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 22 | class CertVerifier; |
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 23 | class SingleRequestCertVerifier; |
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 24 | |
[email protected] | 72e6599 | 2013-07-30 17:16:14 | [diff] [blame] | 25 | // ProofVerifyDetailsChromium is the implementation-specific information that a |
26 | // ProofVerifierChromium returns about a certificate verification. | ||||
27 | struct ProofVerifyDetailsChromium : public ProofVerifyDetails { | ||||
28 | public: | ||||
29 | CertVerifyResult cert_verify_result; | ||||
30 | }; | ||||
31 | |||||
[email protected] | 5c78ce6 | 2014-03-13 19:48:01 | [diff] [blame^] | 32 | // ProofVerifierChromium implements the QUIC ProofVerifier interface. It is |
33 | // capable of handling multiple simultaneous requests. | ||||
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 34 | class NET_EXPORT_PRIVATE ProofVerifierChromium : public ProofVerifier { |
35 | public: | ||||
[email protected] | de9b4d9 | 2013-07-04 01:36:02 | [diff] [blame] | 36 | ProofVerifierChromium(CertVerifier* cert_verifier, |
37 | const BoundNetLog& net_log); | ||||
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 38 | virtual ~ProofVerifierChromium(); |
39 | |||||
40 | // ProofVerifier interface | ||||
[email protected] | d5c9e4ba | 2013-09-14 05:25:58 | [diff] [blame] | 41 | virtual Status VerifyProof(const std::string& hostname, |
[email protected] | 72e6599 | 2013-07-30 17:16:14 | [diff] [blame] | 42 | const std::string& server_config, |
43 | const std::vector<std::string>& certs, | ||||
44 | const std::string& signature, | ||||
45 | std::string* error_details, | ||||
46 | scoped_ptr<ProofVerifyDetails>* details, | ||||
47 | ProofVerifierCallback* callback) OVERRIDE; | ||||
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 48 | |
49 | private: | ||||
[email protected] | 5c78ce6 | 2014-03-13 19:48:01 | [diff] [blame^] | 50 | class Job; |
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 51 | |
[email protected] | 5c78ce6 | 2014-03-13 19:48:01 | [diff] [blame^] | 52 | void OnJobComplete(Job* job); |
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 53 | |
[email protected] | 5c78ce6 | 2014-03-13 19:48:01 | [diff] [blame^] | 54 | // Set owning pointers to active jobs. |
55 | typedef std::set<Job*> JobSet; | ||||
56 | JobSet active_jobs_; | ||||
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 57 | |
[email protected] | 5c78ce6 | 2014-03-13 19:48:01 | [diff] [blame^] | 58 | // Underlying verifier used to verify certificates. |
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 59 | CertVerifier* const cert_verifier_; |
[email protected] | 2662ed56 | 2013-07-03 10:27:46 | [diff] [blame] | 60 | |
61 | BoundNetLog net_log_; | ||||
62 | |||||
63 | DISALLOW_COPY_AND_ASSIGN(ProofVerifierChromium); | ||||
64 | }; | ||||
65 | |||||
66 | } // namespace net | ||||
67 | |||||
68 | #endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_ |