OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_STATELESS_REJECTOR_H_ | 5 #ifndef NET_QUIC_STATELESS_REJECTOR_H_ |
6 #define NET_QUIC_STATELESS_REJECTOR_H_ | 6 #define NET_QUIC_STATELESS_REJECTOR_H_ |
7 | 7 |
8 #include "base/strings/string_piece.h" | 8 #include "base/strings/string_piece.h" |
9 #include "net/quic/core/crypto/crypto_framer.h" | 9 #include "net/quic/core/crypto/crypto_framer.h" |
10 #include "net/quic/core/crypto/quic_crypto_server_config.h" | 10 #include "net/quic/core/crypto/quic_crypto_server_config.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // Returns the error code when state() returns FAILED. | 60 // Returns the error code when state() returns FAILED. |
61 QuicErrorCode error() const { return error_; } | 61 QuicErrorCode error() const { return error_; } |
62 | 62 |
63 // Returns the error details when state() returns FAILED. | 63 // Returns the error details when state() returns FAILED. |
64 std::string error_details() const { return error_details_; } | 64 std::string error_details() const { return error_details_; } |
65 | 65 |
66 // Returns the connection ID. | 66 // Returns the connection ID. |
67 QuicConnectionId connection_id() const { return connection_id_; } | 67 QuicConnectionId connection_id() const { return connection_id_; } |
68 | 68 |
69 // Returns the SREJ message when state() returns REJECTED. | 69 // Returns the SREJ message when state() returns REJECTED. |
70 const CryptoHandshakeMessage& reply() const { return reply_; } | 70 const CryptoHandshakeMessage& reply() const { return *reply_; } |
71 | 71 |
72 private: | 72 private: |
73 // Helper class which is passed in to | 73 // Helper class which is passed in to |
74 // QuicCryptoServerConfig::ValidateClientHello. | 74 // QuicCryptoServerConfig::ValidateClientHello. |
75 class ValidateCallback; | 75 class ValidateCallback; |
76 friend class ValidateCallback; | 76 friend class ValidateCallback; |
77 | 77 |
| 78 class ProcessClientHelloCallback; |
| 79 friend class ProcessClientHelloCallback; |
| 80 |
78 void ProcessClientHello( | 81 void ProcessClientHello( |
79 scoped_refptr<ValidateClientHelloResultCallback::Result> result, | 82 scoped_refptr<ValidateClientHelloResultCallback::Result> result, |
80 std::unique_ptr<StatelessRejector> rejector, | 83 std::unique_ptr<StatelessRejector> rejector, |
81 std::unique_ptr<StatelessRejector::ProcessDoneCallback> done_cb); | 84 std::unique_ptr<StatelessRejector::ProcessDoneCallback> done_cb); |
82 | 85 |
| 86 void ProcessClientHelloDone( |
| 87 QuicErrorCode error, |
| 88 const std::string& error_details, |
| 89 std::unique_ptr<CryptoHandshakeMessage> message, |
| 90 std::unique_ptr<StatelessRejector> rejector, |
| 91 std::unique_ptr<StatelessRejector::ProcessDoneCallback> done_cb); |
| 92 |
83 State state_; | 93 State state_; |
84 QuicErrorCode error_; | 94 QuicErrorCode error_; |
85 std::string error_details_; | 95 std::string error_details_; |
86 QuicVersion version_; | 96 QuicVersion version_; |
87 QuicVersionVector versions_; | 97 QuicVersionVector versions_; |
88 QuicConnectionId connection_id_; | 98 QuicConnectionId connection_id_; |
89 QuicConnectionId server_designated_connection_id_; | 99 QuicConnectionId server_designated_connection_id_; |
90 QuicByteCount chlo_packet_size_; | 100 QuicByteCount chlo_packet_size_; |
91 IPEndPoint client_address_; | 101 IPEndPoint client_address_; |
92 IPEndPoint server_address_; | 102 IPEndPoint server_address_; |
93 const QuicClock* clock_; | 103 const QuicClock* clock_; |
94 QuicRandom* random_; | 104 QuicRandom* random_; |
95 const QuicCryptoServerConfig* crypto_config_; | 105 const QuicCryptoServerConfig* crypto_config_; |
96 QuicCompressedCertsCache* compressed_certs_cache_; | 106 QuicCompressedCertsCache* compressed_certs_cache_; |
97 CryptoHandshakeMessage chlo_; | 107 CryptoHandshakeMessage chlo_; |
98 CryptoHandshakeMessage reply_; | 108 std::unique_ptr<CryptoHandshakeMessage> reply_; |
99 CryptoFramer crypto_framer_; | 109 CryptoFramer crypto_framer_; |
100 QuicCryptoProof proof_; | 110 QuicCryptoProof proof_; |
| 111 QuicCryptoNegotiatedParameters params_; |
101 | 112 |
102 DISALLOW_COPY_AND_ASSIGN(StatelessRejector); | 113 DISALLOW_COPY_AND_ASSIGN(StatelessRejector); |
103 }; | 114 }; |
104 | 115 |
105 } // namespace net | 116 } // namespace net |
106 | 117 |
107 #endif // NET_QUIC_STATELESS_REJECTOR_H_ | 118 #endif // NET_QUIC_STATELESS_REJECTOR_H_ |
OLD | NEW |