OLD | NEW |
---|---|
(Empty) | |
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 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "base/compiler_specific.h" | |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "net/base/completion_callback.h" | |
15 #include "net/base/net_export.h" | |
16 #include "net/base/net_log.h" | |
17 #include "net/cert/cert_verify_result.h" | |
18 #include "net/cert/x509_certificate.h" | |
19 #include "net/quic/crypto/proof_verifier.h" | |
20 | |
21 namespace net { | |
22 | |
23 class BoundNetLog; | |
24 class CertVerifier; | |
25 class CertVerifyResult; | |
26 class SingleRequestCertVerifier; | |
27 class X509Certificate; | |
28 | |
29 // ProofVerifierChromium implements the QUIC ProofVerifier interface. | |
30 class NET_EXPORT_PRIVATE ProofVerifierChromium : public ProofVerifier { | |
31 public: | |
32 explicit ProofVerifierChromium(CertVerifier* cert_verifier); | |
33 virtual ~ProofVerifierChromium(); | |
34 | |
35 // ProofVerifier interface | |
36 virtual int VerifyProof(const std::string& hostname, | |
37 const std::string& server_config, | |
38 const std::vector<std::string>& certs, | |
39 const std::string& signature, | |
40 const CompletionCallback& callback) OVERRIDE; | |
41 virtual std::string error_details() OVERRIDE; | |
42 | |
43 private: | |
44 enum State { | |
45 STATE_NONE, | |
46 STATE_VERIFY_CERT, | |
47 STATE_VERIFY_CERT_COMPLETE, | |
48 }; | |
49 | |
50 int VerifyChain(); | |
51 | |
52 int DoLoop(int last_io_result); | |
53 void OnIOComplete(int result); | |
54 int DoVerifyCert(int result); | |
55 int DoVerifyCertComplete(int result); | |
56 | |
57 bool VerifySignature(const std::string& signed_data, | |
58 const std::string& signature, | |
59 const std::string& cert); | |
60 | |
61 // |cert_verifier_| and |verifier_| are used for verifying certificates. | |
62 CertVerifier* const cert_verifier_; | |
63 scoped_ptr<SingleRequestCertVerifier> verifier_; | |
64 | |
65 // |hostname| specifies the hostname for which |certs| is a valid chain. | |
66 std::string hostname_; | |
67 | |
68 CompletionCallback callback_; | |
69 | |
70 // The result of certificate verification. | |
71 CertVerifyResult cert_verify_result_; | |
agl
2013/07/01 16:23:18
These members suggest that you're going to have to
ramant (doing other things)
2013/07/02 14:19:50
We thought we would have one ProofVerifier per Ses
| |
72 std::string error_details_; | |
73 | |
74 // X509Certificate from a chain of DER encoded certificates. | |
75 scoped_refptr<X509Certificate> cert_; | |
76 | |
77 State next_state_; | |
78 | |
79 BoundNetLog net_log_; | |
wtc
2013/07/02 00:56:38
The net_log_ member probably should be initialized
ramant (doing other things)
2013/07/02 14:19:50
Done.
| |
80 | |
81 DISALLOW_COPY_AND_ASSIGN(ProofVerifierChromium); | |
82 }; | |
83 | |
84 } // namespace net | |
85 | |
86 #endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_CHROMIUM_H_ | |
OLD | NEW |