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

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

Issue 2511643002: Refactoring output of ProofSource::GetProof (no functional changes). (Closed)
Patch Set: Refactoring output of ProofSource::GetProof (no functional changes). 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
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 "base/base64.h" 9 #include "base/base64.h"
10 #include "crypto/secure_hash.h" 10 #include "crypto/secure_hash.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 QuicCryptoServerStream::QuicCryptoServerStream( 86 QuicCryptoServerStream::QuicCryptoServerStream(
87 const QuicCryptoServerConfig* crypto_config, 87 const QuicCryptoServerConfig* crypto_config,
88 QuicCompressedCertsCache* compressed_certs_cache, 88 QuicCompressedCertsCache* compressed_certs_cache,
89 bool use_stateless_rejects_if_peer_supported, 89 bool use_stateless_rejects_if_peer_supported,
90 QuicSession* session, 90 QuicSession* session,
91 Helper* helper) 91 Helper* helper)
92 : QuicCryptoServerStreamBase(session), 92 : QuicCryptoServerStreamBase(session),
93 crypto_config_(crypto_config), 93 crypto_config_(crypto_config),
94 compressed_certs_cache_(compressed_certs_cache), 94 compressed_certs_cache_(compressed_certs_cache),
95 crypto_proof_(new QuicCryptoProof), 95 signed_config_(new QuicSignedServerConfig),
96 validate_client_hello_cb_(nullptr), 96 validate_client_hello_cb_(nullptr),
97 helper_(helper), 97 helper_(helper),
98 num_handshake_messages_(0), 98 num_handshake_messages_(0),
99 num_handshake_messages_with_server_nonces_(0), 99 num_handshake_messages_with_server_nonces_(0),
100 send_server_config_update_cb_(nullptr), 100 send_server_config_update_cb_(nullptr),
101 num_server_config_update_messages_sent_(0), 101 num_server_config_update_messages_sent_(0),
102 use_stateless_rejects_if_peer_supported_( 102 use_stateless_rejects_if_peer_supported_(
103 use_stateless_rejects_if_peer_supported), 103 use_stateless_rejects_if_peer_supported),
104 peer_supports_stateless_rejects_(false), 104 peer_supports_stateless_rejects_(false),
105 chlo_packet_size_(0), 105 chlo_packet_size_(0),
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 return; 156 return;
157 } 157 }
158 158
159 CryptoUtils::HashHandshakeMessage(message, &chlo_hash_); 159 CryptoUtils::HashHandshakeMessage(message, &chlo_hash_);
160 160
161 std::unique_ptr<ValidateCallback> cb(new ValidateCallback(this)); 161 std::unique_ptr<ValidateCallback> cb(new ValidateCallback(this));
162 validate_client_hello_cb_ = cb.get(); 162 validate_client_hello_cb_ = cb.get();
163 crypto_config_->ValidateClientHello( 163 crypto_config_->ValidateClientHello(
164 message, session()->connection()->peer_address().address(), 164 message, session()->connection()->peer_address().address(),
165 session()->connection()->self_address().address(), version(), 165 session()->connection()->self_address().address(), version(),
166 session()->connection()->clock(), crypto_proof_, std::move(cb)); 166 session()->connection()->clock(), signed_config_, std::move(cb));
167 } 167 }
168 168
169 void QuicCryptoServerStream::FinishProcessingHandshakeMessage( 169 void QuicCryptoServerStream::FinishProcessingHandshakeMessage(
170 scoped_refptr<ValidateClientHelloResultCallback::Result> result, 170 scoped_refptr<ValidateClientHelloResultCallback::Result> result,
171 std::unique_ptr<ProofSource::Details> details) { 171 std::unique_ptr<ProofSource::Details> details) {
172 const CryptoHandshakeMessage& message = result->client_hello; 172 const CryptoHandshakeMessage& message = result->client_hello;
173 173
174 // Clear the callback that got us here. 174 // Clear the callback that got us here.
175 DCHECK(validate_client_hello_cb_ != nullptr); 175 DCHECK(validate_client_hello_cb_ != nullptr);
176 validate_client_hello_cb_ = nullptr; 176 validate_client_hello_cb_ = nullptr;
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 peer_supports_stateless_rejects_; 468 peer_supports_stateless_rejects_;
469 QuicConnection* connection = session()->connection(); 469 QuicConnection* connection = session()->connection();
470 const QuicConnectionId server_designated_connection_id = 470 const QuicConnectionId server_designated_connection_id =
471 GenerateConnectionIdForReject(use_stateless_rejects_in_crypto_config); 471 GenerateConnectionIdForReject(use_stateless_rejects_in_crypto_config);
472 crypto_config_->ProcessClientHello( 472 crypto_config_->ProcessClientHello(
473 result, /*reject_only=*/false, connection->connection_id(), 473 result, /*reject_only=*/false, connection->connection_id(),
474 connection->self_address().address(), connection->peer_address(), 474 connection->self_address().address(), connection->peer_address(),
475 version(), connection->supported_versions(), 475 version(), connection->supported_versions(),
476 use_stateless_rejects_in_crypto_config, server_designated_connection_id, 476 use_stateless_rejects_in_crypto_config, server_designated_connection_id,
477 connection->clock(), connection->random_generator(), 477 connection->clock(), connection->random_generator(),
478 compressed_certs_cache_, crypto_negotiated_params_, crypto_proof_, 478 compressed_certs_cache_, crypto_negotiated_params_, signed_config_,
479 QuicCryptoStream::CryptoMessageFramingOverhead(version()), 479 QuicCryptoStream::CryptoMessageFramingOverhead(version()),
480 chlo_packet_size_, std::move(done_cb)); 480 chlo_packet_size_, std::move(done_cb));
481 } 481 }
482 482
483 void QuicCryptoServerStream::OverrideQuicConfigDefaults(QuicConfig* config) {} 483 void QuicCryptoServerStream::OverrideQuicConfigDefaults(QuicConfig* config) {}
484 484
485 QuicCryptoServerStream::ValidateCallback::ValidateCallback( 485 QuicCryptoServerStream::ValidateCallback::ValidateCallback(
486 QuicCryptoServerStream* parent) 486 QuicCryptoServerStream* parent)
487 : parent_(parent) {} 487 : parent_(parent) {}
488 488
(...skipping 13 matching lines...) Expand all
502 QuicConnectionId QuicCryptoServerStream::GenerateConnectionIdForReject( 502 QuicConnectionId QuicCryptoServerStream::GenerateConnectionIdForReject(
503 bool use_stateless_rejects) { 503 bool use_stateless_rejects) {
504 if (!use_stateless_rejects) { 504 if (!use_stateless_rejects) {
505 return 0; 505 return 0;
506 } 506 }
507 return helper_->GenerateConnectionIdForReject( 507 return helper_->GenerateConnectionIdForReject(
508 session()->connection()->connection_id()); 508 session()->connection()->connection_id());
509 } 509 }
510 510
511 } // namespace net 511 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_crypto_server_stream.h ('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