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

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

Issue 2353763002: Use refcounted ownership for ValidateClientHelloResultCallback::Result (Closed)
Patch Set: Created 4 years, 3 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/test_tools/crypto_test_utils.h" 5 #include "net/quic/test_tools/crypto_test_utils.h"
6 6
7 #include <openssl/bn.h> 7 #include <openssl/bn.h>
8 #include <openssl/ec.h> 8 #include <openssl/ec.h>
9 #include <openssl/ecdsa.h> 9 #include <openssl/ecdsa.h>
10 #include <openssl/evp.h> 10 #include <openssl/evp.h>
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 QuicCompressedCertsCache* compressed_certs_cache, 285 QuicCompressedCertsCache* compressed_certs_cache,
286 CryptoHandshakeMessage* out) 286 CryptoHandshakeMessage* out)
287 : crypto_config_(crypto_config), 287 : crypto_config_(crypto_config),
288 server_ip_(server_ip), 288 server_ip_(server_ip),
289 client_addr_(client_addr), 289 client_addr_(client_addr),
290 clock_(clock), 290 clock_(clock),
291 proof_(proof), 291 proof_(proof),
292 compressed_certs_cache_(compressed_certs_cache), 292 compressed_certs_cache_(compressed_certs_cache),
293 out_(out) {} 293 out_(out) {}
294 294
295 void Run(std::unique_ptr<ValidateClientHelloResultCallback::Result> result, 295 void Run(scoped_refptr<ValidateClientHelloResultCallback::Result> result,
296 std::unique_ptr<ProofSource::Details> /* details */) override { 296 std::unique_ptr<ProofSource::Details> /* details */) override {
297 QuicCryptoNegotiatedParameters params; 297 QuicCryptoNegotiatedParameters params;
298 string error_details; 298 string error_details;
299 DiversificationNonce diversification_nonce; 299 DiversificationNonce diversification_nonce;
300 CryptoHandshakeMessage rej; 300 CryptoHandshakeMessage rej;
301 crypto_config_->ProcessClientHello( 301 crypto_config_->ProcessClientHello(
302 *result, /*reject_only=*/false, /*connection_id=*/1, server_ip_, 302 result, /*reject_only=*/false, /*connection_id=*/1, server_ip_,
303 client_addr_, AllSupportedVersions().front(), AllSupportedVersions(), 303 client_addr_, AllSupportedVersions().front(), AllSupportedVersions(),
304 /*use_stateless_rejects=*/true, /*server_designated_connection_id=*/0, 304 /*use_stateless_rejects=*/true, /*server_designated_connection_id=*/0,
305 clock_, QuicRandom::GetInstance(), compressed_certs_cache_, &params, 305 clock_, QuicRandom::GetInstance(), compressed_certs_cache_, &params,
306 proof_, /*total_framing_overhead=*/50, kDefaultMaxPacketSize, &rej, 306 proof_, /*total_framing_overhead=*/50, kDefaultMaxPacketSize, &rej,
307 &diversification_nonce, &error_details); 307 &diversification_nonce, &error_details);
308 // Verify output is a REJ or SREJ. 308 // Verify output is a REJ or SREJ.
309 EXPECT_THAT(rej.tag(), 309 EXPECT_THAT(rej.tag(),
310 testing::AnyOf(testing::Eq(kSREJ), testing::Eq(kREJ))); 310 testing::AnyOf(testing::Eq(kSREJ), testing::Eq(kREJ)));
311 311
312 VLOG(1) << "Extract valid STK and SCID from\n" << rej.DebugString(); 312 VLOG(1) << "Extract valid STK and SCID from\n" << rej.DebugString();
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 // Pass a inchoate CHLO. 966 // Pass a inchoate CHLO.
967 crypto_config->ValidateClientHello( 967 crypto_config->ValidateClientHello(
968 inchoate_chlo, client_addr.address(), server_ip, version, clock, proof, 968 inchoate_chlo, client_addr.address(), server_ip, version, clock, proof,
969 std::unique_ptr<FullChloGenerator>( 969 std::unique_ptr<FullChloGenerator>(
970 new FullChloGenerator(crypto_config, server_ip, client_addr, clock, 970 new FullChloGenerator(crypto_config, server_ip, client_addr, clock,
971 proof, compressed_certs_cache, out))); 971 proof, compressed_certs_cache, out)));
972 } 972 }
973 973
974 } // namespace test 974 } // namespace test
975 } // namespace net 975 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698