OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 } | 631 } |
632 | 632 |
633 void ShillToONCTranslator::TranslateStaticIPConfig() { | 633 void ShillToONCTranslator::TranslateStaticIPConfig() { |
634 TranslateSavedOrStaticIPConfig(); | 634 TranslateSavedOrStaticIPConfig(); |
635 } | 635 } |
636 | 636 |
637 void ShillToONCTranslator::TranslateEap() { | 637 void ShillToONCTranslator::TranslateEap() { |
638 CopyPropertiesAccordingToSignature(); | 638 CopyPropertiesAccordingToSignature(); |
639 | 639 |
640 // Translate EAP Outer and Inner values if EAP.EAP exists and is not empty. | 640 // Translate EAP Outer and Inner values if EAP.EAP exists and is not empty. |
641 std::string shill_eap; | 641 std::string shill_eap_method; |
642 if (shill_dictionary_->GetStringWithoutPathExpansion( | 642 if (shill_dictionary_->GetStringWithoutPathExpansion( |
643 shill::kEapMethodProperty, &shill_eap) && | 643 shill::kEapMethodProperty, &shill_eap_method) && |
644 !shill_eap.empty()) { | 644 !shill_eap_method.empty()) { |
645 TranslateWithTableAndSet(shill::kEapMethodProperty, kEAPOuterTable, | 645 TranslateWithTableAndSet(shill::kEapMethodProperty, kEAPOuterTable, |
646 ::onc::eap::kOuter); | 646 ::onc::eap::kOuter); |
647 TranslateWithTableAndSet(shill::kEapPhase2AuthProperty, | 647 std::string shill_phase2_auth; |
648 kEAP_TTLS_InnerTable, ::onc::eap::kInner); | 648 if (shill_dictionary_->GetStringWithoutPathExpansion( |
| 649 shill::kEapPhase2AuthProperty, &shill_phase2_auth) && |
| 650 !shill_phase2_auth.empty()) { |
| 651 TranslateWithTableAndSet(shill::kEapPhase2AuthProperty, |
| 652 kEAP_TTLS_InnerTable, ::onc::eap::kInner); |
| 653 } |
| 654 } |
| 655 |
| 656 std::string shill_cert_id; |
| 657 if (shill_dictionary_->GetStringWithoutPathExpansion( |
| 658 shill::kEapCertIdProperty, &shill_cert_id)) { |
| 659 // Note: shill::kEapKeyIdProperty == shill::kEapCertIdProperty. |
| 660 onc_object_->SetStringWithoutPathExpansion( |
| 661 ::onc::client_cert::kClientCertType, ::onc::client_cert::kPKCS11Id); |
| 662 onc_object_->SetStringWithoutPathExpansion( |
| 663 ::onc::client_cert::kClientCertPKCS11Id, shill_cert_id); |
649 } | 664 } |
650 } | 665 } |
651 | 666 |
652 void ShillToONCTranslator::TranslateAndAddNestedObject( | 667 void ShillToONCTranslator::TranslateAndAddNestedObject( |
653 const std::string& onc_field_name) { | 668 const std::string& onc_field_name) { |
654 TranslateAndAddNestedObject(onc_field_name, *shill_dictionary_); | 669 TranslateAndAddNestedObject(onc_field_name, *shill_dictionary_); |
655 } | 670 } |
656 | 671 |
657 void ShillToONCTranslator::TranslateAndAddNestedObject( | 672 void ShillToONCTranslator::TranslateAndAddNestedObject( |
658 const std::string& onc_field_name, | 673 const std::string& onc_field_name, |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 const NetworkState* network_state) { | 815 const NetworkState* network_state) { |
801 CHECK(onc_signature != NULL); | 816 CHECK(onc_signature != NULL); |
802 | 817 |
803 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature, | 818 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature, |
804 network_state); | 819 network_state); |
805 return translator.CreateTranslatedONCObject(); | 820 return translator.CreateTranslatedONCObject(); |
806 } | 821 } |
807 | 822 |
808 } // namespace onc | 823 } // namespace onc |
809 } // namespace chromeos | 824 } // namespace chromeos |
OLD | NEW |