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

Side by Side Diff: net/quic/core/quic_crypto_server_stream.cc

Issue 2825083003: Landing Recent QUIC changes until Mon Apr 17 2017 (Closed)
Patch Set: Format Created 3 years, 8 months 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
OLDNEW
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 "net/quic/core/crypto/crypto_protocol.h" 9 #include "net/quic/core/crypto/crypto_protocol.h"
10 #include "net/quic/core/crypto/crypto_utils.h" 10 #include "net/quic/core/crypto/crypto_utils.h"
11 #include "net/quic/core/crypto/quic_crypto_server_config.h" 11 #include "net/quic/core/crypto/quic_crypto_server_config.h"
12 #include "net/quic/core/crypto/quic_random.h" 12 #include "net/quic/core/crypto/quic_random.h"
13 #include "net/quic/core/proto/cached_network_parameters.pb.h" 13 #include "net/quic/core/proto/cached_network_parameters.pb.h"
14 #include "net/quic/core/quic_config.h" 14 #include "net/quic/core/quic_config.h"
15 #include "net/quic/core/quic_flags.h"
16 #include "net/quic/core/quic_packets.h" 15 #include "net/quic/core/quic_packets.h"
17 #include "net/quic/core/quic_session.h" 16 #include "net/quic/core/quic_session.h"
17 #include "net/quic/platform/api/quic_flags.h"
18 #include "net/quic/platform/api/quic_logging.h" 18 #include "net/quic/platform/api/quic_logging.h"
19 #include "net/quic/platform/api/quic_string_piece.h" 19 #include "net/quic/platform/api/quic_string_piece.h"
20 #include "net/quic/platform/api/quic_text_utils.h" 20 #include "net/quic/platform/api/quic_text_utils.h"
21 #include "third_party/boringssl/src/include/openssl/sha.h" 21 #include "third_party/boringssl/src/include/openssl/sha.h"
22 22
23 using std::string; 23 using std::string;
24 24
25 namespace net { 25 namespace net {
26 26
27 class QuicCryptoServerStream::ProcessClientHelloCallback 27 class QuicCryptoServerStream::ProcessClientHelloCallback
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 return; 136 return;
137 } 137 }
138 138
139 if (message.tag() != kCHLO) { 139 if (message.tag() != kCHLO) {
140 CloseConnectionWithDetails(QUIC_INVALID_CRYPTO_MESSAGE_TYPE, 140 CloseConnectionWithDetails(QUIC_INVALID_CRYPTO_MESSAGE_TYPE,
141 "Handshake packet not CHLO"); 141 "Handshake packet not CHLO");
142 return; 142 return;
143 } 143 }
144 144
145 if (validate_client_hello_cb_ != nullptr || 145 if (validate_client_hello_cb_ != nullptr ||
146 (base::GetFlag(FLAGS_quic_reloadable_flag_fix_quic_callback_crash) && 146 process_client_hello_cb_ != nullptr) {
147 process_client_hello_cb_ != nullptr)) {
148 // Already processing some other handshake message. The protocol 147 // Already processing some other handshake message. The protocol
149 // does not allow for clients to send multiple handshake messages 148 // does not allow for clients to send multiple handshake messages
150 // before the server has a chance to respond. 149 // before the server has a chance to respond.
151 CloseConnectionWithDetails( 150 CloseConnectionWithDetails(
152 QUIC_CRYPTO_MESSAGE_WHILE_VALIDATING_CLIENT_HELLO, 151 QUIC_CRYPTO_MESSAGE_WHILE_VALIDATING_CLIENT_HELLO,
153 "Unexpected handshake message while processing CHLO"); 152 "Unexpected handshake message while processing CHLO");
154 return; 153 return;
155 } 154 }
156 155
157 CryptoUtils::HashHandshakeMessage(message, &chlo_hash_, 156 CryptoUtils::HashHandshakeMessage(message, &chlo_hash_,
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 QuicConnectionId QuicCryptoServerStream::GenerateConnectionIdForReject( 464 QuicConnectionId QuicCryptoServerStream::GenerateConnectionIdForReject(
466 bool use_stateless_rejects) { 465 bool use_stateless_rejects) {
467 if (!use_stateless_rejects) { 466 if (!use_stateless_rejects) {
468 return 0; 467 return 0;
469 } 468 }
470 return helper_->GenerateConnectionIdForReject( 469 return helper_->GenerateConnectionIdForReject(
471 session()->connection()->connection_id()); 470 session()->connection()->connection_id());
472 } 471 }
473 472
474 } // namespace net 473 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_crypto_client_stream_test.cc ('k') | net/quic/core/quic_crypto_server_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698