| 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_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 #include "net/cert/signed_certificate_timestamp_and_status.h" |
| 16 | 17 |
| 17 namespace net { | 18 namespace net { |
| 18 | 19 |
| 19 namespace ct { | 20 namespace ct { |
| 20 | 21 |
| 21 struct CTVerifyResult; | |
| 22 struct DigitallySigned; | 22 struct DigitallySigned; |
| 23 struct LogEntry; | 23 struct LogEntry; |
| 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 GetX509CertLogEntry(LogEntry* entry); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 // Returns SCTList for testing. | 114 // Returns SCTList for testing. |
| 115 std::string GetSCTListForTesting(); | 115 std::string GetSCTListForTesting(); |
| 116 | 116 |
| 117 // Returns a corrupted SCTList. This is done by changing a byte inside the | 117 // Returns a corrupted SCTList. This is done by changing a byte inside the |
| 118 // Log ID part of the SCT so it does not match the log used in the tests. | 118 // Log ID part of the SCT so it does not match the log used in the tests. |
| 119 std::string GetSCTListWithInvalidSCT(); | 119 std::string GetSCTListWithInvalidSCT(); |
| 120 | 120 |
| 121 // Returns true if |log_description| is in the |result|'s |verified_scts| and | 121 // Returns true if |log_description| is in the |result|'s |verified_scts| and |
| 122 // number of |verified_scts| in |result| is equal to 1. | 122 // number of |verified_scts| in |result| is equal to 1. |
| 123 bool CheckForSingleVerifiedSCTInResult(const CTVerifyResult& result, | 123 bool CheckForSingleVerifiedSCTInResult( |
| 124 const std::string& log_description); | 124 const SignedCertificateTimestampAndStatusList& scts, |
| 125 const std::string& log_description); |
| 125 | 126 |
| 126 // Returns true if |origin| is in the |result|'s |verified_scts|. | 127 // Returns true if |origin| is in the |result|'s |verified_scts|. |
| 127 bool CheckForSCTOrigin(const CTVerifyResult& result, | 128 bool CheckForSCTOrigin(const SignedCertificateTimestampAndStatusList& scts, |
| 128 SignedCertificateTimestamp::Origin origin); | 129 SignedCertificateTimestamp::Origin origin); |
| 129 | 130 |
| 130 } // namespace ct | 131 } // namespace ct |
| 131 | 132 |
| 132 } // namespace net | 133 } // namespace net |
| 133 | 134 |
| 134 #endif // NET_CERT_CT_TEST_UTIL_H_ | 135 #endif // NET_CERT_CT_TEST_UTIL_H_ |
| OLD | NEW |