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

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

Issue 1717123002: Allow ${CERT_SAN_EMAIL} and ${CERT_SAN_UPN} in the ONC Identity field (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporate code review feedback Created 4 years, 9 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
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 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 23 matching lines...) Expand all
34 std::string GetStringFromDictionary(const base::DictionaryValue& dict, 34 std::string GetStringFromDictionary(const base::DictionaryValue& dict,
35 const std::string& key) { 35 const std::string& key) {
36 std::string s; 36 std::string s;
37 dict.GetStringWithoutPathExpansion(key, &s); 37 dict.GetStringWithoutPathExpansion(key, &s);
38 return s; 38 return s;
39 } 39 }
40 40
41 void GetClientCertTypeAndPattern( 41 void GetClientCertTypeAndPattern(
42 const base::DictionaryValue& dict_with_client_cert, 42 const base::DictionaryValue& dict_with_client_cert,
43 ClientCertConfig* cert_config) { 43 ClientCertConfig* cert_config) {
44 dict_with_client_cert.GetStringWithoutPathExpansion(
45 ::onc::eap::kIdentity, &cert_config->policy_identity);
46
44 using namespace ::onc::client_cert; 47 using namespace ::onc::client_cert;
45 dict_with_client_cert.GetStringWithoutPathExpansion( 48 dict_with_client_cert.GetStringWithoutPathExpansion(
46 kClientCertType, &cert_config->client_cert_type); 49 kClientCertType, &cert_config->client_cert_type);
47 50
48 if (cert_config->client_cert_type == kPattern) { 51 if (cert_config->client_cert_type == kPattern) {
49 const base::DictionaryValue* pattern = NULL; 52 const base::DictionaryValue* pattern = NULL;
50 dict_with_client_cert.GetDictionaryWithoutPathExpansion(kClientCertPattern, 53 dict_with_client_cert.GetDictionaryWithoutPathExpansion(kClientCertPattern,
51 &pattern); 54 &pattern);
52 if (pattern) { 55 if (pattern) {
53 bool success = cert_config->pattern.ReadFromONCDictionary(*pattern); 56 bool success = cert_config->pattern.ReadFromONCDictionary(*pattern);
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return !cert_id.empty() && !key_id.empty() && !identity.empty(); 351 return !cert_id.empty() && !key_id.empty() && !identity.empty();
349 } 352 }
350 } 353 }
351 NOTREACHED(); 354 NOTREACHED();
352 return false; 355 return false;
353 } 356 }
354 357
355 } // namespace client_cert 358 } // namespace client_cert
356 359
357 } // namespace chromeos 360 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698