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_CORE_CRYPTO_PROOF_SOURCE_H_ | 5 #ifndef NET_QUIC_CORE_CRYPTO_PROOF_SOURCE_H_ |
6 #define NET_QUIC_CORE_CRYPTO_PROOF_SOURCE_H_ | 6 #define NET_QUIC_CORE_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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 const QuicCryptoProof& proof, | 68 const QuicCryptoProof& proof, |
69 std::unique_ptr<Details> details) = 0; | 69 std::unique_ptr<Details> details) = 0; |
70 | 70 |
71 private: | 71 private: |
72 Callback(const Callback&) = delete; | 72 Callback(const Callback&) = delete; |
73 Callback& operator=(const Callback&) = delete; | 73 Callback& operator=(const Callback&) = delete; |
74 }; | 74 }; |
75 | 75 |
76 virtual ~ProofSource() {} | 76 virtual ~ProofSource() {} |
77 | 77 |
78 // GetProof finds a certificate chain for |hostname|, sets |out_chain| to | 78 // GetProof finds a certificate chain for |hostname| (in leaf-first order), |
79 // point to it (in leaf-first order), calculates a signature of | 79 // and calculates a signature of |server_config| using that chain. |
80 // |server_config| using that chain and puts the result in |out_signature|. | |
81 // | 80 // |
82 // The signature uses SHA-256 as the hash function and PSS padding when the | 81 // The signature uses SHA-256 as the hash function and PSS padding when the |
83 // key is RSA. | 82 // key is RSA. |
84 // | 83 // |
85 // The signature uses SHA-256 as the hash function when the key is ECDSA. | 84 // The signature uses SHA-256 as the hash function when the key is ECDSA. |
86 // The signature may use an ECDSA key. | 85 // The signature may use an ECDSA key. |
87 // | 86 // |
88 // |out_chain| is reference counted to avoid the (assumed) expense of copying | |
89 // out the certificates. | |
90 // | |
91 // The number of certificate chains is expected to be small and fixed, thus | |
92 // the ProofSource retains ownership of the contents of |out_chain|. The | |
93 // expectation is that they will be cached forever. | |
94 // | |
95 // The signature depends on |chlo_hash| which means that the signature can not | 87 // The signature depends on |chlo_hash| which means that the signature can not |
96 // be cached. The caller takes ownership of |*out_signature|. | 88 // be cached. |
97 // | 89 // |
98 // |hostname| may be empty to signify that a default certificate should be | 90 // |hostname| may be empty to signify that a default certificate should be |
99 // used. | 91 // used. |
100 // | 92 // |
101 // |out_leaf_cert_sct| points to the signed timestamp (RFC6962) of the leaf | 93 // This function may be called concurrently. |
102 // cert. | |
103 // | 94 // |
104 // This function may be called concurrently. | 95 // Callers should expect that |callback| might be invoked synchronously. |
105 virtual bool GetProof(const QuicSocketAddress& server_address, | |
106 const std::string& hostname, | |
107 const std::string& server_config, | |
108 QuicVersion quic_version, | |
109 base::StringPiece chlo_hash, | |
110 const QuicTagVector& connection_options, | |
111 QuicReferenceCountedPointer<Chain>* out_chain, | |
112 QuicCryptoProof* out_proof) = 0; | |
113 | |
114 // Async version of GetProof with identical semantics, except that the results | |
115 // are delivered to |callback|. Callers should expect that |callback| might | |
116 // be invoked synchronously. The ProofSource takes ownership of |callback| in | |
117 // any case. | |
118 virtual void GetProof(const QuicSocketAddress& server_address, | 96 virtual void GetProof(const QuicSocketAddress& server_address, |
119 const std::string& hostname, | 97 const std::string& hostname, |
120 const std::string& server_config, | 98 const std::string& server_config, |
121 QuicVersion quic_version, | 99 QuicVersion quic_version, |
122 base::StringPiece chlo_hash, | 100 base::StringPiece chlo_hash, |
123 const QuicTagVector& connection_options, | 101 const QuicTagVector& connection_options, |
124 std::unique_ptr<Callback> callback) = 0; | 102 std::unique_ptr<Callback> callback) = 0; |
125 }; | 103 }; |
126 | 104 |
127 } // namespace net | 105 } // namespace net |
128 | 106 |
129 #endif // NET_QUIC_CORE_CRYPTO_PROOF_SOURCE_H_ | 107 #endif // NET_QUIC_CORE_CRYPTO_PROOF_SOURCE_H_ |
OLD | NEW |