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

Side by Side Diff: chromeos/network/client_cert_util.cc

Issue 166063003: Check configuration for L2TP/IPsec+certificate VPN network with UIData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | chromeos/network/network_connection_handler.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 "chromeos/network/client_cert_util.h" 5 #include "chromeos/network/client_cert_util.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <pk11pub.h> 8 #include <pk11pub.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 const base::DictionaryValue* provider_properties = NULL; 252 const base::DictionaryValue* provider_properties = NULL;
253 service_properties.GetDictionaryWithoutPathExpansion( 253 service_properties.GetDictionaryWithoutPathExpansion(
254 shill::kProviderProperty, &provider_properties); 254 shill::kProviderProperty, &provider_properties);
255 switch (cert_config_type) { 255 switch (cert_config_type) {
256 case CONFIG_TYPE_NONE: 256 case CONFIG_TYPE_NONE:
257 return true; 257 return true;
258 case CONFIG_TYPE_OPENVPN: 258 case CONFIG_TYPE_OPENVPN:
259 // OpenVPN generally requires a passphrase and we don't know whether or 259 // OpenVPN generally requires a passphrase and we don't know whether or
260 // not one is required, so always return false here. 260 // not one is required, so always return false here.
261 return false; 261 return false;
262 case CONFIG_TYPE_IPSEC: 262 case CONFIG_TYPE_IPSEC: {
263 // IPSec may require a passphrase, so return false here also. 263 if (!provider_properties)
264 return false; 264 return false;
265
266 std::string client_cert_id;
267 provider_properties->GetStringWithoutPathExpansion(
268 shill::kL2tpIpsecClientCertIdProperty, &client_cert_id);
269 return !client_cert_id.empty();
270 }
265 case CONFIG_TYPE_EAP: { 271 case CONFIG_TYPE_EAP: {
266 std::string cert_id = GetStringFromDictionary( 272 std::string cert_id = GetStringFromDictionary(
267 service_properties, shill::kEapCertIdProperty); 273 service_properties, shill::kEapCertIdProperty);
268 std::string key_id = GetStringFromDictionary( 274 std::string key_id = GetStringFromDictionary(
269 service_properties, shill::kEapKeyIdProperty); 275 service_properties, shill::kEapKeyIdProperty);
270 std::string identity = GetStringFromDictionary( 276 std::string identity = GetStringFromDictionary(
271 service_properties, shill::kEapIdentityProperty); 277 service_properties, shill::kEapIdentityProperty);
272 return !cert_id.empty() && !key_id.empty() && !identity.empty(); 278 return !cert_id.empty() && !key_id.empty() && !identity.empty();
273 } 279 }
274 } 280 }
275 NOTREACHED(); 281 NOTREACHED();
276 return false; 282 return false;
277 } 283 }
278 284
279 } // namespace client_cert 285 } // namespace client_cert
280 286
281 } // namespace chromeos 287 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/network/network_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698