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 "chrome/browser/chromeos/cros/onc_network_parser.h" | 5 #include "chrome/browser/chromeos/cros/onc_network_parser.h" |
6 | 6 |
7 #include <keyhi.h> | 7 #include <keyhi.h> |
8 #include <pk11pub.h> | 8 #include <pk11pub.h> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1934 virtual_network->set_save_credentials(GetBooleanValue(value)); | 1934 virtual_network->set_save_credentials(GetBooleanValue(value)); |
1935 return true; | 1935 return true; |
1936 case PROPERTY_INDEX_OPEN_VPN_CACERT: | 1936 case PROPERTY_INDEX_OPEN_VPN_CACERT: |
1937 virtual_network->set_ca_cert_nss(GetStringValue(value)); | 1937 virtual_network->set_ca_cert_nss(GetStringValue(value)); |
1938 return true; | 1938 return true; |
1939 case PROPERTY_INDEX_OPEN_VPN_REMOTECERTKU: { | 1939 case PROPERTY_INDEX_OPEN_VPN_REMOTECERTKU: { |
1940 // ONC supports a list of these, but we flimflam supports only one | 1940 // ONC supports a list of these, but we flimflam supports only one |
1941 // today. So extract the first. | 1941 // today. So extract the first. |
1942 const base::ListValue* value_list = NULL; | 1942 const base::ListValue* value_list = NULL; |
1943 value.GetAsList(&value_list); | 1943 value.GetAsList(&value_list); |
1944 base::Value* first_item = NULL; | 1944 const base::Value* first_item = NULL; |
1945 if (!value_list->Get(0, &first_item) || | 1945 if (!value_list->Get(0, &first_item) || |
1946 !first_item->IsType(base::Value::TYPE_STRING)) { | 1946 !first_item->IsType(base::Value::TYPE_STRING)) { |
1947 VLOG(1) << "RemoteCertKU must be non-empty list of strings"; | 1947 VLOG(1) << "RemoteCertKU must be non-empty list of strings"; |
1948 return false; | 1948 return false; |
1949 } | 1949 } |
1950 virtual_network->UpdatePropertyMap(index, first_item); | 1950 virtual_network->UpdatePropertyMap(index, first_item); |
1951 return true; | 1951 return true; |
1952 } | 1952 } |
1953 case PROPERTY_INDEX_OPEN_VPN_AUTH: | 1953 case PROPERTY_INDEX_OPEN_VPN_AUTH: |
1954 case PROPERTY_INDEX_OPEN_VPN_AUTHRETRY: | 1954 case PROPERTY_INDEX_OPEN_VPN_AUTHRETRY: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2011 // on the value of AuthenticationType. | 2011 // on the value of AuthenticationType. |
2012 { "L2TP-IPsec", PROVIDER_TYPE_L2TP_IPSEC_PSK }, | 2012 { "L2TP-IPsec", PROVIDER_TYPE_L2TP_IPSEC_PSK }, |
2013 { "OpenVPN", PROVIDER_TYPE_OPEN_VPN }, | 2013 { "OpenVPN", PROVIDER_TYPE_OPEN_VPN }, |
2014 }; | 2014 }; |
2015 CR_DEFINE_STATIC_LOCAL(EnumMapper<ProviderType>, parser, | 2015 CR_DEFINE_STATIC_LOCAL(EnumMapper<ProviderType>, parser, |
2016 (table, arraysize(table), PROVIDER_TYPE_MAX)); | 2016 (table, arraysize(table), PROVIDER_TYPE_MAX)); |
2017 return parser.Get(type); | 2017 return parser.Get(type); |
2018 } | 2018 } |
2019 | 2019 |
2020 } // namespace chromeos | 2020 } // namespace chromeos |
OLD | NEW |