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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 } | 630 } |
631 | 631 |
632 void ShillToONCTranslator::TranslateStaticIPConfig() { | 632 void ShillToONCTranslator::TranslateStaticIPConfig() { |
633 TranslateSavedOrStaticIPConfig(); | 633 TranslateSavedOrStaticIPConfig(); |
634 } | 634 } |
635 | 635 |
636 void ShillToONCTranslator::TranslateEap() { | 636 void ShillToONCTranslator::TranslateEap() { |
637 CopyPropertiesAccordingToSignature(); | 637 CopyPropertiesAccordingToSignature(); |
638 | 638 |
639 // Translate EAP Outer and Inner values if EAP.EAP exists and is not empty. | 639 // Translate EAP Outer and Inner values if EAP.EAP exists and is not empty. |
640 std::string shill_eap; | 640 std::string shill_eap_method; |
641 if (shill_dictionary_->GetStringWithoutPathExpansion( | 641 if (shill_dictionary_->GetStringWithoutPathExpansion( |
642 shill::kEapMethodProperty, &shill_eap) && | 642 shill::kEapMethodProperty, &shill_eap_method) && |
643 !shill_eap.empty()) { | 643 !shill_eap_method.empty()) { |
644 TranslateWithTableAndSet(shill::kEapMethodProperty, kEAPOuterTable, | 644 TranslateWithTableAndSet(shill::kEapMethodProperty, kEAPOuterTable, |
645 ::onc::eap::kOuter); | 645 ::onc::eap::kOuter); |
646 TranslateWithTableAndSet(shill::kEapPhase2AuthProperty, | 646 std::string shill_phase2_auth; |
647 kEAP_TTLS_InnerTable, ::onc::eap::kInner); | 647 if (shill_dictionary_->GetStringWithoutPathExpansion( |
| 648 shill::kEapPhase2AuthProperty, &shill_phase2_auth) && |
| 649 !shill_phase2_auth.empty()) { |
| 650 TranslateWithTableAndSet(shill::kEapPhase2AuthProperty, |
| 651 kEAP_TTLS_InnerTable, ::onc::eap::kInner); |
| 652 } |
| 653 } |
| 654 |
| 655 std::string shill_cert_id; |
| 656 if (shill_dictionary_->GetStringWithoutPathExpansion( |
| 657 shill::kEapCertIdProperty, &shill_cert_id)) { |
| 658 // Note: shill::kEapKeyIdProperty == shill::kEapCertIdProperty. |
| 659 onc_object_->SetStringWithoutPathExpansion( |
| 660 ::onc::client_cert::kClientCertType, ::onc::client_cert::kPKCS11Id); |
| 661 onc_object_->SetStringWithoutPathExpansion( |
| 662 ::onc::client_cert::kClientCertPKCS11Id, shill_cert_id); |
648 } | 663 } |
649 } | 664 } |
650 | 665 |
651 void ShillToONCTranslator::TranslateAndAddNestedObject( | 666 void ShillToONCTranslator::TranslateAndAddNestedObject( |
652 const std::string& onc_field_name) { | 667 const std::string& onc_field_name) { |
653 TranslateAndAddNestedObject(onc_field_name, *shill_dictionary_); | 668 TranslateAndAddNestedObject(onc_field_name, *shill_dictionary_); |
654 } | 669 } |
655 | 670 |
656 void ShillToONCTranslator::TranslateAndAddNestedObject( | 671 void ShillToONCTranslator::TranslateAndAddNestedObject( |
657 const std::string& onc_field_name, | 672 const std::string& onc_field_name, |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 const NetworkState* network_state) { | 811 const NetworkState* network_state) { |
797 CHECK(onc_signature != NULL); | 812 CHECK(onc_signature != NULL); |
798 | 813 |
799 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature, | 814 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature, |
800 network_state); | 815 network_state); |
801 return translator.CreateTranslatedONCObject(); | 816 return translator.CreateTranslatedONCObject(); |
802 } | 817 } |
803 | 818 |
804 } // namespace onc | 819 } // namespace onc |
805 } // namespace chromeos | 820 } // namespace chromeos |
OLD | NEW |