| 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 "net/quic/crypto/crypto_framer.h" | 12 #include "net/quic/crypto/crypto_framer.h" |
| 12 #include "net/quic/quic_framer.h" | 13 #include "net/quic/quic_framer.h" |
| 13 #include "net/quic/quic_protocol.h" | 14 #include "net/quic/quic_protocol.h" |
| 14 | 15 |
| 15 namespace net { | 16 namespace net { |
| 16 | 17 |
| 18 class CommonCertSet; |
| 17 class ProofSource; | 19 class ProofSource; |
| 18 class ProofVerifier; | 20 class ProofVerifier; |
| 19 class QuicClock; | 21 class QuicClock; |
| 20 class QuicConfig; | 22 class QuicConfig; |
| 21 class QuicCryptoClientStream; | 23 class QuicCryptoClientStream; |
| 22 class QuicCryptoServerConfig; | 24 class QuicCryptoServerConfig; |
| 23 class QuicCryptoServerStream; | 25 class QuicCryptoServerStream; |
| 24 class QuicCryptoStream; | 26 class QuicCryptoStream; |
| 25 class QuicRandom; | 27 class QuicRandom; |
| 26 | 28 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 56 // 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|. |
| 57 static std::string GetValueForTag(const CryptoHandshakeMessage& message, | 59 static std::string GetValueForTag(const CryptoHandshakeMessage& message, |
| 58 CryptoTag tag); | 60 CryptoTag tag); |
| 59 | 61 |
| 60 // Returns a |ProofSource| that serves up test certificates. | 62 // Returns a |ProofSource| that serves up test certificates. |
| 61 static ProofSource* ProofSourceForTesting(); | 63 static ProofSource* ProofSourceForTesting(); |
| 62 | 64 |
| 63 // Returns a |ProofVerifier| that uses the QUIC testing root CA. | 65 // Returns a |ProofVerifier| that uses the QUIC testing root CA. |
| 64 static ProofVerifier* ProofVerifierForTesting(); | 66 static ProofVerifier* ProofVerifierForTesting(); |
| 65 | 67 |
| 68 // MockCommonCertSet returns a CommonCertSet that contains a single set with |
| 69 // hash |hash|, consisting of the certificate |cert| at index |index|. |
| 70 static CommonCertSet* MockCommonCertSet(base::StringPiece cert, |
| 71 uint64 hash, |
| 72 uint32 index); |
| 73 |
| 66 private: | 74 private: |
| 67 static void CompareClientAndServerKeys(QuicCryptoClientStream* client, | 75 static void CompareClientAndServerKeys(QuicCryptoClientStream* client, |
| 68 QuicCryptoServerStream* server); | 76 QuicCryptoServerStream* server); |
| 69 }; | 77 }; |
| 70 | 78 |
| 71 } // namespace test | 79 } // namespace test |
| 72 | 80 |
| 73 } // namespace net | 81 } // namespace net |
| 74 | 82 |
| 75 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ | 83 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ |
| OLD | NEW |