OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef NET_QUIC_CRYPTO_PROOF_SOURCE_H_ | 5 #ifndef NET_QUIC_CRYPTO_PROOF_SOURCE_H_ |
6 #define NET_QUIC_CRYPTO_PROOF_SOURCE_H_ | 6 #define NET_QUIC_CRYPTO_PROOF_SOURCE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 18 matching lines...) Expand all Loading... | |
29 const std::vector<std::string> certs; | 29 const std::vector<std::string> certs; |
30 | 30 |
31 private: | 31 private: |
32 friend class base::RefCounted<Chain>; | 32 friend class base::RefCounted<Chain>; |
33 | 33 |
34 virtual ~Chain(); | 34 virtual ~Chain(); |
35 | 35 |
36 DISALLOW_COPY_AND_ASSIGN(Chain); | 36 DISALLOW_COPY_AND_ASSIGN(Chain); |
37 }; | 37 }; |
38 | 38 |
39 // Details is an abstract class which acts as a container for any | |
40 // implementation-specific details that a ProofSource wants to return. | |
41 class Details { | |
Zhongyi Shi
2016/07/27 21:47:55
nit: You might need to add the NET_EXPORT_PRIVATE
Ryan Hamilton
2016/07/27 22:17:46
*nod* Depends on if it's used in the tests. I'll f
| |
42 public: | |
43 virtual ~Details() {} | |
44 }; | |
45 | |
39 // Callback base class for receiving the results of an async call to GetProof. | 46 // Callback base class for receiving the results of an async call to GetProof. |
40 class Callback { | 47 class Callback { |
41 public: | 48 public: |
42 Callback() {} | 49 Callback() {} |
43 virtual ~Callback() {} | 50 virtual ~Callback() {} |
44 | 51 |
45 // Invoked upon completion of GetProof. | 52 // Invoked upon completion of GetProof. |
46 // | 53 // |
47 // |ok| indicates whether the operation completed successfully. If false, | 54 // |ok| indicates whether the operation completed successfully. If false, |
48 // the values of the remaining three arguments are undefined. | 55 // the values of the remaining three arguments are undefined. |
49 // | 56 // |
50 // |chain| is a reference-counted pointer to an object representing the | 57 // |chain| is a reference-counted pointer to an object representing the |
51 // certificate chain. | 58 // certificate chain. |
52 // | 59 // |
53 // |signature| contains the signature of the server config. | 60 // |signature| contains the signature of the server config. |
54 // | 61 // |
55 // |leaf_cert_sct| holds the signed timestamp (RFC6962) of the leaf cert. | 62 // |leaf_cert_sct| holds the signed timestamp (RFC6962) of the leaf cert. |
63 // | |
64 // |details| holds a pointer to an object representing the statistics, if | |
65 // any, | |
66 // gathered during the operation of GetProof. If no stats are available, | |
67 // this will be nullptr. | |
56 virtual void Run(bool ok, | 68 virtual void Run(bool ok, |
57 const scoped_refptr<Chain>& chain, | 69 const scoped_refptr<Chain>& chain, |
58 const std::string& signature, | 70 const std::string& signature, |
59 const std::string& leaf_cert_sct) = 0; | 71 const std::string& leaf_cert_sct, |
72 std::unique_ptr<Details> details) = 0; | |
60 | 73 |
61 private: | 74 private: |
62 Callback(const Callback&) = delete; | 75 Callback(const Callback&) = delete; |
63 Callback& operator=(const Callback&) = delete; | 76 Callback& operator=(const Callback&) = delete; |
64 }; | 77 }; |
65 | 78 |
66 virtual ~ProofSource() {} | 79 virtual ~ProofSource() {} |
67 | 80 |
68 // GetProof finds a certificate chain for |hostname|, sets |out_chain| to | 81 // GetProof finds a certificate chain for |hostname|, sets |out_chain| to |
69 // point to it (in leaf-first order), calculates a signature of | 82 // point to it (in leaf-first order), calculates a signature of |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 const std::string& server_config, | 132 const std::string& server_config, |
120 QuicVersion quic_version, | 133 QuicVersion quic_version, |
121 base::StringPiece chlo_hash, | 134 base::StringPiece chlo_hash, |
122 bool ecdsa_ok, | 135 bool ecdsa_ok, |
123 std::unique_ptr<Callback> callback) = 0; | 136 std::unique_ptr<Callback> callback) = 0; |
124 }; | 137 }; |
125 | 138 |
126 } // namespace net | 139 } // namespace net |
127 | 140 |
128 #endif // NET_QUIC_CRYPTO_PROOF_SOURCE_H_ | 141 #endif // NET_QUIC_CRYPTO_PROOF_SOURCE_H_ |
OLD | NEW |