| 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 "base/bind.h" | 9 #include "base/bind.h" | 
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" | 
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 189         "        \"ClientCertPattern\": {" | 189         "        \"ClientCertPattern\": {" | 
| 190         "          \"IssuerCAPEMs\": [ \"%s\" ]" | 190         "          \"IssuerCAPEMs\": [ \"%s\" ]" | 
| 191         "        }" | 191         "        }" | 
| 192         "      }" | 192         "      }" | 
| 193         "    }" | 193         "    }" | 
| 194         "} ]"; | 194         "} ]"; | 
| 195     std::string policy_json = | 195     std::string policy_json = | 
| 196         base::StringPrintf(kTestPolicyTemplate, test_ca_cert_pem_.c_str()); | 196         base::StringPrintf(kTestPolicyTemplate, test_ca_cert_pem_.c_str()); | 
| 197 | 197 | 
| 198     std::string error; | 198     std::string error; | 
| 199     scoped_ptr<base::Value> policy_value( | 199     scoped_ptr<base::Value> policy_value = base::JSONReader::ReadAndReturnError( | 
| 200         base::JSONReader::DeprecatedReadAndReturnError( | 200         policy_json, base::JSON_ALLOW_TRAILING_COMMAS, NULL, &error); | 
| 201             policy_json, base::JSON_ALLOW_TRAILING_COMMAS, NULL, &error)); |  | 
| 202     ASSERT_TRUE(policy_value) << error; | 201     ASSERT_TRUE(policy_value) << error; | 
| 203 | 202 | 
| 204     base::ListValue* policy = NULL; | 203     base::ListValue* policy = NULL; | 
| 205     ASSERT_TRUE(policy_value->GetAsList(&policy)); | 204     ASSERT_TRUE(policy_value->GetAsList(&policy)); | 
| 206 | 205 | 
| 207     managed_config_handler_->SetPolicy( | 206     managed_config_handler_->SetPolicy( | 
| 208         onc::ONC_SOURCE_USER_POLICY, | 207         onc::ONC_SOURCE_USER_POLICY, | 
| 209         kUserHash, | 208         kUserHash, | 
| 210         *policy, | 209         *policy, | 
| 211         base::DictionaryValue() /* no global network config */); | 210         base::DictionaryValue() /* no global network config */); | 
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 301 | 300 | 
| 302   // Verify that the resolver positively matched the pattern in the policy with | 301   // Verify that the resolver positively matched the pattern in the policy with | 
| 303   // the test client cert and configured the network. | 302   // the test client cert and configured the network. | 
| 304   std::string pkcs11_id; | 303   std::string pkcs11_id; | 
| 305   GetClientCertProperties(&pkcs11_id); | 304   GetClientCertProperties(&pkcs11_id); | 
| 306   EXPECT_EQ(test_cert_id_, pkcs11_id); | 305   EXPECT_EQ(test_cert_id_, pkcs11_id); | 
| 307   EXPECT_EQ(1, network_properties_changed_count_); | 306   EXPECT_EQ(1, network_properties_changed_count_); | 
| 308 } | 307 } | 
| 309 | 308 | 
| 310 }  // namespace chromeos | 309 }  // namespace chromeos | 
| OLD | NEW | 
|---|