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

Side by Side Diff: net/test/ct_test_util.h

Issue 1943313003: Adds a function for encoding a Merkle tree leaf in TLS wire format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 months 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
« no previous file with comments | « net/cert/ct_serialization_unittest.cc ('k') | net/test/ct_test_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_CERT_CT_TEST_UTIL_H_ 5 #ifndef NET_CERT_CT_TEST_UTIL_H_
6 #define NET_CERT_CT_TEST_UTIL_H_ 6 #define NET_CERT_CT_TEST_UTIL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "net/cert/signed_certificate_timestamp.h" 15 #include "net/cert/signed_certificate_timestamp.h"
16 16
17 namespace net { 17 namespace net {
18 18
19 namespace ct { 19 namespace ct {
20 20
21 struct CTVerifyResult; 21 struct CTVerifyResult;
22 struct DigitallySigned; 22 struct DigitallySigned;
23 struct LogEntry; 23 struct LogEntry;
24 struct MerkleTreeLeaf;
24 struct SignedTreeHead; 25 struct SignedTreeHead;
25 26
26 // Note: unless specified otherwise, all test data is taken from Certificate 27 // Note: unless specified otherwise, all test data is taken from Certificate
27 // Transparency test data repository. 28 // Transparency test data repository.
28 29
29 // Fills |entry| with test data for an X.509 entry. 30 // Fills |entry| with test data for an X.509 entry.
30 void GetX509CertLogEntry(LogEntry* entry); 31 void GetX509CertLogEntry(LogEntry* entry);
31 32
33 // Fills |tree_leaf| with test data for an X.509 Merkle tree leaf.
34 void GetX509CertTreeLeaf(MerkleTreeLeaf* tree_leaf);
35
32 // Returns a DER-encoded X509 cert. The SCT provided by 36 // Returns a DER-encoded X509 cert. The SCT provided by
33 // GetX509CertSCT is signed over this certificate. 37 // GetX509CertSCT is signed over this certificate.
34 std::string GetDerEncodedX509Cert(); 38 std::string GetDerEncodedX509Cert();
35 39
36 // Fills |entry| with test data for a Precertificate entry. 40 // Fills |entry| with test data for a Precertificate entry.
37 void GetPrecertLogEntry(LogEntry* entry); 41 void GetPrecertLogEntry(LogEntry* entry);
38 42
43 // Fills |tree_leaf| with test data for a Precertificate Merkle tree leaf.
44 void GetPrecertTreeLeaf(MerkleTreeLeaf* tree_leaf);
45
39 // Returns the binary representation of a test DigitallySigned 46 // Returns the binary representation of a test DigitallySigned
40 std::string GetTestDigitallySigned(); 47 std::string GetTestDigitallySigned();
41 48
42 // Returns the binary representation of a test serialized SCT. 49 // Returns the binary representation of a test serialized SCT.
43 std::string GetTestSignedCertificateTimestamp(); 50 std::string GetTestSignedCertificateTimestamp();
44 51
45 // Test log key 52 // Test log key
46 std::string GetTestPublicKey(); 53 std::string GetTestPublicKey();
47 54
48 // ID of test log key 55 // ID of test log key
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 125
119 // Returns true if |origin| is in the |result|'s |verified_scts|. 126 // Returns true if |origin| is in the |result|'s |verified_scts|.
120 bool CheckForSCTOrigin(const CTVerifyResult& result, 127 bool CheckForSCTOrigin(const CTVerifyResult& result,
121 SignedCertificateTimestamp::Origin origin); 128 SignedCertificateTimestamp::Origin origin);
122 129
123 } // namespace ct 130 } // namespace ct
124 131
125 } // namespace net 132 } // namespace net
126 133
127 #endif // NET_CERT_CT_TEST_UTIL_H_ 134 #endif // NET_CERT_CT_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/cert/ct_serialization_unittest.cc ('k') | net/test/ct_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698