OLD | NEW |
---|---|
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_TEST_CT_TEST_UTIL_H_ | 5 #ifndef NET_TEST_CT_TEST_UTIL_H_ |
6 #define NET_TEST_CT_TEST_UTIL_H_ | 6 #define NET_TEST_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 #include "net/cert/signed_certificate_timestamp_and_status.h" | 16 #include "net/cert/signed_certificate_timestamp_and_status.h" |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 namespace ct { | 20 namespace ct { |
21 | 21 |
22 struct DigitallySigned; | 22 struct DigitallySigned; |
23 struct LogEntry; | 23 struct SignedEntryData; |
Ryan Sleevi
2017/04/21 21:20:13
sort
mattm
2017/04/22 02:42:15
Done.
| |
24 struct MerkleTreeLeaf; | 24 struct MerkleTreeLeaf; |
25 struct SignedTreeHead; | 25 struct SignedTreeHead; |
26 | 26 |
27 // Note: unless specified otherwise, all test data is taken from Certificate | 27 // Note: unless specified otherwise, all test data is taken from Certificate |
28 // Transparency test data repository. | 28 // Transparency test data repository. |
29 | 29 |
30 // Fills |entry| with test data for an X.509 entry. | 30 // Fills |entry| with test data for an X.509 entry. |
31 void GetX509CertLogEntry(LogEntry* entry); | 31 void GetX509CertSignedEntry(SignedEntryData* entry); |
32 | 32 |
33 // Fills |tree_leaf| with test data for an X.509 Merkle tree leaf. | 33 // Fills |tree_leaf| with test data for an X.509 Merkle tree leaf. |
34 void GetX509CertTreeLeaf(MerkleTreeLeaf* tree_leaf); | 34 void GetX509CertTreeLeaf(MerkleTreeLeaf* tree_leaf); |
35 | 35 |
36 // Returns a DER-encoded X509 cert. The SCT provided by | 36 // Returns a DER-encoded X509 cert. The SCT provided by |
37 // GetX509CertSCT is signed over this certificate. | 37 // GetX509CertSCT is signed over this certificate. |
38 std::string GetDerEncodedX509Cert(); | 38 std::string GetDerEncodedX509Cert(); |
39 | 39 |
40 // Fills |entry| with test data for a Precertificate entry. | 40 // Fills |entry| with test data for a Precertificate entry. |
41 void GetPrecertLogEntry(LogEntry* entry); | 41 void GetPrecertSignedEntry(SignedEntryData* entry); |
42 | 42 |
43 // Fills |tree_leaf| with test data for a Precertificate Merkle tree leaf. | 43 // Fills |tree_leaf| with test data for a Precertificate Merkle tree leaf. |
44 void GetPrecertTreeLeaf(MerkleTreeLeaf* tree_leaf); | 44 void GetPrecertTreeLeaf(MerkleTreeLeaf* tree_leaf); |
45 | 45 |
46 // Returns the binary representation of a test DigitallySigned | 46 // Returns the binary representation of a test DigitallySigned |
47 std::string GetTestDigitallySigned(); | 47 std::string GetTestDigitallySigned(); |
48 | 48 |
49 // Returns the binary representation of a test serialized SCT. | 49 // Returns the binary representation of a test serialized SCT. |
50 std::string GetTestSignedCertificateTimestamp(); | 50 std::string GetTestSignedCertificateTimestamp(); |
51 | 51 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 | 126 |
127 // Returns true if |origin| is in the |result|'s |verified_scts|. | 127 // Returns true if |origin| is in the |result|'s |verified_scts|. |
128 bool CheckForSCTOrigin(const SignedCertificateTimestampAndStatusList& scts, | 128 bool CheckForSCTOrigin(const SignedCertificateTimestampAndStatusList& scts, |
129 SignedCertificateTimestamp::Origin origin); | 129 SignedCertificateTimestamp::Origin origin); |
130 | 130 |
131 } // namespace ct | 131 } // namespace ct |
132 | 132 |
133 } // namespace net | 133 } // namespace net |
134 | 134 |
135 #endif // NET_TEST_CT_TEST_UTIL_H_ | 135 #endif // NET_TEST_CT_TEST_UTIL_H_ |
OLD | NEW |