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/core/crypto/null_decrypter.h" | 7 #include "net/quic/core/crypto/null_decrypter.h" |
8 #include "net/quic/core/crypto/null_encrypter.h" | 8 #include "net/quic/core/crypto/null_encrypter.h" |
9 #include "net/quic/core/crypto/quic_decrypter.h" | 9 #include "net/quic/core/crypto/quic_decrypter.h" |
10 #include "net/quic/core/crypto/quic_encrypter.h" | 10 #include "net/quic/core/crypto/quic_encrypter.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 MockCryptoClientStream::~MockCryptoClientStream() {} | 37 MockCryptoClientStream::~MockCryptoClientStream() {} |
38 | 38 |
39 void MockCryptoClientStream::OnHandshakeMessage( | 39 void MockCryptoClientStream::OnHandshakeMessage( |
40 const CryptoHandshakeMessage& message) { | 40 const CryptoHandshakeMessage& message) { |
41 CloseConnectionWithDetails(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE, | 41 CloseConnectionWithDetails(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE, |
42 "Forced mock failure"); | 42 "Forced mock failure"); |
43 } | 43 } |
44 | 44 |
45 void MockCryptoClientStream::CryptoConnect() { | 45 void MockCryptoClientStream::CryptoConnect() { |
46 if (proof_verify_details_) { | 46 if (proof_verify_details_) { |
47 bool unused = false; | |
48 if (!proof_verify_details_->cert_verify_result.verified_cert | 47 if (!proof_verify_details_->cert_verify_result.verified_cert |
49 ->VerifyNameMatch(server_id_.host(), &unused)) { | 48 ->VerifyNameMatch(server_id_.host(), false)) { |
50 handshake_confirmed_ = false; | 49 handshake_confirmed_ = false; |
51 encryption_established_ = false; | 50 encryption_established_ = false; |
52 session()->connection()->CloseConnection( | 51 session()->connection()->CloseConnection( |
53 QUIC_PROOF_INVALID, "proof invalid", | 52 QUIC_PROOF_INVALID, "proof invalid", |
54 ConnectionCloseBehavior::SILENT_CLOSE); | 53 ConnectionCloseBehavior::SILENT_CLOSE); |
55 return; | 54 return; |
56 } | 55 } |
57 } | 56 } |
58 | 57 |
59 switch (handshake_mode_) { | 58 switch (handshake_mode_) { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 config.ToHandshakeMessage(&msg); | 141 config.ToHandshakeMessage(&msg); |
143 string error_details; | 142 string error_details; |
144 const QuicErrorCode error = | 143 const QuicErrorCode error = |
145 session()->config()->ProcessPeerHello(msg, CLIENT, &error_details); | 144 session()->config()->ProcessPeerHello(msg, CLIENT, &error_details); |
146 ASSERT_EQ(QUIC_NO_ERROR, error); | 145 ASSERT_EQ(QUIC_NO_ERROR, error); |
147 ASSERT_TRUE(session()->config()->negotiated()); | 146 ASSERT_TRUE(session()->config()->negotiated()); |
148 session()->OnConfigNegotiated(); | 147 session()->OnConfigNegotiated(); |
149 } | 148 } |
150 | 149 |
151 } // namespace net | 150 } // namespace net |
OLD | NEW |