Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Side by Side Diff: net/quic/test_tools/mock_crypto_client_stream.cc

Issue 2453113002: Fix object-lifetime issues in async GetProof callpaths (Closed)
Patch Set: Updated patchset dependency Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/test_tools/crypto_test_utils_test.cc ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/quic_decrypter.h" 7 #include "net/quic/core/crypto/quic_decrypter.h"
8 #include "net/quic/core/crypto/quic_encrypter.h" 8 #include "net/quic/core/crypto/quic_encrypter.h"
9 #include "net/quic/core/quic_client_session_base.h" 9 #include "net/quic/core/quic_client_session_base.h"
10 #include "net/quic/test_tools/quic_config_peer.h" 10 #include "net/quic/test_tools/quic_config_peer.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 QUIC_PROOF_INVALID, "proof invalid", 51 QUIC_PROOF_INVALID, "proof invalid",
52 ConnectionCloseBehavior::SILENT_CLOSE); 52 ConnectionCloseBehavior::SILENT_CLOSE);
53 return; 53 return;
54 } 54 }
55 } 55 }
56 56
57 switch (handshake_mode_) { 57 switch (handshake_mode_) {
58 case ZERO_RTT: { 58 case ZERO_RTT: {
59 encryption_established_ = true; 59 encryption_established_ = true;
60 handshake_confirmed_ = false; 60 handshake_confirmed_ = false;
61 crypto_negotiated_params_.key_exchange = kC255; 61 crypto_negotiated_params_->key_exchange = kC255;
62 crypto_negotiated_params_.aead = kAESG; 62 crypto_negotiated_params_->aead = kAESG;
63 if (proof_verify_details_) { 63 if (proof_verify_details_) {
64 reinterpret_cast<QuicClientSessionBase*>(session()) 64 reinterpret_cast<QuicClientSessionBase*>(session())
65 ->OnProofVerifyDetailsAvailable(*proof_verify_details_); 65 ->OnProofVerifyDetailsAvailable(*proof_verify_details_);
66 } 66 }
67 session()->connection()->SetDecrypter(ENCRYPTION_INITIAL, 67 session()->connection()->SetDecrypter(ENCRYPTION_INITIAL,
68 QuicDecrypter::Create(kNULL)); 68 QuicDecrypter::Create(kNULL));
69 session()->connection()->SetEncrypter(ENCRYPTION_INITIAL, 69 session()->connection()->SetEncrypter(ENCRYPTION_INITIAL,
70 QuicEncrypter::Create(kNULL)); 70 QuicEncrypter::Create(kNULL));
71 session()->connection()->SetDefaultEncryptionLevel(ENCRYPTION_INITIAL); 71 session()->connection()->SetDefaultEncryptionLevel(ENCRYPTION_INITIAL);
72 session()->OnCryptoHandshakeEvent( 72 session()->OnCryptoHandshakeEvent(
73 QuicSession::ENCRYPTION_FIRST_ESTABLISHED); 73 QuicSession::ENCRYPTION_FIRST_ESTABLISHED);
74 break; 74 break;
75 } 75 }
76 76
77 case CONFIRM_HANDSHAKE: { 77 case CONFIRM_HANDSHAKE: {
78 encryption_established_ = true; 78 encryption_established_ = true;
79 handshake_confirmed_ = true; 79 handshake_confirmed_ = true;
80 crypto_negotiated_params_.key_exchange = kC255; 80 crypto_negotiated_params_->key_exchange = kC255;
81 crypto_negotiated_params_.aead = kAESG; 81 crypto_negotiated_params_->aead = kAESG;
82 if (proof_verify_details_) { 82 if (proof_verify_details_) {
83 reinterpret_cast<QuicClientSessionBase*>(session()) 83 reinterpret_cast<QuicClientSessionBase*>(session())
84 ->OnProofVerifyDetailsAvailable(*proof_verify_details_); 84 ->OnProofVerifyDetailsAvailable(*proof_verify_details_);
85 } 85 }
86 SetConfigNegotiated(); 86 SetConfigNegotiated();
87 session()->connection()->SetDecrypter(ENCRYPTION_FORWARD_SECURE, 87 session()->connection()->SetDecrypter(ENCRYPTION_FORWARD_SECURE,
88 QuicDecrypter::Create(kNULL)); 88 QuicDecrypter::Create(kNULL));
89 session()->connection()->SetEncrypter(ENCRYPTION_FORWARD_SECURE, 89 session()->connection()->SetEncrypter(ENCRYPTION_FORWARD_SECURE,
90 QuicEncrypter::Create(kNULL)); 90 QuicEncrypter::Create(kNULL));
91 session()->connection()->SetDefaultEncryptionLevel( 91 session()->connection()->SetDefaultEncryptionLevel(
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 config.ToHandshakeMessage(&msg); 134 config.ToHandshakeMessage(&msg);
135 string error_details; 135 string error_details;
136 const QuicErrorCode error = 136 const QuicErrorCode error =
137 session()->config()->ProcessPeerHello(msg, CLIENT, &error_details); 137 session()->config()->ProcessPeerHello(msg, CLIENT, &error_details);
138 ASSERT_EQ(QUIC_NO_ERROR, error); 138 ASSERT_EQ(QUIC_NO_ERROR, error);
139 ASSERT_TRUE(session()->config()->negotiated()); 139 ASSERT_TRUE(session()->config()->negotiated());
140 session()->OnConfigNegotiated(); 140 session()->OnConfigNegotiated();
141 } 141 }
142 142
143 } // namespace net 143 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/crypto_test_utils_test.cc ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698