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

Unified Diff: chromeos/network/onc/onc_validator.cc

Issue 2891453002: Introduce networkingPrivate.getCertificateLists (Closed)
Patch Set: Clang format Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/onc/onc_translator_unittest.cc ('k') | chromeos/test/data/network/shill_wifi_eap_tls.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_validator.cc
diff --git a/chromeos/network/onc/onc_validator.cc b/chromeos/network/onc/onc_validator.cc
index d4fc4502f3c2a7bdd1082acf9055b329c18d76e3..3bb988a569c0727e555a10c692136d24759ef310 100644
--- a/chromeos/network/onc/onc_validator.cc
+++ b/chromeos/network/onc/onc_validator.cc
@@ -291,7 +291,7 @@ bool Validator::ValidateRecommendedField(
bool Validator::ValidateClientCertFields(bool allow_cert_type_none,
base::DictionaryValue* result) {
using namespace ::onc::client_cert;
- const char* const kValidCertTypes[] = {kRef, kPattern};
+ const char* const kValidCertTypes[] = {kRef, kPattern, kPKCS11Id};
std::vector<const char*> valid_cert_types(toVector(kValidCertTypes));
if (allow_cert_type_none)
valid_cert_types.push_back(kClientCertTypeNone);
@@ -307,6 +307,8 @@ bool Validator::ValidateClientCertFields(bool allow_cert_type_none,
all_required_exist &= RequireField(*result, kClientCertPattern);
else if (cert_type == kRef)
all_required_exist &= RequireField(*result, kClientCertRef);
+ else if (cert_type == kPKCS11Id)
+ all_required_exist &= RequireField(*result, kClientCertPKCS11Id);
return !error_on_missing_field_ || all_required_exist;
}
@@ -951,10 +953,8 @@ bool Validator::ValidateEAP(base::DictionaryValue* result) {
return false;
}
- if (!ValidateClientCertFields(false, // don't allow ClientCertType None
- result)) {
+ if (!ValidateClientCertFields(true /* allow ClientCertType None */, result))
return false;
- }
bool all_required_exist = RequireField(*result, kOuter);
« no previous file with comments | « chromeos/network/onc/onc_translator_unittest.cc ('k') | chromeos/test/data/network/shill_wifi_eap_tls.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698