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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 private: | 115 private: |
116 DISALLOW_COPY_AND_ASSIGN(ValidateClientHelloResultCallback); | 116 DISALLOW_COPY_AND_ASSIGN(ValidateClientHelloResultCallback); |
117 }; | 117 }; |
118 | 118 |
119 // Callback used to accept the result of the ProcessClientHello method. | 119 // Callback used to accept the result of the ProcessClientHello method. |
120 class NET_EXPORT_PRIVATE ProcessClientHelloResultCallback { | 120 class NET_EXPORT_PRIVATE ProcessClientHelloResultCallback { |
121 public: | 121 public: |
122 ProcessClientHelloResultCallback(); | 122 ProcessClientHelloResultCallback(); |
123 virtual ~ProcessClientHelloResultCallback(); | 123 virtual ~ProcessClientHelloResultCallback(); |
124 virtual void Run( | 124 virtual void Run(QuicErrorCode error, |
125 QuicErrorCode error, | 125 const std::string& error_details, |
126 const std::string& error_details, | 126 std::unique_ptr<CryptoHandshakeMessage> message, |
127 std::unique_ptr<CryptoHandshakeMessage> message, | 127 std::unique_ptr<DiversificationNonce> diversification_nonce, |
128 std::unique_ptr<DiversificationNonce> diversification_nonce) = 0; | 128 std::unique_ptr<ProofSource::Details> details) = 0; |
129 | 129 |
130 private: | 130 private: |
131 DISALLOW_COPY_AND_ASSIGN(ProcessClientHelloResultCallback); | 131 DISALLOW_COPY_AND_ASSIGN(ProcessClientHelloResultCallback); |
132 }; | 132 }; |
133 | 133 |
134 // Callback used to receive the results of a call to | 134 // Callback used to receive the results of a call to |
135 // BuildServerConfigUpdateMessage. | 135 // BuildServerConfigUpdateMessage. |
136 class BuildServerConfigUpdateMessageResultCallback { | 136 class BuildServerConfigUpdateMessageResultCallback { |
137 public: | 137 public: |
138 BuildServerConfigUpdateMessageResultCallback() = default; | 138 BuildServerConfigUpdateMessageResultCallback() = default; |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 QuicVersion version, | 345 QuicVersion version, |
346 base::StringPiece chlo_hash, | 346 base::StringPiece chlo_hash, |
347 const SourceAddressTokens& previous_source_address_tokens, | 347 const SourceAddressTokens& previous_source_address_tokens, |
348 const IPAddress& server_ip, | 348 const IPAddress& server_ip, |
349 const IPAddress& client_ip, | 349 const IPAddress& client_ip, |
350 const QuicClock* clock, | 350 const QuicClock* clock, |
351 QuicRandom* rand, | 351 QuicRandom* rand, |
352 QuicCompressedCertsCache* compressed_certs_cache, | 352 QuicCompressedCertsCache* compressed_certs_cache, |
353 const QuicCryptoNegotiatedParameters& params, | 353 const QuicCryptoNegotiatedParameters& params, |
354 const CachedNetworkParameters* cached_network_params, | 354 const CachedNetworkParameters* cached_network_params, |
| 355 const QuicTagVector& connection_options, |
355 CryptoHandshakeMessage* out) const; | 356 CryptoHandshakeMessage* out) const; |
356 | 357 |
357 // BuildServerConfigUpdateMessage invokes |cb| with a SCUP message containing | 358 // BuildServerConfigUpdateMessage invokes |cb| with a SCUP message containing |
358 // the current primary config, an up to date source-address token, and cert | 359 // the current primary config, an up to date source-address token, and cert |
359 // chain and proof in the case of secure QUIC. Passes true to |cb| if the | 360 // chain and proof in the case of secure QUIC. Passes true to |cb| if the |
360 // message was generated successfully, and false otherwise. This method | 361 // message was generated successfully, and false otherwise. This method |
361 // assumes ownership of |cb|. | 362 // assumes ownership of |cb|. |
362 // | 363 // |
363 // |cached_network_params| is optional, and can be nullptr. | 364 // |cached_network_params| is optional, and can be nullptr. |
364 // | 365 // |
365 // TODO(gredner): This method is an async version of the above. The | 366 // TODO(gredner): This method is an async version of the above. The |
366 // synchronous version will eventually be removed. | 367 // synchronous version will eventually be removed. |
367 void BuildServerConfigUpdateMessage( | 368 void BuildServerConfigUpdateMessage( |
368 QuicVersion version, | 369 QuicVersion version, |
369 base::StringPiece chlo_hash, | 370 base::StringPiece chlo_hash, |
370 const SourceAddressTokens& previous_source_address_tokens, | 371 const SourceAddressTokens& previous_source_address_tokens, |
371 const IPAddress& server_ip, | 372 const IPAddress& server_ip, |
372 const IPAddress& client_ip, | 373 const IPAddress& client_ip, |
373 const QuicClock* clock, | 374 const QuicClock* clock, |
374 QuicRandom* rand, | 375 QuicRandom* rand, |
375 QuicCompressedCertsCache* compressed_certs_cache, | 376 QuicCompressedCertsCache* compressed_certs_cache, |
376 const QuicCryptoNegotiatedParameters& params, | 377 const QuicCryptoNegotiatedParameters& params, |
377 const CachedNetworkParameters* cached_network_params, | 378 const CachedNetworkParameters* cached_network_params, |
| 379 const QuicTagVector& connection_options, |
378 std::unique_ptr<BuildServerConfigUpdateMessageResultCallback> cb) const; | 380 std::unique_ptr<BuildServerConfigUpdateMessageResultCallback> cb) const; |
379 | 381 |
380 // SetEphemeralKeySource installs an object that can cache ephemeral keys for | 382 // SetEphemeralKeySource installs an object that can cache ephemeral keys for |
381 // a short period of time. This object takes ownership of | 383 // a short period of time. This object takes ownership of |
382 // |ephemeral_key_source|. If not set then ephemeral keys will be generated | 384 // |ephemeral_key_source|. If not set then ephemeral keys will be generated |
383 // per-connection. | 385 // per-connection. |
384 void SetEphemeralKeySource(EphemeralKeySource* ephemeral_key_source); | 386 void SetEphemeralKeySource(EphemeralKeySource* ephemeral_key_source); |
385 | 387 |
386 // Install an externally created StrikeRegisterClient for use to | 388 // Install an externally created StrikeRegisterClient for use to |
387 // interact with the strike register. This object takes ownership | 389 // interact with the strike register. This object takes ownership |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 std::unique_ptr<ValidateClientHelloResultCallback> done_cb) const; | 581 std::unique_ptr<ValidateClientHelloResultCallback> done_cb) const; |
580 | 582 |
581 // Callback class for bridging between ProcessClientHello and | 583 // Callback class for bridging between ProcessClientHello and |
582 // ProcessClientHelloAfterGetProof. | 584 // ProcessClientHelloAfterGetProof. |
583 class ProcessClientHelloCallback; | 585 class ProcessClientHelloCallback; |
584 friend class ProcessClientHelloCallback; | 586 friend class ProcessClientHelloCallback; |
585 | 587 |
586 // Portion of ProcessClientHello which executes after GetProof. | 588 // Portion of ProcessClientHello which executes after GetProof. |
587 void ProcessClientHelloAfterGetProof( | 589 void ProcessClientHelloAfterGetProof( |
588 bool found_error, | 590 bool found_error, |
| 591 std::unique_ptr<ProofSource::Details> proof_source_details, |
589 const ValidateClientHelloResultCallback::Result& validate_chlo_result, | 592 const ValidateClientHelloResultCallback::Result& validate_chlo_result, |
590 bool reject_only, | 593 bool reject_only, |
591 QuicConnectionId connection_id, | 594 QuicConnectionId connection_id, |
592 const IPEndPoint& client_address, | 595 const IPEndPoint& client_address, |
593 QuicVersion version, | 596 QuicVersion version, |
594 const QuicVersionVector& supported_versions, | 597 const QuicVersionVector& supported_versions, |
595 bool use_stateless_rejects, | 598 bool use_stateless_rejects, |
596 QuicConnectionId server_designated_connection_id, | 599 QuicConnectionId server_designated_connection_id, |
597 const QuicClock* clock, | 600 const QuicClock* clock, |
598 QuicRandom* rand, | 601 QuicRandom* rand, |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 std::string primary_scid; | 862 std::string primary_scid; |
860 | 863 |
861 private: | 864 private: |
862 friend class base::RefCounted<QuicCryptoProof>; | 865 friend class base::RefCounted<QuicCryptoProof>; |
863 virtual ~QuicCryptoProof(); | 866 virtual ~QuicCryptoProof(); |
864 }; | 867 }; |
865 | 868 |
866 } // namespace net | 869 } // namespace net |
867 | 870 |
868 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ | 871 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ |
OLD | NEW |