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/client_cert_resolver.h" | 5 #include "chromeos/network/client_cert_resolver.h" |
6 | 6 |
7 #include <cert.h> | 7 #include <cert.h> |
8 #include <certt.h> // for (SECCertUsageEnum) certUsageAnyCA | 8 #include <certt.h> // for (SECCertUsageEnum) certUsageAnyCA |
9 #include <pk11pub.h> | 9 #include <pk11pub.h> |
10 | 10 |
11 #include <algorithm> | 11 #include <algorithm> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 15 #include "base/strings/string_number_conversions.h" |
15 #include "base/task_runner.h" | 16 #include "base/task_runner.h" |
16 #include "base/threading/worker_pool.h" | 17 #include "base/threading/worker_pool.h" |
17 #include "base/time/time.h" | 18 #include "base/time/time.h" |
18 #include "chromeos/cert_loader.h" | 19 #include "chromeos/cert_loader.h" |
19 #include "chromeos/dbus/dbus_thread_manager.h" | 20 #include "chromeos/dbus/dbus_thread_manager.h" |
20 #include "chromeos/dbus/shill_service_client.h" | 21 #include "chromeos/dbus/shill_service_client.h" |
21 #include "chromeos/network/certificate_pattern.h" | 22 #include "chromeos/network/certificate_pattern.h" |
22 #include "chromeos/network/client_cert_util.h" | 23 #include "chromeos/network/client_cert_util.h" |
23 #include "chromeos/network/favorite_state.h" | 24 #include "chromeos/network/favorite_state.h" |
24 #include "chromeos/network/managed_network_configuration_handler.h" | 25 #include "chromeos/network/managed_network_configuration_handler.h" |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 weak_ptr_factory_.GetWeakPtr(), | 425 weak_ptr_factory_.GetWeakPtr(), |
425 base::Owned(matches))); | 426 base::Owned(matches))); |
426 } | 427 } |
427 | 428 |
428 void ClientCertResolver::ConfigureCertificates(NetworkCertMatches* matches) { | 429 void ClientCertResolver::ConfigureCertificates(NetworkCertMatches* matches) { |
429 for (NetworkCertMatches::const_iterator it = matches->begin(); | 430 for (NetworkCertMatches::const_iterator it = matches->begin(); |
430 it != matches->end(); ++it) { | 431 it != matches->end(); ++it) { |
431 VLOG(1) << "Configuring certificate of network " << it->service_path; | 432 VLOG(1) << "Configuring certificate of network " << it->service_path; |
432 CertLoader* cert_loader = CertLoader::Get(); | 433 CertLoader* cert_loader = CertLoader::Get(); |
433 base::DictionaryValue shill_properties; | 434 base::DictionaryValue shill_properties; |
434 client_cert::SetShillProperties(it->cert_config_type, | 435 client_cert::SetShillProperties( |
435 cert_loader->tpm_token_slot(), | 436 it->cert_config_type, |
436 cert_loader->tpm_user_pin(), | 437 base::IntToString(cert_loader->tpm_token_slot_id()), |
437 &it->pkcs11_id, | 438 cert_loader->tpm_user_pin(), |
438 &shill_properties); | 439 &it->pkcs11_id, |
| 440 &shill_properties); |
439 DBusThreadManager::Get()->GetShillServiceClient()-> | 441 DBusThreadManager::Get()->GetShillServiceClient()-> |
440 SetProperties(dbus::ObjectPath(it->service_path), | 442 SetProperties(dbus::ObjectPath(it->service_path), |
441 shill_properties, | 443 shill_properties, |
442 base::Bind(&base::DoNothing), | 444 base::Bind(&base::DoNothing), |
443 base::Bind(&LogError, it->service_path)); | 445 base::Bind(&LogError, it->service_path)); |
444 network_state_handler_->RequestUpdateForNetwork(it->service_path); | 446 network_state_handler_->RequestUpdateForNetwork(it->service_path); |
445 } | 447 } |
446 } | 448 } |
447 | 449 |
448 } // namespace chromeos | 450 } // namespace chromeos |
OLD | NEW |