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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 pending_requests_.erase(service_path); | 424 pending_requests_.erase(service_path); |
425 return; | 425 return; |
426 } | 426 } |
427 | 427 |
428 pkcs11_id = CertificateIsConfigured(ui_data.get()); | 428 pkcs11_id = CertificateIsConfigured(ui_data.get()); |
429 // Ensure the certificate is available and configured. | 429 // Ensure the certificate is available and configured. |
430 if (!cert_loader_->IsHardwareBacked() || pkcs11_id.empty()) { | 430 if (!cert_loader_->IsHardwareBacked() || pkcs11_id.empty()) { |
431 ErrorCallbackForPendingRequest(service_path, kErrorCertificateRequired); | 431 ErrorCallbackForPendingRequest(service_path, kErrorCertificateRequired); |
432 return; | 432 return; |
433 } | 433 } |
| 434 } else if (check_error_state && |
| 435 !client_cert::IsCertificateConfigured(client_cert_type, |
| 436 service_properties)) { |
| 437 // Network may not be configured. |
| 438 ErrorCallbackForPendingRequest(service_path, kErrorConfigurationRequired); |
| 439 return; |
434 } | 440 } |
435 | 441 |
436 // The network may not be 'Connectable' because the TPM properties are not | 442 // The network may not be 'Connectable' because the TPM properties are not |
437 // set up, so configure tpm slot/pin before connecting. | 443 // set up, so configure tpm slot/pin before connecting. |
438 if (cert_loader_ && cert_loader_->IsHardwareBacked()) { | 444 if (cert_loader_ && cert_loader_->IsHardwareBacked()) { |
439 // Pass NULL if pkcs11_id is empty, so that it doesn't clear any | 445 // Pass NULL if pkcs11_id is empty, so that it doesn't clear any |
440 // previously configured client cert. | 446 // previously configured client cert. |
441 client_cert::SetShillProperties(client_cert_type, | 447 client_cert::SetShillProperties(client_cert_type, |
442 cert_loader_->tpm_token_slot(), | 448 cert_loader_->tpm_token_slot(), |
443 cert_loader_->tpm_user_pin(), | 449 cert_loader_->tpm_user_pin(), |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 | 650 |
645 void NetworkConnectionHandler::HandleShillDisconnectSuccess( | 651 void NetworkConnectionHandler::HandleShillDisconnectSuccess( |
646 const std::string& service_path, | 652 const std::string& service_path, |
647 const base::Closure& success_callback) { | 653 const base::Closure& success_callback) { |
648 NET_LOG_EVENT("Disconnect Request Sent", service_path); | 654 NET_LOG_EVENT("Disconnect Request Sent", service_path); |
649 if (!success_callback.is_null()) | 655 if (!success_callback.is_null()) |
650 success_callback.Run(); | 656 success_callback.Run(); |
651 } | 657 } |
652 | 658 |
653 } // namespace chromeos | 659 } // namespace chromeos |
OLD | NEW |