Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: net/quic/crypto/quic_crypto_client_config.h

Issue 154933003: Persist server's crypto config data to disk cache for 0-RTT (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update with TOT and handle multiple tabs loading same URL Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 of |this| from |quic_server_info_|.
wtc 2014/02/07 00:54:11 Nit: remove "of |this|". That is implied. Nit: th
ramant (doing other things) 2014/02/07 20:30:51 Done.
101 void LoadQuicServerInfo();
102
103 // Save the server config information so that we can perform 0-RTT handshake
104 // with a server.
105 void SaveQuicServerInfo();
106
98 private: 107 private:
99 std::string server_config_id_; // An opaque id from the server. 108 std::string server_config_id_; // An opaque id from the server.
100 std::string server_config_; // A serialized handshake message. 109 std::string server_config_; // A serialized handshake message.
101 std::string source_address_token_; // An opaque proof of IP ownership. 110 std::string source_address_token_; // An opaque proof of IP ownership.
102 std::vector<std::string> certs_; // A list of certificates in leaf-first 111 std::vector<std::string> certs_; // A list of certificates in leaf-first
103 // order. 112 // order.
104 std::string server_config_sig_; // A signature of |server_config_|. 113 std::string server_config_sig_; // A signature of |server_config_|.
105 bool server_config_valid_; // True if |server_config_| is correctly 114 bool server_config_valid_; // True if |server_config_| is correctly
106 // signed and |certs_| has been 115 // signed and |certs_| has been
107 // validated. 116 // validated.
117 bool need_to_persist_; // Persist to disk if True.
108 // Generation counter associated with the |server_config_|, |certs_| and 118 // Generation counter associated with the |server_config_|, |certs_| and
109 // |server_config_sig_| combination. It is incremented whenever we set 119 // |server_config_sig_| combination. It is incremented whenever we set
110 // server_config_valid_ to false. 120 // server_config_valid_ to false.
111 uint64 generation_counter_; 121 uint64 generation_counter_;
112 122
113 scoped_ptr<ProofVerifyDetails> proof_verify_details_; 123 scoped_ptr<ProofVerifyDetails> proof_verify_details_;
114 124
115 // scfg contains the cached, parsed value of |server_config|. 125 // scfg contains the cached, parsed value of |server_config|.
116 mutable scoped_ptr<CryptoHandshakeMessage> scfg_; 126 mutable scoped_ptr<CryptoHandshakeMessage> scfg_;
117 127
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 240
231 scoped_ptr<ProofVerifier> proof_verifier_; 241 scoped_ptr<ProofVerifier> proof_verifier_;
232 scoped_ptr<ChannelIDSigner> channel_id_signer_; 242 scoped_ptr<ChannelIDSigner> channel_id_signer_;
233 243
234 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); 244 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig);
235 }; 245 };
236 246
237 } // namespace net 247 } // namespace net
238 248
239 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ 249 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698