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

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 | no next file » | 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: {
stevenjb 2014/02/14 16:44:13 nit: if (!provider_properties) return false;
263 // IPSec may require a passphrase, so return false here also. 263 std::string client_cert_id;
264 return false; 264 if (provider_properties) {
265 provider_properties->GetStringWithoutPathExpansion(
266 shill::kL2tpIpsecClientCertIdProperty, &client_cert_id);
267 }
268 return !client_cert_id.empty();
269 }
265 case CONFIG_TYPE_EAP: { 270 case CONFIG_TYPE_EAP: {
266 std::string cert_id = GetStringFromDictionary( 271 std::string cert_id = GetStringFromDictionary(
267 service_properties, shill::kEapCertIdProperty); 272 service_properties, shill::kEapCertIdProperty);
268 std::string key_id = GetStringFromDictionary( 273 std::string key_id = GetStringFromDictionary(
269 service_properties, shill::kEapKeyIdProperty); 274 service_properties, shill::kEapKeyIdProperty);
270 std::string identity = GetStringFromDictionary( 275 std::string identity = GetStringFromDictionary(
271 service_properties, shill::kEapIdentityProperty); 276 service_properties, shill::kEapIdentityProperty);
272 return !cert_id.empty() && !key_id.empty() && !identity.empty(); 277 return !cert_id.empty() && !key_id.empty() && !identity.empty();
273 } 278 }
274 } 279 }
275 NOTREACHED(); 280 NOTREACHED();
276 return false; 281 return false;
277 } 282 }
278 283
279 } // namespace client_cert 284 } // namespace client_cert
280 285
281 } // namespace chromeos 286 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698