Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: chromeos/network/network_connection_handler.cc

Issue 36593002: crypto/nss_util: Get TPM slot id, do lookup by id instead of by name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove the notreached Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/network_connection_handler.h" 5 #include "chromeos/network/network_connection_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/strings/string_number_conversions.h"
10 #include "chromeos/chromeos_switches.h" 11 #include "chromeos/chromeos_switches.h"
11 #include "chromeos/dbus/dbus_thread_manager.h" 12 #include "chromeos/dbus/dbus_thread_manager.h"
12 #include "chromeos/dbus/shill_manager_client.h" 13 #include "chromeos/dbus/shill_manager_client.h"
13 #include "chromeos/dbus/shill_service_client.h" 14 #include "chromeos/dbus/shill_service_client.h"
14 #include "chromeos/network/client_cert_util.h" 15 #include "chromeos/network/client_cert_util.h"
15 #include "chromeos/network/network_configuration_handler.h" 16 #include "chromeos/network/network_configuration_handler.h"
16 #include "chromeos/network/network_event_log.h" 17 #include "chromeos/network/network_event_log.h"
17 #include "chromeos/network/network_handler_callbacks.h" 18 #include "chromeos/network/network_handler_callbacks.h"
18 #include "chromeos/network/network_profile_handler.h" 19 #include "chromeos/network/network_profile_handler.h"
19 #include "chromeos/network/network_state.h" 20 #include "chromeos/network/network_state.h"
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 // Network may not be configured. 435 // Network may not be configured.
435 ErrorCallbackForPendingRequest(service_path, kErrorConfigurationRequired); 436 ErrorCallbackForPendingRequest(service_path, kErrorConfigurationRequired);
436 return; 437 return;
437 } 438 }
438 439
439 // The network may not be 'Connectable' because the TPM properties are not 440 // The network may not be 'Connectable' because the TPM properties are not
440 // set up, so configure tpm slot/pin before connecting. 441 // set up, so configure tpm slot/pin before connecting.
441 if (cert_loader_ && cert_loader_->IsHardwareBacked()) { 442 if (cert_loader_ && cert_loader_->IsHardwareBacked()) {
442 // Pass NULL if pkcs11_id is empty, so that it doesn't clear any 443 // Pass NULL if pkcs11_id is empty, so that it doesn't clear any
443 // previously configured client cert. 444 // previously configured client cert.
444 client_cert::SetShillProperties(client_cert_type, 445 client_cert::SetShillProperties(
445 cert_loader_->tpm_token_slot(), 446 client_cert_type,
446 cert_loader_->tpm_user_pin(), 447 base::IntToString(cert_loader_->tpm_token_slot()),
447 pkcs11_id.empty() ? NULL : &pkcs11_id, 448 cert_loader_->tpm_user_pin(),
448 &config_properties); 449 pkcs11_id.empty() ? NULL : &pkcs11_id,
450 &config_properties);
449 } 451 }
450 } 452 }
451 453
452 if (type == shill::kTypeVPN) { 454 if (type == shill::kTypeVPN) {
453 // VPN may require a username, and/or passphrase to be set. (Check after 455 // VPN may require a username, and/or passphrase to be set. (Check after
454 // ensuring that any required certificates are configured). 456 // ensuring that any required certificates are configured).
455 DCHECK(provider_properties); 457 DCHECK(provider_properties);
456 if (VPNRequiresCredentials( 458 if (VPNRequiresCredentials(
457 service_path, vpn_provider_type, *provider_properties)) { 459 service_path, vpn_provider_type, *provider_properties)) {
458 NET_LOG_USER("VPN Requires Credentials", service_path); 460 NET_LOG_USER("VPN Requires Credentials", service_path);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 663
662 void NetworkConnectionHandler::HandleShillDisconnectSuccess( 664 void NetworkConnectionHandler::HandleShillDisconnectSuccess(
663 const std::string& service_path, 665 const std::string& service_path,
664 const base::Closure& success_callback) { 666 const base::Closure& success_callback) {
665 NET_LOG_EVENT("Disconnect Request Sent", service_path); 667 NET_LOG_EVENT("Disconnect Request Sent", service_path);
666 if (!success_callback.is_null()) 668 if (!success_callback.is_null())
667 success_callback.Run(); 669 success_callback.Run();
668 } 670 }
669 671
670 } // namespace chromeos 672 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698