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 #ifndef NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 5 #ifndef NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
6 #define NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 6 #define NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <map> | 10 #include <map> |
9 #include <queue> | 11 #include <queue> |
10 #include <string> | 12 #include <string> |
11 #include <vector> | 13 #include <vector> |
12 | 14 |
| 15 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
14 #include "base/strings/string_piece.h" | 17 #include "base/strings/string_piece.h" |
15 #include "net/base/net_export.h" | 18 #include "net/base/net_export.h" |
16 #include "net/quic/crypto/crypto_handshake.h" | 19 #include "net/quic/crypto/crypto_handshake.h" |
17 #include "net/quic/quic_protocol.h" | 20 #include "net/quic/quic_protocol.h" |
18 #include "net/quic/quic_server_id.h" | 21 #include "net/quic/quic_server_id.h" |
19 | 22 |
20 namespace net { | 23 namespace net { |
21 | 24 |
22 class ChannelIDKey; | 25 class ChannelIDKey; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // revalidated. Helper function to keep server_config_valid_ and | 103 // revalidated. Helper function to keep server_config_valid_ and |
101 // generation_counter_ in sync. | 104 // generation_counter_ in sync. |
102 void SetProofInvalid(); | 105 void SetProofInvalid(); |
103 | 106 |
104 const std::string& server_config() const; | 107 const std::string& server_config() const; |
105 const std::string& source_address_token() const; | 108 const std::string& source_address_token() const; |
106 const std::vector<std::string>& certs() const; | 109 const std::vector<std::string>& certs() const; |
107 const std::string& cert_sct() const; | 110 const std::string& cert_sct() const; |
108 const std::string& signature() const; | 111 const std::string& signature() const; |
109 bool proof_valid() const; | 112 bool proof_valid() const; |
110 uint64 generation_counter() const; | 113 uint64_t generation_counter() const; |
111 const ProofVerifyDetails* proof_verify_details() const; | 114 const ProofVerifyDetails* proof_verify_details() const; |
112 | 115 |
113 void set_source_address_token(base::StringPiece token); | 116 void set_source_address_token(base::StringPiece token); |
114 | 117 |
115 void set_cert_sct(base::StringPiece cert_sct); | 118 void set_cert_sct(base::StringPiece cert_sct); |
116 | 119 |
117 // Adds the connection ID to the queue of server-designated connection-ids. | 120 // Adds the connection ID to the queue of server-designated connection-ids. |
118 void add_server_designated_connection_id(QuicConnectionId connection_id); | 121 void add_server_designated_connection_id(QuicConnectionId connection_id); |
119 | 122 |
120 // If true, the crypto config contains at least one connection ID specified | 123 // If true, the crypto config contains at least one connection ID specified |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 std::vector<std::string> certs_; // A list of certificates in leaf-first | 167 std::vector<std::string> certs_; // A list of certificates in leaf-first |
165 // order. | 168 // order. |
166 std::string cert_sct_; // Signed timestamp of the leaf cert. | 169 std::string cert_sct_; // Signed timestamp of the leaf cert. |
167 std::string server_config_sig_; // A signature of |server_config_|. | 170 std::string server_config_sig_; // A signature of |server_config_|. |
168 bool server_config_valid_; // True if |server_config_| is correctly | 171 bool server_config_valid_; // True if |server_config_| is correctly |
169 // signed and |certs_| has been | 172 // signed and |certs_| has been |
170 // validated. | 173 // validated. |
171 // Generation counter associated with the |server_config_|, |certs_| and | 174 // Generation counter associated with the |server_config_|, |certs_| and |
172 // |server_config_sig_| combination. It is incremented whenever we set | 175 // |server_config_sig_| combination. It is incremented whenever we set |
173 // server_config_valid_ to false. | 176 // server_config_valid_ to false. |
174 uint64 generation_counter_; | 177 uint64_t generation_counter_; |
175 | 178 |
176 scoped_ptr<ProofVerifyDetails> proof_verify_details_; | 179 scoped_ptr<ProofVerifyDetails> proof_verify_details_; |
177 | 180 |
178 // scfg contains the cached, parsed value of |server_config|. | 181 // scfg contains the cached, parsed value of |server_config|. |
179 mutable scoped_ptr<CryptoHandshakeMessage> scfg_; | 182 mutable scoped_ptr<CryptoHandshakeMessage> scfg_; |
180 | 183 |
181 // TODO(jokulik): Consider using a hash-set as extra book-keeping to ensure | 184 // TODO(jokulik): Consider using a hash-set as extra book-keeping to ensure |
182 // that no connection-id is added twice. Also, consider keeping the server | 185 // that no connection-id is added twice. Also, consider keeping the server |
183 // nonces and connection_ids together in one queue. | 186 // nonces and connection_ids together in one queue. |
184 std::queue<QuicConnectionId> server_designated_connection_ids_; | 187 std::queue<QuicConnectionId> server_designated_connection_ids_; |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 367 |
365 // The |user_agent_id_| passed in QUIC's CHLO message. | 368 // The |user_agent_id_| passed in QUIC's CHLO message. |
366 std::string user_agent_id_; | 369 std::string user_agent_id_; |
367 | 370 |
368 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); | 371 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); |
369 }; | 372 }; |
370 | 373 |
371 } // namespace net | 374 } // namespace net |
372 | 375 |
373 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 376 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
OLD | NEW |