| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 QuicCryptoStream* server, | 137 QuicCryptoStream* server, |
| 138 size_t server_i); | 138 size_t server_i); |
| 139 | 139 |
| 140 // Returns the value for the tag |tag| in the tag value map of |message|. | 140 // Returns the value for the tag |tag| in the tag value map of |message|. |
| 141 static std::string GetValueForTag(const CryptoHandshakeMessage& message, | 141 static std::string GetValueForTag(const CryptoHandshakeMessage& message, |
| 142 QuicTag tag); | 142 QuicTag tag); |
| 143 | 143 |
| 144 // Returns a new |ProofSource| that serves up test certificates. | 144 // Returns a new |ProofSource| that serves up test certificates. |
| 145 static std::unique_ptr<ProofSource> ProofSourceForTesting(); | 145 static std::unique_ptr<ProofSource> ProofSourceForTesting(); |
| 146 | 146 |
| 147 // Returns a |ProofVerifier| that uses the QUIC testing root CA. | 147 // Identical to |ProofSourceForTesting|, with the addition of setting |
| 148 // the |emit_expect_ct_header| field on the test certificates |
| 149 // to be the value of |send_expect_ct_header|. |
| 150 static std::unique_ptr<ProofSource> ProofSourceForTesting( |
| 151 bool send_expect_ct_header); |
| 152 |
| 153 // Returns a new |ProofVerifier| that uses the QUIC testing root CA. |
| 148 static std::unique_ptr<ProofVerifier> ProofVerifierForTesting(); | 154 static std::unique_ptr<ProofVerifier> ProofVerifierForTesting(); |
| 149 | 155 |
| 150 // Returns a real ProofVerifier (not a fake proof verifier) for testing. | 156 // Returns a real ProofVerifier (not a fake proof verifier) for testing. |
| 151 static std::unique_ptr<ProofVerifier> RealProofVerifierForTesting(); | 157 static std::unique_ptr<ProofVerifier> RealProofVerifierForTesting(); |
| 152 | 158 |
| 153 // Returns a hash of the leaf test certificate. | 159 // Returns a hash of the leaf test certificate. |
| 154 static uint64_t LeafCertHashForTesting(); | 160 static uint64_t LeafCertHashForTesting(); |
| 155 | 161 |
| 156 // Returns a |ProofVerifyContext| that must be used with the verifier | 162 // Returns a |ProofVerifyContext| that must be used with the verifier |
| 157 // returned by |ProofVerifierForTesting|. | 163 // returned by |ProofVerifierForTesting|. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 static std::string GenerateClientPublicValuesHex(); | 242 static std::string GenerateClientPublicValuesHex(); |
| 237 | 243 |
| 238 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); | 244 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); |
| 239 }; | 245 }; |
| 240 | 246 |
| 241 } // namespace test | 247 } // namespace test |
| 242 | 248 |
| 243 } // namespace net | 249 } // namespace net |
| 244 | 250 |
| 245 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 251 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
| OLD | NEW |