OLD | NEW |
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 "chromeos/chromeos_switches.h" | 10 #include "chromeos/chromeos_switches.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 pending_requests_.erase(service_path); | 432 pending_requests_.erase(service_path); |
433 return; | 433 return; |
434 } | 434 } |
435 | 435 |
436 pkcs11_id = CertificateIsConfigured(ui_data.get()); | 436 pkcs11_id = CertificateIsConfigured(ui_data.get()); |
437 // Ensure the certificate is available and configured. | 437 // Ensure the certificate is available and configured. |
438 if (!cert_loader_->IsHardwareBacked() || pkcs11_id.empty()) { | 438 if (!cert_loader_->IsHardwareBacked() || pkcs11_id.empty()) { |
439 ErrorCallbackForPendingRequest(service_path, kErrorCertificateRequired); | 439 ErrorCallbackForPendingRequest(service_path, kErrorCertificateRequired); |
440 return; | 440 return; |
441 } | 441 } |
| 442 } else if (check_error_state && |
| 443 !client_cert::IsCertificateConfigured(client_cert_type, |
| 444 service_properties)) { |
| 445 // Network may not be configured. |
| 446 ErrorCallbackForPendingRequest(service_path, kErrorConfigurationRequired); |
| 447 return; |
442 } | 448 } |
443 | 449 |
444 // The network may not be 'Connectable' because the TPM properties are not | 450 // The network may not be 'Connectable' because the TPM properties are not |
445 // set up, so configure tpm slot/pin before connecting. | 451 // set up, so configure tpm slot/pin before connecting. |
446 if (cert_loader_ && cert_loader_->IsHardwareBacked()) { | 452 if (cert_loader_ && cert_loader_->IsHardwareBacked()) { |
447 // Pass NULL if pkcs11_id is empty, so that it doesn't clear any | 453 // Pass NULL if pkcs11_id is empty, so that it doesn't clear any |
448 // previously configured client cert. | 454 // previously configured client cert. |
449 client_cert::SetShillProperties(client_cert_type, | 455 client_cert::SetShillProperties(client_cert_type, |
450 cert_loader_->tpm_token_slot(), | 456 cert_loader_->tpm_token_slot(), |
451 cert_loader_->tpm_user_pin(), | 457 cert_loader_->tpm_user_pin(), |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 | 669 |
664 void NetworkConnectionHandler::HandleShillDisconnectSuccess( | 670 void NetworkConnectionHandler::HandleShillDisconnectSuccess( |
665 const std::string& service_path, | 671 const std::string& service_path, |
666 const base::Closure& success_callback) { | 672 const base::Closure& success_callback) { |
667 NET_LOG_EVENT("Disconnect Request Sent", service_path); | 673 NET_LOG_EVENT("Disconnect Request Sent", service_path); |
668 if (!success_callback.is_null()) | 674 if (!success_callback.is_null()) |
669 success_callback.Run(); | 675 success_callback.Run(); |
670 } | 676 } |
671 | 677 |
672 } // namespace chromeos | 678 } // namespace chromeos |
OLD | NEW |