OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "net/quic/quic_crypto_server_stream.h" | 5 #include "net/quic/quic_crypto_server_stream.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "crypto/secure_hash.h" | 8 #include "crypto/secure_hash.h" |
9 #include "net/quic/crypto/crypto_protocol.h" | 9 #include "net/quic/crypto/crypto_protocol.h" |
10 #include "net/quic/crypto/crypto_utils.h" | 10 #include "net/quic/crypto/crypto_utils.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 handshake_confirmed_ = true; | 151 handshake_confirmed_ = true; |
152 session()->OnCryptoHandshakeEvent(QuicSession::HANDSHAKE_CONFIRMED); | 152 session()->OnCryptoHandshakeEvent(QuicSession::HANDSHAKE_CONFIRMED); |
153 | 153 |
154 // Now that the handshake is complete, send an updated server config and | 154 // Now that the handshake is complete, send an updated server config and |
155 // source-address token to the client. | 155 // source-address token to the client. |
156 SendServerConfigUpdate(NULL); | 156 SendServerConfigUpdate(NULL); |
157 } | 157 } |
158 | 158 |
159 void QuicCryptoServerStream::SendServerConfigUpdate( | 159 void QuicCryptoServerStream::SendServerConfigUpdate( |
160 const CachedNetworkParameters* cached_network_params) { | 160 const CachedNetworkParameters* cached_network_params) { |
161 if (session()->connection()->version() <= QUIC_VERSION_21) { | 161 if (session()->connection()->version() <= QUIC_VERSION_21 || |
| 162 !handshake_confirmed_) { |
162 return; | 163 return; |
163 } | 164 } |
164 | 165 |
165 CryptoHandshakeMessage server_config_update_message; | 166 CryptoHandshakeMessage server_config_update_message; |
166 if (!crypto_config_.BuildServerConfigUpdateMessage( | 167 if (!crypto_config_.BuildServerConfigUpdateMessage( |
167 session()->connection()->peer_address(), | 168 session()->connection()->peer_address(), |
168 session()->connection()->clock(), | 169 session()->connection()->clock(), |
169 session()->connection()->random_generator(), | 170 session()->connection()->random_generator(), |
170 crypto_negotiated_params_, | 171 crypto_negotiated_params_, |
171 cached_network_params, | 172 cached_network_params, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 246 |
246 void QuicCryptoServerStream::ValidateCallback::RunImpl( | 247 void QuicCryptoServerStream::ValidateCallback::RunImpl( |
247 const CryptoHandshakeMessage& client_hello, | 248 const CryptoHandshakeMessage& client_hello, |
248 const Result& result) { | 249 const Result& result) { |
249 if (parent_ != NULL) { | 250 if (parent_ != NULL) { |
250 parent_->FinishProcessingHandshakeMessage(client_hello, result); | 251 parent_->FinishProcessingHandshakeMessage(client_hello, result); |
251 } | 252 } |
252 } | 253 } |
253 | 254 |
254 } // namespace net | 255 } // namespace net |
OLD | NEW |