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/core/crypto/crypto_server_config_protobuf.h" | 7 #include "net/quic/core/crypto/crypto_server_config_protobuf.h" |
8 #include "net/quic/core/quic_utils.h" | 8 #include "net/quic/core/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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 QuicVersion version(AllSupportedVersions().front()); | 145 QuicVersion version(AllSupportedVersions().front()); |
146 // clang-format off | 146 // clang-format off |
147 CryptoHandshakeMessage inchoate_chlo = CryptoTestUtils::Message( | 147 CryptoHandshakeMessage inchoate_chlo = CryptoTestUtils::Message( |
148 "CHLO", | 148 "CHLO", |
149 "PDMD", "X509", | 149 "PDMD", "X509", |
150 "AEAD", "AESG", | 150 "AEAD", "AESG", |
151 "KEXS", "C255", | 151 "KEXS", "C255", |
152 "COPT", "SREJ", | 152 "COPT", "SREJ", |
153 "PUBS", pub_hex.c_str(), | 153 "PUBS", pub_hex.c_str(), |
154 "NONC", nonce_hex.c_str(), | 154 "NONC", nonce_hex.c_str(), |
155 "VER\0", QuicUtils::TagToString(QuicVersionToQuicTag(version)).c_str(), | 155 "VER\0", QuicTagToString(QuicVersionToQuicTag(version)).c_str(), |
156 "$padding", static_cast<int>(kClientHelloMinimumSize), | 156 "$padding", static_cast<int>(kClientHelloMinimumSize), |
157 nullptr); | 157 nullptr); |
158 // clang-format on | 158 // clang-format on |
159 | 159 |
160 CryptoTestUtils::GenerateFullCHLO(inchoate_chlo, &crypto_config, server_ip, | 160 CryptoTestUtils::GenerateFullCHLO(inchoate_chlo, &crypto_config, server_ip, |
161 client_addr, version, &clock, signed_config, | 161 client_addr, version, &clock, signed_config, |
162 &compressed_certs_cache, &full_chlo); | 162 &compressed_certs_cache, &full_chlo); |
163 // Verify that full_chlo can pass crypto_config's verification. | 163 // Verify that full_chlo can pass crypto_config's verification. |
164 ShloVerifier shlo_verifier(&crypto_config, server_ip, client_addr, &clock, | 164 ShloVerifier shlo_verifier(&crypto_config, server_ip, client_addr, &clock, |
165 signed_config, &compressed_certs_cache); | 165 signed_config, &compressed_certs_cache); |
166 crypto_config.ValidateClientHello( | 166 crypto_config.ValidateClientHello( |
167 full_chlo, client_addr.address(), server_ip, version, &clock, | 167 full_chlo, client_addr.address(), server_ip, version, &clock, |
168 signed_config, shlo_verifier.GetValidateClientHelloCallback()); | 168 signed_config, shlo_verifier.GetValidateClientHelloCallback()); |
169 } | 169 } |
170 | 170 |
171 } // namespace test | 171 } // namespace test |
172 } // namespace net | 172 } // namespace net |
OLD | NEW |