| 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 #ifndef NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 5 #ifndef NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
| 6 #define NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 6 #define NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 Perspective dest_perspective); | 205 Perspective dest_perspective); |
| 206 | 206 |
| 207 // Return an inchoate CHLO with some basic tag value std:pairs. | 207 // Return an inchoate CHLO with some basic tag value std:pairs. |
| 208 static CryptoHandshakeMessage GenerateDefaultInchoateCHLO( | 208 static CryptoHandshakeMessage GenerateDefaultInchoateCHLO( |
| 209 const QuicClock* clock, | 209 const QuicClock* clock, |
| 210 QuicVersion version, | 210 QuicVersion version, |
| 211 QuicCryptoServerConfig* crypto_config); | 211 QuicCryptoServerConfig* crypto_config); |
| 212 | 212 |
| 213 // Takes a inchoate CHLO, returns a full CHLO in |out| which can pass | 213 // Takes a inchoate CHLO, returns a full CHLO in |out| which can pass |
| 214 // |crypto_config|'s validation. | 214 // |crypto_config|'s validation. |
| 215 static void GenerateFullCHLO(const CryptoHandshakeMessage& inchoate_chlo, | 215 static void GenerateFullCHLO( |
| 216 QuicCryptoServerConfig* crypto_config, | 216 const CryptoHandshakeMessage& inchoate_chlo, |
| 217 IPAddress server_ip, | 217 QuicCryptoServerConfig* crypto_config, |
| 218 IPEndPoint client_addr, | 218 IPAddress server_ip, |
| 219 QuicVersion version, | 219 IPEndPoint client_addr, |
| 220 const QuicClock* clock, | 220 QuicVersion version, |
| 221 scoped_refptr<QuicCryptoProof> proof, | 221 const QuicClock* clock, |
| 222 QuicCompressedCertsCache* compressed_certs_cache, | 222 scoped_refptr<QuicSignedServerConfig> signed_config, |
| 223 CryptoHandshakeMessage* out); | 223 QuicCompressedCertsCache* compressed_certs_cache, |
| 224 CryptoHandshakeMessage* out); |
| 224 | 225 |
| 225 private: | 226 private: |
| 226 static void CompareClientAndServerKeys(QuicCryptoClientStream* client, | 227 static void CompareClientAndServerKeys(QuicCryptoClientStream* client, |
| 227 QuicCryptoServerStream* server); | 228 QuicCryptoServerStream* server); |
| 228 | 229 |
| 229 // Return a CHLO nonce in hexadecimal. | 230 // Return a CHLO nonce in hexadecimal. |
| 230 static std::string GenerateClientNonceHex( | 231 static std::string GenerateClientNonceHex( |
| 231 const QuicClock* clock, | 232 const QuicClock* clock, |
| 232 QuicCryptoServerConfig* crypto_config); | 233 QuicCryptoServerConfig* crypto_config); |
| 233 | 234 |
| 234 // Return a CHLO PUBS in hexadecimal. | 235 // Return a CHLO PUBS in hexadecimal. |
| 235 static std::string GenerateClientPublicValuesHex(); | 236 static std::string GenerateClientPublicValuesHex(); |
| 236 | 237 |
| 237 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); | 238 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); |
| 238 }; | 239 }; |
| 239 | 240 |
| 240 } // namespace test | 241 } // namespace test |
| 241 | 242 |
| 242 } // namespace net | 243 } // namespace net |
| 243 | 244 |
| 244 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 245 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
| OLD | NEW |