OLD | NEW |
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 #include "net/base/cert_test_util.h" | 5 #include "net/base/cert_test_util.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "net/base/ev_root_ca_metadata.h" | 10 #include "net/base/ev_root_ca_metadata.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 CertificateList certs_in_file = | 47 CertificateList certs_in_file = |
48 X509Certificate::CreateCertificateListFromBytes( | 48 X509Certificate::CreateCertificateListFromBytes( |
49 cert_data.data(), cert_data.size(), X509Certificate::FORMAT_AUTO); | 49 cert_data.data(), cert_data.size(), X509Certificate::FORMAT_AUTO); |
50 if (certs_in_file.empty()) | 50 if (certs_in_file.empty()) |
51 return NULL; | 51 return NULL; |
52 return certs_in_file[0]; | 52 return certs_in_file[0]; |
53 } | 53 } |
54 | 54 |
55 ScopedTestEVPolicy::ScopedTestEVPolicy(EVRootCAMetadata* ev_root_ca_metadata, | 55 ScopedTestEVPolicy::ScopedTestEVPolicy(EVRootCAMetadata* ev_root_ca_metadata, |
56 const SHA1HashValue& fingerprint, | 56 const SHA1Fingerprint& fingerprint, |
57 const char* policy) | 57 const char* policy) |
58 : fingerprint_(fingerprint), | 58 : fingerprint_(fingerprint), |
59 ev_root_ca_metadata_(ev_root_ca_metadata) { | 59 ev_root_ca_metadata_(ev_root_ca_metadata) { |
60 EXPECT_TRUE(ev_root_ca_metadata->AddEVCA(fingerprint, policy)); | 60 EXPECT_TRUE(ev_root_ca_metadata->AddEVCA(fingerprint, policy)); |
61 } | 61 } |
62 | 62 |
63 ScopedTestEVPolicy::~ScopedTestEVPolicy() { | 63 ScopedTestEVPolicy::~ScopedTestEVPolicy() { |
64 EXPECT_TRUE(ev_root_ca_metadata_->RemoveEVCA(fingerprint_)); | 64 EXPECT_TRUE(ev_root_ca_metadata_->RemoveEVCA(fingerprint_)); |
65 } | 65 } |
66 | 66 |
67 } // namespace net | 67 } // namespace net |
OLD | NEW |