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

Side by Side Diff: chromeos/network/onc/onc_validator.cc

Issue 1137633003: Add ONC property for EAP-GTC authentication (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add to onc_constants.h Created 5 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 unified diff | Download patch
« no previous file with comments | « chromeos/network/onc/onc_translation_tables.cc ('k') | components/onc/docs/onc_spec.html » ('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/onc/onc_validator.h" 5 #include "chromeos/network/onc/onc_validator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 873
874 bool all_required_exist = 874 bool all_required_exist =
875 RequireField(*result, kHost) && RequireField(*result, kPort); 875 RequireField(*result, kHost) && RequireField(*result, kPort);
876 876
877 return !error_on_missing_field_ || all_required_exist; 877 return !error_on_missing_field_ || all_required_exist;
878 } 878 }
879 879
880 bool Validator::ValidateEAP(base::DictionaryValue* result) { 880 bool Validator::ValidateEAP(base::DictionaryValue* result) {
881 using namespace ::onc::eap; 881 using namespace ::onc::eap;
882 882
883 const char* const kValidInnerValues[] = {kAutomatic, kMD5, kMSCHAPv2, kPAP}; 883 const char* const kValidInnerValues[] = {
884 kAutomatic, kGTC, kMD5, kMSCHAPv2, kPAP};
884 const std::vector<const char*> valid_inner_values( 885 const std::vector<const char*> valid_inner_values(
885 toVector(kValidInnerValues)); 886 toVector(kValidInnerValues));
886 const char* const kValidOuterValues[] = { 887 const char* const kValidOuterValues[] = {
887 kPEAP, kEAP_TLS, kEAP_TTLS, kLEAP, kEAP_SIM, kEAP_FAST, kEAP_AKA}; 888 kPEAP, kEAP_TLS, kEAP_TTLS, kLEAP, kEAP_SIM, kEAP_FAST, kEAP_AKA};
888 const std::vector<const char*> valid_outer_values( 889 const std::vector<const char*> valid_outer_values(
889 toVector(kValidOuterValues)); 890 toVector(kValidOuterValues));
890 891
891 if (FieldExistsAndHasNoValidValue(*result, kInner, valid_inner_values) || 892 if (FieldExistsAndHasNoValidValue(*result, kInner, valid_inner_values) ||
892 FieldExistsAndHasNoValidValue(*result, kOuter, valid_outer_values) || 893 FieldExistsAndHasNoValidValue(*result, kOuter, valid_outer_values) ||
893 FieldExistsAndIsEmpty(*result, kServerCARefs)) { 894 FieldExistsAndIsEmpty(*result, kServerCARefs)) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 } 952 }
952 953
953 std::string Validator::MessageHeader() { 954 std::string Validator::MessageHeader() {
954 std::string path = path_.empty() ? "toplevel" : JoinString(path_, "."); 955 std::string path = path_.empty() ? "toplevel" : JoinString(path_, ".");
955 std::string message = "At " + path + ": "; 956 std::string message = "At " + path + ": ";
956 return message; 957 return message;
957 } 958 }
958 959
959 } // namespace onc 960 } // namespace onc
960 } // namespace chromeos 961 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_translation_tables.cc ('k') | components/onc/docs/onc_spec.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698