| 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_SERVER_CONFIG_H_ | 5 #ifndef NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ |
| 6 #define NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ | 6 #define NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
| 15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 16 #include "net/base/ip_endpoint.h" | 16 #include "net/base/ip_endpoint.h" |
| 17 #include "net/base/net_export.h" | 17 #include "net/base/net_export.h" |
| 18 #include "net/quic/crypto/crypto_handshake.h" | 18 #include "net/quic/crypto/crypto_handshake.h" |
| 19 #include "net/quic/crypto/crypto_handshake_message.h" |
| 19 #include "net/quic/crypto/crypto_protocol.h" | 20 #include "net/quic/crypto/crypto_protocol.h" |
| 20 #include "net/quic/crypto/crypto_secret_boxer.h" | 21 #include "net/quic/crypto/crypto_secret_boxer.h" |
| 21 #include "net/quic/quic_time.h" | 22 #include "net/quic/quic_time.h" |
| 22 | 23 |
| 23 namespace net { | 24 namespace net { |
| 24 | 25 |
| 25 class CryptoHandshakeMessage; | 26 class CryptoHandshakeMessage; |
| 26 class EphemeralKeySource; | 27 class EphemeralKeySource; |
| 27 class KeyExchange; | 28 class KeyExchange; |
| 28 class ProofSource; | 29 class ProofSource; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 QuicConnectionId connection_id, | 204 QuicConnectionId connection_id, |
| 204 IPEndPoint client_address, | 205 IPEndPoint client_address, |
| 205 QuicVersion version, | 206 QuicVersion version, |
| 206 const QuicVersionVector& supported_versions, | 207 const QuicVersionVector& supported_versions, |
| 207 const QuicClock* clock, | 208 const QuicClock* clock, |
| 208 QuicRandom* rand, | 209 QuicRandom* rand, |
| 209 QuicCryptoNegotiatedParameters* params, | 210 QuicCryptoNegotiatedParameters* params, |
| 210 CryptoHandshakeMessage* out, | 211 CryptoHandshakeMessage* out, |
| 211 std::string* error_details) const; | 212 std::string* error_details) const; |
| 212 | 213 |
| 214 bool BuildServerConfigUpdateMessage( |
| 215 const IPEndPoint& client_ip, |
| 216 const QuicClock* clock, |
| 217 QuicRandom* rand, |
| 218 const QuicCryptoNegotiatedParameters& params, |
| 219 CryptoHandshakeMessage* out) const; |
| 220 |
| 213 // SetProofSource installs |proof_source| as the ProofSource for handshakes. | 221 // SetProofSource installs |proof_source| as the ProofSource for handshakes. |
| 214 // This object takes ownership of |proof_source|. | 222 // This object takes ownership of |proof_source|. |
| 215 void SetProofSource(ProofSource* proof_source); | 223 void SetProofSource(ProofSource* proof_source); |
| 216 | 224 |
| 217 // SetEphemeralKeySource installs an object that can cache ephemeral keys for | 225 // SetEphemeralKeySource installs an object that can cache ephemeral keys for |
| 218 // a short period of time. This object takes ownership of | 226 // a short period of time. This object takes ownership of |
| 219 // |ephemeral_key_source|. If not set then ephemeral keys will be generated | 227 // |ephemeral_key_source|. If not set then ephemeral keys will be generated |
| 220 // per-connection. | 228 // per-connection. |
| 221 void SetEphemeralKeySource(EphemeralKeySource* ephemeral_key_source); | 229 void SetEphemeralKeySource(EphemeralKeySource* ephemeral_key_source); |
| 222 | 230 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 scoped_refptr<Config> requested_config, | 372 scoped_refptr<Config> requested_config, |
| 365 ValidateClientHelloResultCallback::Result* client_hello_state, | 373 ValidateClientHelloResultCallback::Result* client_hello_state, |
| 366 ValidateClientHelloResultCallback* done_cb) const; | 374 ValidateClientHelloResultCallback* done_cb) const; |
| 367 | 375 |
| 368 // BuildRejection sets |out| to be a REJ message in reply to |client_hello|. | 376 // BuildRejection sets |out| to be a REJ message in reply to |client_hello|. |
| 369 void BuildRejection( | 377 void BuildRejection( |
| 370 const Config& config, | 378 const Config& config, |
| 371 const CryptoHandshakeMessage& client_hello, | 379 const CryptoHandshakeMessage& client_hello, |
| 372 const ClientHelloInfo& info, | 380 const ClientHelloInfo& info, |
| 373 QuicRandom* rand, | 381 QuicRandom* rand, |
| 382 QuicCryptoNegotiatedParameters *params, |
| 374 CryptoHandshakeMessage* out) const; | 383 CryptoHandshakeMessage* out) const; |
| 375 | 384 |
| 376 // ParseConfigProtobuf parses the given config protobuf and returns a | 385 // ParseConfigProtobuf parses the given config protobuf and returns a |
| 377 // scoped_refptr<Config> if successful. The caller adopts the reference to the | 386 // scoped_refptr<Config> if successful. The caller adopts the reference to the |
| 378 // Config. On error, ParseConfigProtobuf returns NULL. | 387 // Config. On error, ParseConfigProtobuf returns NULL. |
| 379 scoped_refptr<Config> ParseConfigProtobuf(QuicServerConfigProtobuf* protobuf); | 388 scoped_refptr<Config> ParseConfigProtobuf(QuicServerConfigProtobuf* protobuf); |
| 380 | 389 |
| 381 // NewSourceAddressToken returns a fresh source address token for the given | 390 // NewSourceAddressToken returns a fresh source address token for the given |
| 382 // IP address. | 391 // IP address. |
| 383 std::string NewSourceAddressToken(const Config& config, | 392 std::string NewSourceAddressToken(const Config& config, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 uint32 source_address_token_lifetime_secs_; | 478 uint32 source_address_token_lifetime_secs_; |
| 470 uint32 server_nonce_strike_register_max_entries_; | 479 uint32 server_nonce_strike_register_max_entries_; |
| 471 uint32 server_nonce_strike_register_window_secs_; | 480 uint32 server_nonce_strike_register_window_secs_; |
| 472 | 481 |
| 473 DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerConfig); | 482 DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerConfig); |
| 474 }; | 483 }; |
| 475 | 484 |
| 476 } // namespace net | 485 } // namespace net |
| 477 | 486 |
| 478 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ | 487 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ |
| OLD | NEW |