| 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 "chromeos/network/onc/onc_certificate_importer.h" | 5 #include "chromeos/network/onc/onc_certificate_importer.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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 std::string* guid) { | 82 std::string* guid) { |
| 83 scoped_ptr<base::DictionaryValue> onc = | 83 scoped_ptr<base::DictionaryValue> onc = |
| 84 test_utils::ReadTestDictionary(filename); | 84 test_utils::ReadTestDictionary(filename); |
| 85 base::ListValue* certificates; | 85 base::ListValue* certificates; |
| 86 onc->GetListWithoutPathExpansion(kCertificates, &certificates); | 86 onc->GetListWithoutPathExpansion(kCertificates, &certificates); |
| 87 | 87 |
| 88 base::DictionaryValue* certificate; | 88 base::DictionaryValue* certificate; |
| 89 certificates->GetDictionary(0, &certificate); | 89 certificates->GetDictionary(0, &certificate); |
| 90 certificate->GetStringWithoutPathExpansion(kGUID, guid); | 90 certificate->GetStringWithoutPathExpansion(kGUID, guid); |
| 91 | 91 |
| 92 CertificateImporter importer(ONC_SOURCE_USER_IMPORT, | 92 CertificateImporter importer(false /* don't allow web trust */); |
| 93 false /* don't allow web trust */); | |
| 94 EXPECT_EQ(CertificateImporter::IMPORT_OK, | 93 EXPECT_EQ(CertificateImporter::IMPORT_OK, |
| 95 importer.ParseAndStoreCertificates(*certificates)); | 94 importer.ParseAndStoreCertificates(*certificates)); |
| 96 | 95 |
| 97 net::CertificateList result_list; | 96 net::CertificateList result_list; |
| 98 CertificateImporter::ListCertsWithNickname(*guid, &result_list); | 97 CertificateImporter::ListCertsWithNickname(*guid, &result_list); |
| 99 ASSERT_EQ(1ul, result_list.size()); | 98 ASSERT_EQ(1ul, result_list.size()); |
| 100 EXPECT_EQ(expected_type, GetCertType(result_list[0]->os_cert_handle())); | 99 EXPECT_EQ(expected_type, GetCertType(result_list[0]->os_cert_handle())); |
| 101 } | 100 } |
| 102 | 101 |
| 103 scoped_refptr<net::CryptoModule> slot_; | 102 scoped_refptr<net::CryptoModule> slot_; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 std::make_pair(net::SERVER_CERT, | 251 std::make_pair(net::SERVER_CERT, |
| 253 std::make_pair("certificate-server.onc", | 252 std::make_pair("certificate-server.onc", |
| 254 "certificate-server-update.onc")), | 253 "certificate-server-update.onc")), |
| 255 std::make_pair( | 254 std::make_pair( |
| 256 net::CA_CERT, | 255 net::CA_CERT, |
| 257 std::make_pair("certificate-web-authority.onc", | 256 std::make_pair("certificate-web-authority.onc", |
| 258 "certificate-web-authority-update.onc")))); | 257 "certificate-web-authority-update.onc")))); |
| 259 | 258 |
| 260 } // namespace onc | 259 } // namespace onc |
| 261 } // namespace chromeos | 260 } // namespace chromeos |
| OLD | NEW |