| OLD | NEW |
| 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 "net/quic/crypto/crypto_server_config_protobuf.h" | 7 #include "net/quic/crypto/crypto_server_config_protobuf.h" |
| 8 #include "net/quic/quic_utils.h" | 8 #include "net/quic/quic_utils.h" |
| 9 #include "net/quic/test_tools/mock_clock.h" | 9 #include "net/quic/test_tools/mock_clock.h" |
| 10 #include "net/test/gtest_util.h" | 10 #include "net/test/gtest_util.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 QuicCryptoProof* proof, | 25 QuicCryptoProof* proof, |
| 26 QuicCompressedCertsCache* compressed_certs_cache) | 26 QuicCompressedCertsCache* compressed_certs_cache) |
| 27 : crypto_config_(crypto_config), | 27 : crypto_config_(crypto_config), |
| 28 server_ip_(server_ip), | 28 server_ip_(server_ip), |
| 29 client_addr_(client_addr), | 29 client_addr_(client_addr), |
| 30 clock_(clock), | 30 clock_(clock), |
| 31 proof_(proof), | 31 proof_(proof), |
| 32 compressed_certs_cache_(compressed_certs_cache) {} | 32 compressed_certs_cache_(compressed_certs_cache) {} |
| 33 | 33 |
| 34 // Verify that the output message is a SHLO. | 34 // Verify that the output message is a SHLO. |
| 35 void RunImpl( | 35 void RunImpl(const CryptoHandshakeMessage& chlo, |
| 36 const CryptoHandshakeMessage& chlo, | 36 const ValidateClientHelloResultCallback::Result& result, |
| 37 const ValidateClientHelloResultCallback::Result& result) override { | 37 std::unique_ptr<ProofSource::Details> /* details */) override { |
| 38 QuicCryptoNegotiatedParameters params; | 38 QuicCryptoNegotiatedParameters params; |
| 39 string error_details; | 39 string error_details; |
| 40 DiversificationNonce diversification_nonce; | 40 DiversificationNonce diversification_nonce; |
| 41 CryptoHandshakeMessage out; | 41 CryptoHandshakeMessage out; |
| 42 crypto_config_->ProcessClientHello( | 42 crypto_config_->ProcessClientHello( |
| 43 result, /*reject_only=*/false, /*connection_id=*/1, server_ip_, | 43 result, /*reject_only=*/false, /*connection_id=*/1, server_ip_, |
| 44 client_addr_, QuicSupportedVersions().front(), QuicSupportedVersions(), | 44 client_addr_, QuicSupportedVersions().front(), QuicSupportedVersions(), |
| 45 /*use_stateless_rejects=*/true, /*server_designated_connection_id=*/0, | 45 /*use_stateless_rejects=*/true, /*server_designated_connection_id=*/0, |
| 46 clock_, QuicRandom::GetInstance(), compressed_certs_cache_, ¶ms, | 46 clock_, QuicRandom::GetInstance(), compressed_certs_cache_, ¶ms, |
| 47 proof_, &out, &diversification_nonce, &error_details); | 47 proof_, &out, &diversification_nonce, &error_details); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 &compressed_certs_cache, &full_chlo); | 117 &compressed_certs_cache, &full_chlo); |
| 118 // Verify that full_chlo can pass crypto_config's verification. | 118 // Verify that full_chlo can pass crypto_config's verification. |
| 119 crypto_config.ValidateClientHello( | 119 crypto_config.ValidateClientHello( |
| 120 full_chlo, client_addr.address(), server_ip, version, &clock, &proof, | 120 full_chlo, client_addr.address(), server_ip, version, &clock, &proof, |
| 121 new ShloVerifier(&crypto_config, server_ip, client_addr, &clock, &proof, | 121 new ShloVerifier(&crypto_config, server_ip, client_addr, &clock, &proof, |
| 122 &compressed_certs_cache)); | 122 &compressed_certs_cache)); |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace test | 125 } // namespace test |
| 126 } // namespace net | 126 } // namespace net |
| OLD | NEW |