| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_INTERNAL_TEST_HELPERS_H_ | 5 #ifndef NET_CERT_INTERNAL_TEST_HELPERS_H_ |
| 6 #define NET_CERT_INTERNAL_TEST_HELPERS_H_ | 6 #define NET_CERT_INTERNAL_TEST_HELPERS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <ostream> | 10 #include <ostream> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 // Details on the trustedness of the last certificate. | 89 // Details on the trustedness of the last certificate. |
| 90 CertificateTrust last_cert_trust; | 90 CertificateTrust last_cert_trust; |
| 91 | 91 |
| 92 // The time to use when verifying the chain. | 92 // The time to use when verifying the chain. |
| 93 der::GeneralizedTime time; | 93 der::GeneralizedTime time; |
| 94 | 94 |
| 95 // The Key Purpose to use when verifying the chain. | 95 // The Key Purpose to use when verifying the chain. |
| 96 KeyPurpose key_purpose = KeyPurpose::ANY_EKU; | 96 KeyPurpose key_purpose = KeyPurpose::ANY_EKU; |
| 97 | 97 |
| 98 InitialExplicitPolicy initial_explicit_policy = InitialExplicitPolicy::kFalse; |
| 99 |
| 100 std::set<der::Input> user_initial_policy_set; |
| 101 |
| 102 InitialPolicyMappingInhibit initial_policy_mapping_inhibit = |
| 103 InitialPolicyMappingInhibit::kFalse; |
| 104 |
| 105 InitialAnyPolicyInhibit initial_any_policy_inhibit = |
| 106 InitialAnyPolicyInhibit::kFalse; |
| 107 |
| 98 // The expected errors/warnings from verification (as a string). | 108 // The expected errors/warnings from verification (as a string). |
| 99 std::string expected_errors; | 109 std::string expected_errors; |
| 100 | 110 |
| 101 // Returns true if |expected_errors| contains any high severity errors (a | 111 // Returns true if |expected_errors| contains any high severity errors (a |
| 102 // non-empty expected_errors doesn't necessarily mean verification is | 112 // non-empty expected_errors doesn't necessarily mean verification is |
| 103 // expected to fail, as it may have contained warnings). | 113 // expected to fail, as it may have contained warnings). |
| 104 bool HasHighSeverityErrors() const; | 114 bool HasHighSeverityErrors() const; |
| 105 }; | 115 }; |
| 106 | 116 |
| 107 // Reads a test case from |file_path_ascii| (which is relative to //src). | 117 // Reads a test case from |file_path_ascii| (which is relative to //src). |
| 108 // Generally |file_path_ascii| will start with: | 118 // Generally |file_path_ascii| will start with: |
| 109 // net/data/verify_certificate_chain_unittest/ | 119 // net/data/verify_certificate_chain_unittest/ |
| 110 bool ReadVerifyCertChainTestFromFile(const std::string& file_path_ascii, | 120 bool ReadVerifyCertChainTestFromFile(const std::string& file_path_ascii, |
| 111 VerifyCertChainTest* test); | 121 VerifyCertChainTest* test); |
| 112 | 122 |
| 113 // Reads a certificate chain from |file_path_ascii| | 123 // Reads a certificate chain from |file_path_ascii| |
| 114 bool ReadCertChainFromFile(const std::string& file_path_ascii, | 124 bool ReadCertChainFromFile(const std::string& file_path_ascii, |
| 115 ParsedCertificateList* chain); | 125 ParsedCertificateList* chain); |
| 116 | 126 |
| 117 // Reads a data file relative to the src root directory. | 127 // Reads a data file relative to the src root directory. |
| 118 std::string ReadTestFileToString(const std::string& file_path_ascii); | 128 std::string ReadTestFileToString(const std::string& file_path_ascii); |
| 119 | 129 |
| 120 } // namespace net | 130 } // namespace net |
| 121 | 131 |
| 122 #endif // NET_CERT_INTERNAL_TEST_HELPERS_H_ | 132 #endif // NET_CERT_INTERNAL_TEST_HELPERS_H_ |
| OLD | NEW |