Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: net/quic/test_tools/crypto_test_utils.h

Issue 1454993002: QUIC - Code to verify SCT tag with certificate transparency verifier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 9
10 #include <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/strings/string_piece.h" 15 #include "base/strings/string_piece.h"
16 #include "net/quic/crypto/crypto_framer.h" 16 #include "net/quic/crypto/crypto_framer.h"
17 #include "net/quic/quic_framer.h" 17 #include "net/quic/quic_framer.h"
18 #include "net/quic/quic_protocol.h" 18 #include "net/quic/quic_protocol.h"
19 #include "net/quic/test_tools/quic_test_utils.h" 19 #include "net/quic/test_tools/quic_test_utils.h"
20 20
21 namespace net { 21 namespace net {
22 22
23 class ChannelIDSource; 23 class ChannelIDSource;
24 class CommonCertSets; 24 class CommonCertSets;
25 class CTVerifier;
25 class ProofSource; 26 class ProofSource;
26 class ProofVerifier; 27 class ProofVerifier;
27 class ProofVerifyContext; 28 class ProofVerifyContext;
28 class QuicClock; 29 class QuicClock;
29 class QuicConfig; 30 class QuicConfig;
30 class QuicCryptoClientStream; 31 class QuicCryptoClientStream;
31 class QuicCryptoServerConfig; 32 class QuicCryptoServerConfig;
32 class QuicCryptoServerStream; 33 class QuicCryptoServerStream;
33 class QuicCryptoStream; 34 class QuicCryptoStream;
34 class QuicRandom; 35 class QuicRandom;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // Returns a |ProofVerifier| that uses the QUIC testing root CA. 144 // Returns a |ProofVerifier| that uses the QUIC testing root CA.
144 static ProofVerifier* ProofVerifierForTesting(); 145 static ProofVerifier* ProofVerifierForTesting();
145 146
146 // Returns a real ProofVerifier (not a fake proof verifier) for testing. 147 // Returns a real ProofVerifier (not a fake proof verifier) for testing.
147 static ProofVerifier* RealProofVerifierForTesting(); 148 static ProofVerifier* RealProofVerifierForTesting();
148 149
149 // Returns a |ProofVerifyContext| that must be used with the verifier 150 // Returns a |ProofVerifyContext| that must be used with the verifier
150 // returned by |ProofVerifierForTesting|. 151 // returned by |ProofVerifierForTesting|.
151 static ProofVerifyContext* ProofVerifyContextForTesting(); 152 static ProofVerifyContext* ProofVerifyContextForTesting();
152 153
154 // Returns a |CTVerifier| that tests certificate transparency.
155 static CTVerifier* CTVerifierTesting();
Ryan Hamilton 2015/11/18 20:57:26 Since this code is shared, I'm not sure this metho
ramant (doing other things) 2015/11/21 00:27:03 Undid all chromium specific changes to common code
156
153 // MockCommonCertSets returns a CommonCertSets that contains a single set with 157 // MockCommonCertSets returns a CommonCertSets that contains a single set with
154 // hash |hash|, consisting of the certificate |cert| at index |index|. 158 // hash |hash|, consisting of the certificate |cert| at index |index|.
155 static CommonCertSets* MockCommonCertSets(base::StringPiece cert, 159 static CommonCertSets* MockCommonCertSets(base::StringPiece cert,
156 uint64 hash, 160 uint64 hash,
157 uint32 index); 161 uint32 index);
158 162
159 // ParseTag returns a QuicTag from parsing |tagstr|. |tagstr| may either be 163 // ParseTag returns a QuicTag from parsing |tagstr|. |tagstr| may either be
160 // in the format "EXMP" (i.e. ASCII format), or "#11223344" (an explicit hex 164 // in the format "EXMP" (i.e. ASCII format), or "#11223344" (an explicit hex
161 // format). It CHECK fails if there's a parse error. 165 // format). It CHECK fails if there's a parse error.
162 static QuicTag ParseTag(const char* tagstr); 166 static QuicTag ParseTag(const char* tagstr);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 QuicCryptoServerStream* server); 199 QuicCryptoServerStream* server);
196 200
197 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils); 201 DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils);
198 }; 202 };
199 203
200 } // namespace test 204 } // namespace test
201 205
202 } // namespace net 206 } // namespace net
203 207
204 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ 208 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698