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

Side by Side Diff: chrome/browser/chromeos/options/vpn_config_view.cc

Issue 485083002: Fix network configurations that use the system CA certs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/options/wifi_config_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/chromeos/options/vpn_config_view.h" 5 #include "chrome/browser/chromeos/options/vpn_config_view.h"
6 6
7 #include "ash/system/chromeos/network/network_connect.h" 7 #include "ash/system/chromeos/network/network_connect.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 shill::kL2tpIpsecUserProperty, user_name); 830 shill::kL2tpIpsecUserProperty, user_name);
831 } 831 }
832 if (!user_passphrase.empty()) { 832 if (!user_passphrase.empty()) {
833 properties->SetStringWithoutPathExpansion( 833 properties->SetStringWithoutPathExpansion(
834 shill::kL2tpIpsecPasswordProperty, user_passphrase); 834 shill::kL2tpIpsecPasswordProperty, user_passphrase);
835 } 835 }
836 break; 836 break;
837 } 837 }
838 case PROVIDER_TYPE_INDEX_L2TP_IPSEC_USER_CERT: { 838 case PROVIDER_TYPE_INDEX_L2TP_IPSEC_USER_CERT: {
839 std::string ca_cert_pem = GetServerCACertPEM(); 839 std::string ca_cert_pem = GetServerCACertPEM();
840 if (!ca_cert_pem.empty()) { 840 base::ListValue* pem_list = new base::ListValue;
841 base::ListValue* pem_list = new base::ListValue; 841 if (!ca_cert_pem.empty())
842 pem_list->AppendString(ca_cert_pem); 842 pem_list->AppendString(ca_cert_pem);
843 properties->SetWithoutPathExpansion( 843 properties->SetWithoutPathExpansion(shill::kL2tpIpsecCaCertPemProperty,
844 shill::kL2tpIpsecCaCertPemProperty, pem_list); 844 pem_list);
845 }
846 SetUserCertProperties(client_cert::CONFIG_TYPE_IPSEC, properties); 845 SetUserCertProperties(client_cert::CONFIG_TYPE_IPSEC, properties);
847 if (!group_name.empty()) { 846 if (!group_name.empty()) {
848 properties->SetStringWithoutPathExpansion( 847 properties->SetStringWithoutPathExpansion(
849 shill::kL2tpIpsecTunnelGroupProperty, GetGroupName()); 848 shill::kL2tpIpsecTunnelGroupProperty, GetGroupName());
850 } 849 }
851 if (!user_name.empty()) { 850 if (!user_name.empty()) {
852 properties->SetStringWithoutPathExpansion( 851 properties->SetStringWithoutPathExpansion(
853 shill::kL2tpIpsecUserProperty, user_name); 852 shill::kL2tpIpsecUserProperty, user_name);
854 } 853 }
855 if (!user_passphrase.empty()) { 854 if (!user_passphrase.empty()) {
856 properties->SetStringWithoutPathExpansion( 855 properties->SetStringWithoutPathExpansion(
857 shill::kL2tpIpsecPasswordProperty, user_passphrase); 856 shill::kL2tpIpsecPasswordProperty, user_passphrase);
858 } 857 }
859 break; 858 break;
860 } 859 }
861 case PROVIDER_TYPE_INDEX_OPEN_VPN: { 860 case PROVIDER_TYPE_INDEX_OPEN_VPN: {
862 std::string ca_cert_pem = GetServerCACertPEM(); 861 std::string ca_cert_pem = GetServerCACertPEM();
863 if (!ca_cert_pem.empty()) { 862 base::ListValue* pem_list = new base::ListValue;
864 base::ListValue* pem_list = new base::ListValue; 863 if (!ca_cert_pem.empty())
865 pem_list->AppendString(ca_cert_pem); 864 pem_list->AppendString(ca_cert_pem);
866 properties->SetWithoutPathExpansion( 865 properties->SetWithoutPathExpansion(shill::kOpenVPNCaCertPemProperty,
867 shill::kOpenVPNCaCertPemProperty, pem_list); 866 pem_list);
868 }
869 SetUserCertProperties(client_cert::CONFIG_TYPE_OPENVPN, properties); 867 SetUserCertProperties(client_cert::CONFIG_TYPE_OPENVPN, properties);
870 properties->SetStringWithoutPathExpansion( 868 properties->SetStringWithoutPathExpansion(
871 shill::kOpenVPNUserProperty, GetUsername()); 869 shill::kOpenVPNUserProperty, GetUsername());
872 if (!user_passphrase.empty()) { 870 if (!user_passphrase.empty()) {
873 properties->SetStringWithoutPathExpansion( 871 properties->SetStringWithoutPathExpansion(
874 shill::kOpenVPNPasswordProperty, user_passphrase); 872 shill::kOpenVPNPasswordProperty, user_passphrase);
875 } 873 }
876 std::string otp = GetOTP(); 874 std::string otp = GetOTP();
877 if (!otp.empty()) { 875 if (!otp.empty()) {
878 properties->SetStringWithoutPathExpansion( 876 properties->SetStringWithoutPathExpansion(
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 property_ui_data->ParseOncProperty( 1062 property_ui_data->ParseOncProperty(
1065 onc_source, 1063 onc_source,
1066 onc, 1064 onc,
1067 base::StringPrintf("%s.%s.%s", 1065 base::StringPrintf("%s.%s.%s",
1068 ::onc::network_config::kVPN, 1066 ::onc::network_config::kVPN,
1069 dict_key.c_str(), 1067 dict_key.c_str(),
1070 key.c_str())); 1068 key.c_str()));
1071 } 1069 }
1072 1070
1073 } // namespace chromeos 1071 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/options/wifi_config_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698