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 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 // net::ProxyServer for the specific scheme. | 1372 // net::ProxyServer for the specific scheme. |
1373 net::HostPortPair host_port(host, static_cast<uint16>(port)); | 1373 net::HostPortPair host_port(host, static_cast<uint16>(port)); |
1374 return net::ProxyServer(scheme, host_port); | 1374 return net::ProxyServer(scheme, host_port); |
1375 } | 1375 } |
1376 | 1376 |
1377 // static | 1377 // static |
1378 bool OncNetworkParser::ParseClientCertPattern(OncNetworkParser* parser, | 1378 bool OncNetworkParser::ParseClientCertPattern(OncNetworkParser* parser, |
1379 PropertyIndex index, | 1379 PropertyIndex index, |
1380 const base::Value& value, | 1380 const base::Value& value, |
1381 Network* network) { | 1381 Network* network) { |
| 1382 // Ignore certificate patterns for device policy ONC so that an unmanaged user |
| 1383 // won't have a certificate presented for them involuntarily. |
| 1384 if (parser->onc_source() == NetworkUIData::ONC_SOURCE_DEVICE_POLICY) |
| 1385 return false; |
| 1386 |
1382 // Only WiFi and VPN have this type. | 1387 // Only WiFi and VPN have this type. |
1383 if (network->type() != TYPE_WIFI && | 1388 if (network->type() != TYPE_WIFI && |
1384 network->type() != TYPE_VPN) { | 1389 network->type() != TYPE_VPN) { |
1385 LOG(WARNING) << "Tried to parse a ClientCertPattern from something " | 1390 LOG(WARNING) << "Tried to parse a ClientCertPattern from something " |
1386 << "that wasn't a WiFi or VPN network."; | 1391 << "that wasn't a WiFi or VPN network."; |
1387 return false; | 1392 return false; |
1388 } | 1393 } |
1389 | 1394 |
| 1395 |
1390 switch (index) { | 1396 switch (index) { |
1391 case PROPERTY_INDEX_ONC_CERTIFICATE_PATTERN_ENROLLMENT_URI: { | 1397 case PROPERTY_INDEX_ONC_CERTIFICATE_PATTERN_ENROLLMENT_URI: { |
1392 std::vector<std::string> resulting_list; | 1398 std::vector<std::string> resulting_list; |
1393 if (!GetAsListOfStrings(value, &resulting_list)) | 1399 if (!GetAsListOfStrings(value, &resulting_list)) |
1394 return false; | 1400 return false; |
1395 CertificatePattern pattern = network->client_cert_pattern(); | 1401 CertificatePattern pattern = network->client_cert_pattern(); |
1396 pattern.set_enrollment_uri_list(resulting_list); | 1402 pattern.set_enrollment_uri_list(resulting_list); |
1397 network->set_client_cert_pattern(pattern); | 1403 network->set_client_cert_pattern(pattern); |
1398 return true; | 1404 return true; |
1399 } | 1405 } |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2024 // on the value of AuthenticationType. | 2030 // on the value of AuthenticationType. |
2025 { "L2TP-IPsec", PROVIDER_TYPE_L2TP_IPSEC_PSK }, | 2031 { "L2TP-IPsec", PROVIDER_TYPE_L2TP_IPSEC_PSK }, |
2026 { "OpenVPN", PROVIDER_TYPE_OPEN_VPN }, | 2032 { "OpenVPN", PROVIDER_TYPE_OPEN_VPN }, |
2027 }; | 2033 }; |
2028 CR_DEFINE_STATIC_LOCAL(EnumMapper<ProviderType>, parser, | 2034 CR_DEFINE_STATIC_LOCAL(EnumMapper<ProviderType>, parser, |
2029 (table, arraysize(table), PROVIDER_TYPE_MAX)); | 2035 (table, arraysize(table), PROVIDER_TYPE_MAX)); |
2030 return parser.Get(type); | 2036 return parser.Get(type); |
2031 } | 2037 } |
2032 | 2038 |
2033 } // namespace chromeos | 2039 } // namespace chromeos |
OLD | NEW |