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

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: sandbox debugging crap Created 7 years, 1 month 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 // Network may not be configured. 438 // Network may not be configured.
438 ErrorCallbackForPendingRequest(service_path, kErrorConfigurationRequired); 439 ErrorCallbackForPendingRequest(service_path, kErrorConfigurationRequired);
439 return; 440 return;
440 } 441 }
441 442
442 // The network may not be 'Connectable' because the TPM properties are not 443 // The network may not be 'Connectable' because the TPM properties are not
443 // set up, so configure tpm slot/pin before connecting. 444 // set up, so configure tpm slot/pin before connecting.
444 if (cert_loader_ && cert_loader_->IsHardwareBacked()) { 445 if (cert_loader_ && cert_loader_->IsHardwareBacked()) {
445 // Pass NULL if pkcs11_id is empty, so that it doesn't clear any 446 // Pass NULL if pkcs11_id is empty, so that it doesn't clear any
446 // previously configured client cert. 447 // previously configured client cert.
447 client_cert::SetShillProperties(client_cert_type, 448 client_cert::SetShillProperties(
448 cert_loader_->tpm_token_slot(), 449 client_cert_type,
449 cert_loader_->tpm_user_pin(), 450 base::IntToString(cert_loader_->tpm_token_slot()),
450 pkcs11_id.empty() ? NULL : &pkcs11_id, 451 cert_loader_->tpm_user_pin(),
451 &config_properties); 452 pkcs11_id.empty() ? NULL : &pkcs11_id,
453 &config_properties);
452 } 454 }
453 } 455 }
454 456
455 if (type == shill::kTypeVPN) { 457 if (type == shill::kTypeVPN) {
456 // VPN may require a username, and/or passphrase to be set. (Check after 458 // VPN may require a username, and/or passphrase to be set. (Check after
457 // ensuring that any required certificates are configured). 459 // ensuring that any required certificates are configured).
458 DCHECK(provider_properties); 460 DCHECK(provider_properties);
459 if (VPNRequiresCredentials( 461 if (VPNRequiresCredentials(
460 service_path, vpn_provider_type, *provider_properties)) { 462 service_path, vpn_provider_type, *provider_properties)) {
461 NET_LOG_USER("VPN Requires Credentials", service_path); 463 NET_LOG_USER("VPN Requires Credentials", service_path);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 667
666 void NetworkConnectionHandler::HandleShillDisconnectSuccess( 668 void NetworkConnectionHandler::HandleShillDisconnectSuccess(
667 const std::string& service_path, 669 const std::string& service_path,
668 const base::Closure& success_callback) { 670 const base::Closure& success_callback) {
669 NET_LOG_EVENT("Disconnect Request Sent", service_path); 671 NET_LOG_EVENT("Disconnect Request Sent", service_path);
670 if (!success_callback.is_null()) 672 if (!success_callback.is_null())
671 success_callback.Run(); 673 success_callback.Run();
672 } 674 }
673 675
674 } // namespace chromeos 676 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698