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 #include "chromeos/network/onc/onc_certificate_importer_impl.h" | 5 #include "chromeos/network/onc/onc_certificate_importer_impl.h" |
6 | 6 |
7 #include <cert.h> | 7 #include <cert.h> |
8 #include <certdb.h> | 8 #include <certdb.h> |
9 #include <keyhi.h> | 9 #include <keyhi.h> |
10 #include <pk11pub.h> | 10 #include <pk11pub.h> |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 | 91 |
92 protected: | 92 protected: |
93 void OnImportCompleted(bool expected_success, | 93 void OnImportCompleted(bool expected_success, |
94 bool success, | 94 bool success, |
95 const net::CertificateList& onc_trusted_certificates) { | 95 const net::CertificateList& onc_trusted_certificates) { |
96 EXPECT_EQ(expected_success, success); | 96 EXPECT_EQ(expected_success, success); |
97 web_trust_certificates_ = onc_trusted_certificates; | 97 web_trust_certificates_ = onc_trusted_certificates; |
98 } | 98 } |
99 | 99 |
100 void AddCertificatesFromFile(std::string filename, bool expected_success) { | 100 void AddCertificatesFromFile(const std::string& filename, |
| 101 bool expected_success) { |
101 scoped_ptr<base::DictionaryValue> onc = | 102 scoped_ptr<base::DictionaryValue> onc = |
102 test_utils::ReadTestDictionary(filename); | 103 test_utils::ReadTestDictionary(filename); |
103 scoped_ptr<base::Value> certificates_value; | 104 scoped_ptr<base::Value> certificates_value; |
104 base::ListValue* certificates = NULL; | 105 base::ListValue* certificates = NULL; |
105 onc->RemoveWithoutPathExpansion(::onc::toplevel_config::kCertificates, | 106 onc->RemoveWithoutPathExpansion(::onc::toplevel_config::kCertificates, |
106 &certificates_value); | 107 &certificates_value); |
107 certificates_value.release()->GetAsList(&certificates); | 108 certificates_value.release()->GetAsList(&certificates); |
108 onc_certificates_.reset(certificates); | 109 onc_certificates_.reset(certificates); |
109 | 110 |
110 web_trust_certificates_.clear(); | 111 web_trust_certificates_.clear(); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 "certificate-client-update.onc"), | 342 "certificate-client-update.onc"), |
342 CertParam(net::SERVER_CERT, | 343 CertParam(net::SERVER_CERT, |
343 "certificate-server.onc", | 344 "certificate-server.onc", |
344 "certificate-server-update.onc"), | 345 "certificate-server-update.onc"), |
345 CertParam(net::CA_CERT, | 346 CertParam(net::CA_CERT, |
346 "certificate-web-authority.onc", | 347 "certificate-web-authority.onc", |
347 "certificate-web-authority-update.onc"))); | 348 "certificate-web-authority-update.onc"))); |
348 | 349 |
349 } // namespace onc | 350 } // namespace onc |
350 } // namespace chromeos | 351 } // namespace chromeos |
OLD | NEW |