OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "net/quic/test_tools/mock_crypto_client_stream.h" | 5 #include "net/quic/test_tools/mock_crypto_client_stream.h" |
6 | 6 |
7 #include "net/quic/crypto/quic_decrypter.h" | 7 #include "net/quic/crypto/quic_decrypter.h" |
8 #include "net/quic/crypto/quic_encrypter.h" | 8 #include "net/quic/crypto/quic_encrypter.h" |
9 #include "net/quic/quic_client_session_base.h" | 9 #include "net/quic/quic_client_session_base.h" |
10 #include "net/quic/quic_server_id.h" | 10 #include "net/quic/quic_server_id.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 void MockCryptoClientStream::OnHandshakeMessage( | 30 void MockCryptoClientStream::OnHandshakeMessage( |
31 const CryptoHandshakeMessage& message) { | 31 const CryptoHandshakeMessage& message) { |
32 CloseConnection(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE); | 32 CloseConnection(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE); |
33 } | 33 } |
34 | 34 |
35 void MockCryptoClientStream::CryptoConnect() { | 35 void MockCryptoClientStream::CryptoConnect() { |
36 switch (handshake_mode_) { | 36 switch (handshake_mode_) { |
37 case ZERO_RTT: { | 37 case ZERO_RTT: { |
38 encryption_established_ = true; | 38 encryption_established_ = true; |
39 handshake_confirmed_ = false; | 39 handshake_confirmed_ = false; |
| 40 crypto_negotiated_params_.key_exchange = kC255; |
| 41 crypto_negotiated_params_.aead = kAESG; |
| 42 if (proof_verify_details_) { |
| 43 client_session()->OnProofVerifyDetailsAvailable(*proof_verify_details_); |
| 44 } |
40 session()->connection()->SetDecrypter(ENCRYPTION_INITIAL, | 45 session()->connection()->SetDecrypter(ENCRYPTION_INITIAL, |
41 QuicDecrypter::Create(kNULL)); | 46 QuicDecrypter::Create(kNULL)); |
42 session()->connection()->SetEncrypter(ENCRYPTION_INITIAL, | 47 session()->connection()->SetEncrypter(ENCRYPTION_INITIAL, |
43 QuicEncrypter::Create(kNULL)); | 48 QuicEncrypter::Create(kNULL)); |
44 session()->connection()->SetDefaultEncryptionLevel(ENCRYPTION_INITIAL); | 49 session()->connection()->SetDefaultEncryptionLevel(ENCRYPTION_INITIAL); |
45 session()->OnCryptoHandshakeEvent( | 50 session()->OnCryptoHandshakeEvent( |
46 QuicSession::ENCRYPTION_FIRST_ESTABLISHED); | 51 QuicSession::ENCRYPTION_FIRST_ESTABLISHED); |
47 break; | 52 break; |
48 } | 53 } |
49 | 54 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 ASSERT_EQ(QUIC_NO_ERROR, error); | 113 ASSERT_EQ(QUIC_NO_ERROR, error); |
109 ASSERT_TRUE(session()->config()->negotiated()); | 114 ASSERT_TRUE(session()->config()->negotiated()); |
110 session()->OnConfigNegotiated(); | 115 session()->OnConfigNegotiated(); |
111 } | 116 } |
112 | 117 |
113 QuicClientSessionBase* MockCryptoClientStream::client_session() { | 118 QuicClientSessionBase* MockCryptoClientStream::client_session() { |
114 return reinterpret_cast<QuicClientSessionBase*>(session()); | 119 return reinterpret_cast<QuicClientSessionBase*>(session()); |
115 } | 120 } |
116 | 121 |
117 } // namespace net | 122 } // namespace net |
OLD | NEW |