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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // generation_counter_ in sync. | 76 // generation_counter_ in sync. |
77 void SetProofInvalid(); | 77 void SetProofInvalid(); |
78 | 78 |
79 const std::string& server_config() const; | 79 const std::string& server_config() const; |
80 const std::string& source_address_token() const; | 80 const std::string& source_address_token() const; |
81 const std::vector<std::string>& certs() const; | 81 const std::vector<std::string>& certs() const; |
82 const std::string& signature() const; | 82 const std::string& signature() const; |
83 bool proof_valid() const; | 83 bool proof_valid() const; |
84 uint64 generation_counter() const; | 84 uint64 generation_counter() const; |
85 const ProofVerifyDetails* proof_verify_details() const; | 85 const ProofVerifyDetails* proof_verify_details() const; |
| 86 QuicServerInfo* quic_server_info() const; |
86 | 87 |
87 void set_source_address_token(base::StringPiece token); | 88 void set_source_address_token(base::StringPiece token); |
88 | 89 |
89 // SetProofVerifyDetails takes ownership of |details|. | 90 // SetProofVerifyDetails takes ownership of |details|. |
90 void SetProofVerifyDetails(ProofVerifyDetails* details); | 91 void SetProofVerifyDetails(ProofVerifyDetails* details); |
91 | 92 |
92 // Copy the |server_config_|, |source_address_token_|, |certs_| and | 93 // Copy the |server_config_|, |source_address_token_|, |certs_| and |
93 // |server_config_sig_| from the |other|. The remaining fields, | 94 // |server_config_sig_| from the |other|. The remaining fields, |
94 // |generation_counter_|, |proof_verify_details_|, and |scfg_| remain | 95 // |generation_counter_|, |proof_verify_details_|, and |scfg_| remain |
95 // unchanged. | 96 // unchanged. |
96 void InitializeFrom(const CachedState& other); | 97 void InitializeFrom(const CachedState& other); |
97 | 98 |
| 99 // Fill out the |server_config_|, |source_address_token_|, |certs_| and |
| 100 // |server_config_sig_| fields from |quic_server_info_|. |quic_server_info_| |
| 101 // reads this information from the disk cache. |
| 102 void LoadQuicServerInfo(); |
| 103 |
| 104 // Save the server config information so that we can perform 0-RTT handshake |
| 105 // with a server. |
| 106 void SaveQuicServerInfo(); |
| 107 |
98 private: | 108 private: |
| 109 // TODO(rtenneti): |server_config_id_| is not being used, delete it. |
99 std::string server_config_id_; // An opaque id from the server. | 110 std::string server_config_id_; // An opaque id from the server. |
100 std::string server_config_; // A serialized handshake message. | 111 std::string server_config_; // A serialized handshake message. |
101 std::string source_address_token_; // An opaque proof of IP ownership. | 112 std::string source_address_token_; // An opaque proof of IP ownership. |
102 std::vector<std::string> certs_; // A list of certificates in leaf-first | 113 std::vector<std::string> certs_; // A list of certificates in leaf-first |
103 // order. | 114 // order. |
104 std::string server_config_sig_; // A signature of |server_config_|. | 115 std::string server_config_sig_; // A signature of |server_config_|. |
105 bool server_config_valid_; // True if |server_config_| is correctly | 116 bool server_config_valid_; // True if |server_config_| is correctly |
106 // signed and |certs_| has been | 117 // signed and |certs_| has been |
107 // validated. | 118 // validated. |
| 119 bool need_to_persist_; // Persist to disk if True. |
108 // Generation counter associated with the |server_config_|, |certs_| and | 120 // Generation counter associated with the |server_config_|, |certs_| and |
109 // |server_config_sig_| combination. It is incremented whenever we set | 121 // |server_config_sig_| combination. It is incremented whenever we set |
110 // server_config_valid_ to false. | 122 // server_config_valid_ to false. |
111 uint64 generation_counter_; | 123 uint64 generation_counter_; |
112 | 124 |
113 scoped_ptr<ProofVerifyDetails> proof_verify_details_; | 125 scoped_ptr<ProofVerifyDetails> proof_verify_details_; |
114 | 126 |
115 // scfg contains the cached, parsed value of |server_config|. | 127 // scfg contains the cached, parsed value of |server_config|. |
116 mutable scoped_ptr<CryptoHandshakeMessage> scfg_; | 128 mutable scoped_ptr<CryptoHandshakeMessage> scfg_; |
117 | 129 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 242 |
231 scoped_ptr<ProofVerifier> proof_verifier_; | 243 scoped_ptr<ProofVerifier> proof_verifier_; |
232 scoped_ptr<ChannelIDSigner> channel_id_signer_; | 244 scoped_ptr<ChannelIDSigner> channel_id_signer_; |
233 | 245 |
234 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); | 246 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); |
235 }; | 247 }; |
236 | 248 |
237 } // namespace net | 249 } // namespace net |
238 | 250 |
239 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 251 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
OLD | NEW |