| 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_CRYPTO_SERVER_CONFIG_H_ | 5 #ifndef NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_H_ |
| 6 #define NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_H_ | 6 #define NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 bool SetConfigs(const std::vector<QuicServerConfigProtobuf*>& protobufs, | 109 bool SetConfigs(const std::vector<QuicServerConfigProtobuf*>& protobufs, |
| 110 QuicWallTime now); | 110 QuicWallTime now); |
| 111 | 111 |
| 112 // ProcessClientHello processes |client_hello| and decides whether to accept | 112 // ProcessClientHello processes |client_hello| and decides whether to accept |
| 113 // or reject the connection. If the connection is to be accepted, |out| is | 113 // or reject the connection. If the connection is to be accepted, |out| is |
| 114 // set to the contents of the ServerHello, |out_params| is completed and | 114 // set to the contents of the ServerHello, |out_params| is completed and |
| 115 // QUIC_NO_ERROR is returned. Otherwise |out| is set to be a REJ message and | 115 // QUIC_NO_ERROR is returned. Otherwise |out| is set to be a REJ message and |
| 116 // an error code is returned. | 116 // an error code is returned. |
| 117 // | 117 // |
| 118 // client_hello: the incoming client hello message. | 118 // client_hello: the incoming client hello message. |
| 119 // version: the QUIC version for the connection. TODO(wtc): Remove once |
| 120 // QUIC_VERSION_7 and before are removed. |
| 119 // guid: the GUID for the connection, which is used in key derivation. | 121 // guid: the GUID for the connection, which is used in key derivation. |
| 120 // client_ip: the IP address of the client, which is used to generate and | 122 // client_ip: the IP address of the client, which is used to generate and |
| 121 // validate source-address tokens. | 123 // validate source-address tokens. |
| 122 // clock: used to validate client nonces and ephemeral keys. | 124 // clock: used to validate client nonces and ephemeral keys. |
| 123 // rand: an entropy source | 125 // rand: an entropy source |
| 124 // params: the state of the handshake. This may be updated with a server | 126 // params: the state of the handshake. This may be updated with a server |
| 125 // nonce when we send a rejection. After a successful handshake, this will | 127 // nonce when we send a rejection. After a successful handshake, this will |
| 126 // contain the state of the connection. | 128 // contain the state of the connection. |
| 127 // out: the resulting handshake message (either REJ or SHLO) | 129 // out: the resulting handshake message (either REJ or SHLO) |
| 128 // error_details: used to store a string describing any error. | 130 // error_details: used to store a string describing any error. |
| 129 QuicErrorCode ProcessClientHello(const CryptoHandshakeMessage& client_hello, | 131 QuicErrorCode ProcessClientHello(const CryptoHandshakeMessage& client_hello, |
| 132 QuicVersion version, |
| 130 QuicGuid guid, | 133 QuicGuid guid, |
| 131 const IPEndPoint& client_ip, | 134 const IPEndPoint& client_ip, |
| 132 const QuicClock* clock, | 135 const QuicClock* clock, |
| 133 QuicRandom* rand, | 136 QuicRandom* rand, |
| 134 QuicCryptoNegotiatedParameters* params, | 137 QuicCryptoNegotiatedParameters* params, |
| 135 CryptoHandshakeMessage* out, | 138 CryptoHandshakeMessage* out, |
| 136 std::string* error_details) const; | 139 std::string* error_details) const; |
| 137 | 140 |
| 138 // SetProofSource installs |proof_source| as the ProofSource for handshakes. | 141 // SetProofSource installs |proof_source| as the ProofSource for handshakes. |
| 139 // This object takes ownership of |proof_source|. | 142 // This object takes ownership of |proof_source|. |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // whether it can be shown to be fresh (i.e. not a replay). The results are | 255 // whether it can be shown to be fresh (i.e. not a replay). The results are |
| 253 // written to |info|. | 256 // written to |info|. |
| 254 QuicErrorCode EvaluateClientHello( | 257 QuicErrorCode EvaluateClientHello( |
| 255 const CryptoHandshakeMessage& client_hello, | 258 const CryptoHandshakeMessage& client_hello, |
| 256 const uint8* orbit, | 259 const uint8* orbit, |
| 257 ClientHelloInfo* info, | 260 ClientHelloInfo* info, |
| 258 std::string* error_details) const; | 261 std::string* error_details) const; |
| 259 | 262 |
| 260 // BuildRejection sets |out| to be a REJ message in reply to |client_hello|. | 263 // BuildRejection sets |out| to be a REJ message in reply to |client_hello|. |
| 261 void BuildRejection( | 264 void BuildRejection( |
| 265 QuicVersion version, |
| 262 const scoped_refptr<Config>& config, | 266 const scoped_refptr<Config>& config, |
| 263 const CryptoHandshakeMessage& client_hello, | 267 const CryptoHandshakeMessage& client_hello, |
| 264 const ClientHelloInfo& info, | 268 const ClientHelloInfo& info, |
| 265 QuicRandom* rand, | 269 QuicRandom* rand, |
| 266 CryptoHandshakeMessage* out) const; | 270 CryptoHandshakeMessage* out) const; |
| 267 | 271 |
| 268 // ParseConfigProtobuf parses the given config protobuf and returns a | 272 // ParseConfigProtobuf parses the given config protobuf and returns a |
| 269 // scoped_refptr<Config> if successful. The caller adopts the reference to the | 273 // scoped_refptr<Config> if successful. The caller adopts the reference to the |
| 270 // Config. On error, ParseConfigProtobuf returns NULL. | 274 // Config. On error, ParseConfigProtobuf returns NULL. |
| 271 scoped_refptr<Config> ParseConfigProtobuf(QuicServerConfigProtobuf* protobuf); | 275 scoped_refptr<Config> ParseConfigProtobuf(QuicServerConfigProtobuf* protobuf); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 uint32 strike_register_window_secs_; | 355 uint32 strike_register_window_secs_; |
| 352 uint32 source_address_token_future_secs_; | 356 uint32 source_address_token_future_secs_; |
| 353 uint32 source_address_token_lifetime_secs_; | 357 uint32 source_address_token_lifetime_secs_; |
| 354 uint32 server_nonce_strike_register_max_entries_; | 358 uint32 server_nonce_strike_register_max_entries_; |
| 355 uint32 server_nonce_strike_register_window_secs_; | 359 uint32 server_nonce_strike_register_window_secs_; |
| 356 }; | 360 }; |
| 357 | 361 |
| 358 } // namespace net | 362 } // namespace net |
| 359 | 363 |
| 360 #endif // NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_H_ | 364 #endif // NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_H_ |
| OLD | NEW |