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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 // MovePackets parses crypto handshake messages from packet number | 198 // MovePackets parses crypto handshake messages from packet number |
199 // |*inout_packet_index| through to the last packet (or until a packet fails | 199 // |*inout_packet_index| through to the last packet (or until a packet fails |
200 // to decrypt) and has |dest_stream| process them. |*inout_packet_index| is | 200 // to decrypt) and has |dest_stream| process them. |*inout_packet_index| is |
201 // updated with an index one greater than the last packet processed. | 201 // updated with an index one greater than the last packet processed. |
202 static void MovePackets(PacketSavingConnection* source_conn, | 202 static void MovePackets(PacketSavingConnection* source_conn, |
203 size_t* inout_packet_index, | 203 size_t* inout_packet_index, |
204 QuicCryptoStream* dest_stream, | 204 QuicCryptoStream* dest_stream, |
205 PacketSavingConnection* dest_conn, | 205 PacketSavingConnection* dest_conn, |
206 Perspective dest_perspective); | 206 Perspective dest_perspective); |
207 | 207 |
| 208 // Takes a inchoate CHLO, returns a full CHLO in |out| which can pass |
| 209 // |crypto_config|'s validation. |
| 210 static void GenerateFullCHLO(const CryptoHandshakeMessage& inchoate_chlo, |
| 211 QuicCryptoServerConfig* crypto_config, |
| 212 IPAddress server_ip, |
| 213 IPEndPoint client_addr, |
| 214 QuicVersion version, |
| 215 const QuicClock* clock, |
| 216 QuicCryptoProof* proof, |
| 217 QuicCompressedCertsCache* compressed_certs_cache, |
| 218 CryptoHandshakeMessage* out); |
| 219 |
208 private: | 220 private: |
209 static void CompareClientAndServerKeys(QuicCryptoClientStream* client, | 221 static void CompareClientAndServerKeys(QuicCryptoClientStream* client, |
210 QuicCryptoServerStream* server); | 222 QuicCryptoServerStream* server); |
211 | 223 |
212 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); | 224 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); |
213 }; | 225 }; |
214 | 226 |
215 } // namespace test | 227 } // namespace test |
216 | 228 |
217 } // namespace net | 229 } // namespace net |
218 | 230 |
219 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 231 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
OLD | NEW |