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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
12 #include "net/quic/crypto/crypto_framer.h" | 12 #include "net/quic/crypto/crypto_framer.h" |
13 #include "net/quic/quic_framer.h" | 13 #include "net/quic/quic_framer.h" |
14 #include "net/quic/quic_protocol.h" | 14 #include "net/quic/quic_protocol.h" |
15 | 15 |
16 namespace net { | 16 namespace net { |
17 | 17 |
18 class CommonCertSet; | 18 class CommonCertSets; |
19 class ProofSource; | 19 class ProofSource; |
20 class ProofVerifier; | 20 class ProofVerifier; |
21 class QuicClock; | 21 class QuicClock; |
22 class QuicConfig; | 22 class QuicConfig; |
23 class QuicCryptoClientStream; | 23 class QuicCryptoClientStream; |
24 class QuicCryptoServerConfig; | 24 class QuicCryptoServerConfig; |
25 class QuicCryptoServerStream; | 25 class QuicCryptoServerStream; |
26 class QuicCryptoStream; | 26 class QuicCryptoStream; |
27 class QuicRandom; | 27 class QuicRandom; |
28 | 28 |
(...skipping 21 matching lines...) Expand all Loading... |
50 | 50 |
51 // CommunicateHandshakeMessages moves messages from |a| to |b| and back until | 51 // CommunicateHandshakeMessages moves messages from |a| to |b| and back until |
52 // |a|'s handshake has completed. | 52 // |a|'s handshake has completed. |
53 static void CommunicateHandshakeMessages(PacketSavingConnection* a_conn, | 53 static void CommunicateHandshakeMessages(PacketSavingConnection* a_conn, |
54 QuicCryptoStream* a, | 54 QuicCryptoStream* a, |
55 PacketSavingConnection* b_conn, | 55 PacketSavingConnection* b_conn, |
56 QuicCryptoStream* b); | 56 QuicCryptoStream* b); |
57 | 57 |
58 // Returns the value for the tag |tag| in the tag value map of |message|. | 58 // Returns the value for the tag |tag| in the tag value map of |message|. |
59 static std::string GetValueForTag(const CryptoHandshakeMessage& message, | 59 static std::string GetValueForTag(const CryptoHandshakeMessage& message, |
60 CryptoTag tag); | 60 QuicTag tag); |
61 | 61 |
62 // Returns a |ProofSource| that serves up test certificates. | 62 // Returns a |ProofSource| that serves up test certificates. |
63 static ProofSource* ProofSourceForTesting(); | 63 static ProofSource* ProofSourceForTesting(); |
64 | 64 |
65 // Returns a |ProofVerifier| that uses the QUIC testing root CA. | 65 // Returns a |ProofVerifier| that uses the QUIC testing root CA. |
66 static ProofVerifier* ProofVerifierForTesting(); | 66 static ProofVerifier* ProofVerifierForTesting(); |
67 | 67 |
68 // MockCommonCertSet returns a CommonCertSet that contains a single set with | 68 // MockCommonCertSets returns a CommonCertSets that contains a single set with |
69 // hash |hash|, consisting of the certificate |cert| at index |index|. | 69 // hash |hash|, consisting of the certificate |cert| at index |index|. |
70 static CommonCertSet* MockCommonCertSet(base::StringPiece cert, | 70 static CommonCertSets* MockCommonCertSets(base::StringPiece cert, |
71 uint64 hash, | 71 uint64 hash, |
72 uint32 index); | 72 uint32 index); |
73 | 73 |
74 private: | 74 private: |
75 static void CompareClientAndServerKeys(QuicCryptoClientStream* client, | 75 static void CompareClientAndServerKeys(QuicCryptoClientStream* client, |
76 QuicCryptoServerStream* server); | 76 QuicCryptoServerStream* server); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace test | 79 } // namespace test |
80 | 80 |
81 } // namespace net | 81 } // namespace net |
82 | 82 |
83 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 83 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
OLD | NEW |