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 #include "chromeos/network/client_cert_resolver.h" | 4 #include "chromeos/network/client_cert_resolver.h" |
5 | 5 |
6 #include <cert.h> | 6 #include <cert.h> |
7 #include <pk11pub.h> | 7 #include <pk11pub.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 managed_config_handler_.reset(); | 91 managed_config_handler_.reset(); |
92 network_config_handler_.reset(); | 92 network_config_handler_.reset(); |
93 network_profile_handler_.reset(); | 93 network_profile_handler_.reset(); |
94 network_state_handler_.reset(); | 94 network_state_handler_.reset(); |
95 CertLoader::Shutdown(); | 95 CertLoader::Shutdown(); |
96 DBusThreadManager::Shutdown(); | 96 DBusThreadManager::Shutdown(); |
97 } | 97 } |
98 | 98 |
99 protected: | 99 protected: |
100 void StartCertLoader() { | 100 void StartCertLoader() { |
101 cert_loader_->StartWithNSSDB(test_nsscertdb_.get()); | 101 cert_loader_->SetUserNSSDB(test_nsscertdb_.get()); |
102 if (test_client_cert_.get()) { | 102 if (test_client_cert_.get()) { |
103 int slot_id = 0; | 103 int slot_id = 0; |
104 const std::string pkcs11_id = | 104 const std::string pkcs11_id = |
105 CertLoader::GetPkcs11IdAndSlotForCert(*test_client_cert_, &slot_id); | 105 CertLoader::GetPkcs11IdAndSlotForCert(*test_client_cert_, &slot_id); |
106 test_cert_id_ = base::StringPrintf("%i:%s", slot_id, pkcs11_id.c_str()); | 106 test_cert_id_ = base::StringPrintf("%i:%s", slot_id, pkcs11_id.c_str()); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 // Imports a client certificate. Its PKCS#11 ID is stored in |test_cert_id_|. | 110 // Imports a client certificate. Its PKCS#11 ID is stored in |test_cert_id_|. |
111 // If |import_issuer| is true, also imports the CA cert (stored as PEM in | 111 // If |import_issuer| is true, also imports the CA cert (stored as PEM in |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 SetupPolicyMatchingIssuerPEM(onc::ONC_SOURCE_USER_POLICY, | 591 SetupPolicyMatchingIssuerPEM(onc::ONC_SOURCE_USER_POLICY, |
592 "upn-${CERT_SAN_UPN}-suffix"); | 592 "upn-${CERT_SAN_UPN}-suffix"); |
593 base::RunLoop().RunUntilIdle(); | 593 base::RunLoop().RunUntilIdle(); |
594 | 594 |
595 GetServiceProperty(shill::kEapIdentityProperty, &identity); | 595 GetServiceProperty(shill::kEapIdentityProperty, &identity); |
596 EXPECT_EQ("upn-santest@ad.corp.example.com-suffix", identity); | 596 EXPECT_EQ("upn-santest@ad.corp.example.com-suffix", identity); |
597 EXPECT_EQ(2, network_properties_changed_count_); | 597 EXPECT_EQ(2, network_properties_changed_count_); |
598 } | 598 } |
599 | 599 |
600 } // namespace chromeos | 600 } // namespace chromeos |
OLD | NEW |