| 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> |
| 10 #include <stdint.h> |
| 9 | 11 |
| 10 #include <utility> | 12 #include <utility> |
| 11 #include <vector> | 13 #include <vector> |
| 12 | 14 |
| 13 #include "base/basictypes.h" | |
| 14 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/macros.h" |
| 15 #include "base/strings/string_piece.h" | 17 #include "base/strings/string_piece.h" |
| 16 #include "net/quic/crypto/crypto_framer.h" | 18 #include "net/quic/crypto/crypto_framer.h" |
| 17 #include "net/quic/quic_framer.h" | 19 #include "net/quic/quic_framer.h" |
| 18 #include "net/quic/quic_protocol.h" | 20 #include "net/quic/quic_protocol.h" |
| 19 #include "net/quic/test_tools/quic_test_utils.h" | 21 #include "net/quic/test_tools/quic_test_utils.h" |
| 20 | 22 |
| 21 namespace net { | 23 namespace net { |
| 22 | 24 |
| 23 class ChannelIDSource; | 25 class ChannelIDSource; |
| 24 class CommonCertSets; | 26 class CommonCertSets; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // Returns a real ProofVerifier (not a fake proof verifier) for testing. | 148 // Returns a real ProofVerifier (not a fake proof verifier) for testing. |
| 147 static ProofVerifier* RealProofVerifierForTesting(); | 149 static ProofVerifier* RealProofVerifierForTesting(); |
| 148 | 150 |
| 149 // Returns a |ProofVerifyContext| that must be used with the verifier | 151 // Returns a |ProofVerifyContext| that must be used with the verifier |
| 150 // returned by |ProofVerifierForTesting|. | 152 // returned by |ProofVerifierForTesting|. |
| 151 static ProofVerifyContext* ProofVerifyContextForTesting(); | 153 static ProofVerifyContext* ProofVerifyContextForTesting(); |
| 152 | 154 |
| 153 // MockCommonCertSets returns a CommonCertSets that contains a single set with | 155 // MockCommonCertSets returns a CommonCertSets that contains a single set with |
| 154 // hash |hash|, consisting of the certificate |cert| at index |index|. | 156 // hash |hash|, consisting of the certificate |cert| at index |index|. |
| 155 static CommonCertSets* MockCommonCertSets(base::StringPiece cert, | 157 static CommonCertSets* MockCommonCertSets(base::StringPiece cert, |
| 156 uint64 hash, | 158 uint64_t hash, |
| 157 uint32 index); | 159 uint32_t index); |
| 158 | 160 |
| 159 // Creates a minimal dummy reject message that will pass the client-config | 161 // Creates a minimal dummy reject message that will pass the client-config |
| 160 // validation tests. This will include a server config, but no certs, proof | 162 // validation tests. This will include a server config, but no certs, proof |
| 161 // source address token, or server nonce. | 163 // source address token, or server nonce. |
| 162 static void FillInDummyReject(CryptoHandshakeMessage* rej, | 164 static void FillInDummyReject(CryptoHandshakeMessage* rej, |
| 163 bool reject_is_stateless); | 165 bool reject_is_stateless); |
| 164 | 166 |
| 165 // ParseTag returns a QuicTag from parsing |tagstr|. |tagstr| may either be | 167 // ParseTag returns a QuicTag from parsing |tagstr|. |tagstr| may either be |
| 166 // in the format "EXMP" (i.e. ASCII format), or "#11223344" (an explicit hex | 168 // in the format "EXMP" (i.e. ASCII format), or "#11223344" (an explicit hex |
| 167 // format). It CHECK fails if there's a parse error. | 169 // format). It CHECK fails if there's a parse error. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 QuicCryptoServerStream* server); | 203 QuicCryptoServerStream* server); |
| 202 | 204 |
| 203 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); | 205 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); |
| 204 }; | 206 }; |
| 205 | 207 |
| 206 } // namespace test | 208 } // namespace test |
| 207 | 209 |
| 208 } // namespace net | 210 } // namespace net |
| 209 | 211 |
| 210 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 212 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
| OLD | NEW |