| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 EXPECT_EQ(expected_type, GetCertType(public_list_[0]->os_cert_handle())); | 124 EXPECT_EQ(expected_type, GetCertType(public_list_[0]->os_cert_handle())); |
| 125 if (!private_list_.empty()) | 125 if (!private_list_.empty()) |
| 126 EXPECT_EQ(expected_type, GetCertType(private_list_[0]->os_cert_handle())); | 126 EXPECT_EQ(expected_type, GetCertType(private_list_[0]->os_cert_handle())); |
| 127 | 127 |
| 128 base::DictionaryValue* certificate = NULL; | 128 base::DictionaryValue* certificate = NULL; |
| 129 onc_certificates_->GetDictionary(0, &certificate); | 129 onc_certificates_->GetDictionary(0, &certificate); |
| 130 certificate->GetStringWithoutPathExpansion(::onc::certificate::kGUID, guid); | 130 certificate->GetStringWithoutPathExpansion(::onc::certificate::kGUID, guid); |
| 131 | 131 |
| 132 if (expected_type == net::SERVER_CERT || expected_type == net::CA_CERT) { | 132 if (expected_type == net::SERVER_CERT || expected_type == net::CA_CERT) { |
| 133 EXPECT_EQ(1u, imported_server_and_ca_certs_.size()); | 133 EXPECT_EQ(1u, imported_server_and_ca_certs_.size()); |
| 134 EXPECT_TRUE(imported_server_and_ca_certs_[*guid]->Equals( | 134 EXPECT_TRUE( |
| 135 public_list_[0])); | 135 imported_server_and_ca_certs_[*guid]->Equals(public_list_[0].get())); |
| 136 } else { // net::USER_CERT | 136 } else { // net::USER_CERT |
| 137 EXPECT_TRUE(imported_server_and_ca_certs_.empty()); | 137 EXPECT_TRUE(imported_server_and_ca_certs_.empty()); |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 scoped_ptr<net::NSSCertDatabaseChromeOS> test_nssdb_; | 141 scoped_ptr<net::NSSCertDatabaseChromeOS> test_nssdb_; |
| 142 scoped_ptr<base::ListValue> onc_certificates_; | 142 scoped_ptr<base::ListValue> onc_certificates_; |
| 143 // List of certs in the nssdb's public slot. | 143 // List of certs in the nssdb's public slot. |
| 144 net::CertificateList public_list_; | 144 net::CertificateList public_list_; |
| 145 // List of certs in the nssdb's "private" slot. | 145 // List of certs in the nssdb's "private" slot. |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 "certificate-client-update.onc"), | 331 "certificate-client-update.onc"), |
| 332 CertParam(net::SERVER_CERT, | 332 CertParam(net::SERVER_CERT, |
| 333 "certificate-server.onc", | 333 "certificate-server.onc", |
| 334 "certificate-server-update.onc"), | 334 "certificate-server-update.onc"), |
| 335 CertParam(net::CA_CERT, | 335 CertParam(net::CA_CERT, |
| 336 "certificate-web-authority.onc", | 336 "certificate-web-authority.onc", |
| 337 "certificate-web-authority-update.onc"))); | 337 "certificate-web-authority-update.onc"))); |
| 338 | 338 |
| 339 } // namespace onc | 339 } // namespace onc |
| 340 } // namespace chromeos | 340 } // namespace chromeos |
| OLD | NEW |