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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "crypto/openssl_util.h" | 10 #include "crypto/openssl_util.h" |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 QuicCryptoServerConfig* crypto_config) { | 952 QuicCryptoServerConfig* crypto_config) { |
953 // clang-format off | 953 // clang-format off |
954 return CryptoTestUtils::Message( | 954 return CryptoTestUtils::Message( |
955 "CHLO", | 955 "CHLO", |
956 "PDMD", "X509", | 956 "PDMD", "X509", |
957 "AEAD", "AESG", | 957 "AEAD", "AESG", |
958 "KEXS", "C255", | 958 "KEXS", "C255", |
959 "PUBS", CryptoTestUtils::GenerateClientPublicValuesHex().c_str(), | 959 "PUBS", CryptoTestUtils::GenerateClientPublicValuesHex().c_str(), |
960 "NONC", CryptoTestUtils::GenerateClientNonceHex(clock, | 960 "NONC", CryptoTestUtils::GenerateClientNonceHex(clock, |
961 crypto_config).c_str(), | 961 crypto_config).c_str(), |
962 "VER\0", QuicUtils::TagToString( | 962 "VER\0", QuicTagToString( |
963 QuicVersionToQuicTag(version)).c_str(), | 963 QuicVersionToQuicTag(version)).c_str(), |
964 "$padding", static_cast<int>(kClientHelloMinimumSize), | 964 "$padding", static_cast<int>(kClientHelloMinimumSize), |
965 nullptr); | 965 nullptr); |
966 // clang-format on | 966 // clang-format on |
967 } | 967 } |
968 | 968 |
969 string CryptoTestUtils::GenerateClientNonceHex( | 969 string CryptoTestUtils::GenerateClientNonceHex( |
970 const QuicClock* clock, | 970 const QuicClock* clock, |
971 QuicCryptoServerConfig* crypto_config) { | 971 QuicCryptoServerConfig* crypto_config) { |
972 net::QuicCryptoServerConfig::ConfigOptions old_config_options; | 972 net::QuicCryptoServerConfig::ConfigOptions old_config_options; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 // Pass a inchoate CHLO. | 1011 // Pass a inchoate CHLO. |
1012 FullChloGenerator generator(crypto_config, server_ip, client_addr, clock, | 1012 FullChloGenerator generator(crypto_config, server_ip, client_addr, clock, |
1013 proof, compressed_certs_cache, out); | 1013 proof, compressed_certs_cache, out); |
1014 crypto_config->ValidateClientHello( | 1014 crypto_config->ValidateClientHello( |
1015 inchoate_chlo, client_addr.address(), server_ip, version, clock, proof, | 1015 inchoate_chlo, client_addr.address(), server_ip, version, clock, proof, |
1016 generator.GetValidateClientHelloCallback()); | 1016 generator.GetValidateClientHelloCallback()); |
1017 } | 1017 } |
1018 | 1018 |
1019 } // namespace test | 1019 } // namespace test |
1020 } // namespace net | 1020 } // namespace net |
OLD | NEW |