| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 165 | 165 | 
| 166   void SetupWifi() { | 166   void SetupWifi() { | 
| 167     service_test_->SetServiceProperties(kWifiStub, | 167     service_test_->SetServiceProperties(kWifiStub, | 
| 168                                         kWifiStub, | 168                                         kWifiStub, | 
| 169                                         kWifiSSID, | 169                                         kWifiSSID, | 
| 170                                         shill::kTypeWifi, | 170                                         shill::kTypeWifi, | 
| 171                                         shill::kStateOnline, | 171                                         shill::kStateOnline, | 
| 172                                         true /* visible */); | 172                                         true /* visible */); | 
| 173     // Set an arbitrary cert id, so that we can check afterwards whether we | 173     // Set an arbitrary cert id, so that we can check afterwards whether we | 
| 174     // cleared the property or not. | 174     // cleared the property or not. | 
| 175     service_test_->SetServiceProperty( | 175     service_test_->SetServiceProperty(kWifiStub, shill::kEapCertIdProperty, | 
| 176         kWifiStub, shill::kEapCertIdProperty, base::StringValue("invalid id")); | 176                                       base::Value("invalid id")); | 
| 177     profile_test_->AddService(kUserProfilePath, kWifiStub); | 177     profile_test_->AddService(kUserProfilePath, kWifiStub); | 
| 178 | 178 | 
| 179     DBusThreadManager::Get() | 179     DBusThreadManager::Get() | 
| 180         ->GetShillManagerClient() | 180         ->GetShillManagerClient() | 
| 181         ->GetTestInterface() | 181         ->GetTestInterface() | 
| 182         ->AddManagerService(kWifiStub, true); | 182         ->AddManagerService(kWifiStub, true); | 
| 183   } | 183   } | 
| 184 | 184 | 
| 185   // Sets up a policy with a certificate pattern that matches any client cert | 185   // Sets up a policy with a certificate pattern that matches any client cert | 
| 186   // with a certain Issuer CN. It will match the test client cert. | 186   // with a certain Issuer CN. It will match the test client cert. | 
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 253 | 253 | 
| 254     managed_config_handler_->SetPolicy( | 254     managed_config_handler_->SetPolicy( | 
| 255         onc::ONC_SOURCE_USER_POLICY, | 255         onc::ONC_SOURCE_USER_POLICY, | 
| 256         kUserHash, | 256         kUserHash, | 
| 257         *policy, | 257         *policy, | 
| 258         base::DictionaryValue() /* no global network config */); | 258         base::DictionaryValue() /* no global network config */); | 
| 259   } | 259   } | 
| 260 | 260 | 
| 261   void SetWifiState(const std::string& state) { | 261   void SetWifiState(const std::string& state) { | 
| 262     ASSERT_TRUE(service_test_->SetServiceProperty( | 262     ASSERT_TRUE(service_test_->SetServiceProperty( | 
| 263         kWifiStub, shill::kStateProperty, base::StringValue(state))); | 263         kWifiStub, shill::kStateProperty, base::Value(state))); | 
| 264   } | 264   } | 
| 265 | 265 | 
| 266   void GetServiceProperty(const std::string& prop_name, | 266   void GetServiceProperty(const std::string& prop_name, | 
| 267                           std::string* prop_value) { | 267                           std::string* prop_value) { | 
| 268     prop_value->clear(); | 268     prop_value->clear(); | 
| 269     const base::DictionaryValue* properties = | 269     const base::DictionaryValue* properties = | 
| 270         service_test_->GetServiceProperties(kWifiStub); | 270         service_test_->GetServiceProperties(kWifiStub); | 
| 271     if (!properties) | 271     if (!properties) | 
| 272       return; | 272       return; | 
| 273     properties->GetStringWithoutPathExpansion(prop_name, prop_value); | 273     properties->GetStringWithoutPathExpansion(prop_name, prop_value); | 
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 439   // substituted into the shill service entry. | 439   // substituted into the shill service entry. | 
| 440   SetupPolicyMatchingIssuerPEM("upn-${CERT_SAN_UPN}-suffix"); | 440   SetupPolicyMatchingIssuerPEM("upn-${CERT_SAN_UPN}-suffix"); | 
| 441   base::RunLoop().RunUntilIdle(); | 441   base::RunLoop().RunUntilIdle(); | 
| 442 | 442 | 
| 443   GetServiceProperty(shill::kEapIdentityProperty, &identity); | 443   GetServiceProperty(shill::kEapIdentityProperty, &identity); | 
| 444   EXPECT_EQ("upn-santest@ad.corp.example.com-suffix", identity); | 444   EXPECT_EQ("upn-santest@ad.corp.example.com-suffix", identity); | 
| 445   EXPECT_EQ(2, network_properties_changed_count_); | 445   EXPECT_EQ(2, network_properties_changed_count_); | 
| 446 } | 446 } | 
| 447 | 447 | 
| 448 }  // namespace chromeos | 448 }  // namespace chromeos | 
| OLD | NEW | 
|---|