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/core/quic_crypto_server_stream.h" | 5 #include "net/quic/core/quic_crypto_server_stream.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "crypto/secure_hash.h" | 10 #include "crypto/secure_hash.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 // NOTE: the SHLO will be encrypted with the new server write key. | 248 // NOTE: the SHLO will be encrypted with the new server write key. |
249 session()->connection()->SetEncrypter( | 249 session()->connection()->SetEncrypter( |
250 ENCRYPTION_INITIAL, | 250 ENCRYPTION_INITIAL, |
251 crypto_negotiated_params_->initial_crypters.encrypter.release()); | 251 crypto_negotiated_params_->initial_crypters.encrypter.release()); |
252 session()->connection()->SetDefaultEncryptionLevel(ENCRYPTION_INITIAL); | 252 session()->connection()->SetDefaultEncryptionLevel(ENCRYPTION_INITIAL); |
253 // Set the decrypter immediately so that we no longer accept unencrypted | 253 // Set the decrypter immediately so that we no longer accept unencrypted |
254 // packets. | 254 // packets. |
255 session()->connection()->SetDecrypter( | 255 session()->connection()->SetDecrypter( |
256 ENCRYPTION_INITIAL, | 256 ENCRYPTION_INITIAL, |
257 crypto_negotiated_params_->initial_crypters.decrypter.release()); | 257 crypto_negotiated_params_->initial_crypters.decrypter.release()); |
258 if (version() > QUIC_VERSION_32) { | 258 session()->connection()->SetDiversificationNonce(*diversification_nonce); |
259 session()->connection()->SetDiversificationNonce(*diversification_nonce); | |
260 } | |
261 | 259 |
262 SendHandshakeMessage(*reply); | 260 SendHandshakeMessage(*reply); |
263 | 261 |
264 session()->connection()->SetEncrypter( | 262 session()->connection()->SetEncrypter( |
265 ENCRYPTION_FORWARD_SECURE, | 263 ENCRYPTION_FORWARD_SECURE, |
266 crypto_negotiated_params_->forward_secure_crypters.encrypter.release()); | 264 crypto_negotiated_params_->forward_secure_crypters.encrypter.release()); |
267 session()->connection()->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE); | 265 session()->connection()->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE); |
268 | 266 |
269 session()->connection()->SetAlternativeDecrypter( | 267 session()->connection()->SetAlternativeDecrypter( |
270 ENCRYPTION_FORWARD_SECURE, | 268 ENCRYPTION_FORWARD_SECURE, |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 QuicConnectionId QuicCryptoServerStream::GenerateConnectionIdForReject( | 500 QuicConnectionId QuicCryptoServerStream::GenerateConnectionIdForReject( |
503 bool use_stateless_rejects) { | 501 bool use_stateless_rejects) { |
504 if (!use_stateless_rejects) { | 502 if (!use_stateless_rejects) { |
505 return 0; | 503 return 0; |
506 } | 504 } |
507 return helper_->GenerateConnectionIdForReject( | 505 return helper_->GenerateConnectionIdForReject( |
508 session()->connection()->connection_id()); | 506 session()->connection()->connection_id()); |
509 } | 507 } |
510 | 508 |
511 } // namespace net | 509 } // namespace net |
OLD | NEW |