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

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

Issue 22837002: Fix error in Shill to ONC translation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chromeos/network/onc/onc_translator_unittest.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/onc/onc_translator.h" 5 #include "chromeos/network/onc/onc_translator.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 scoped_ptr<base::ListValue> certKUs(new base::ListValue); 123 scoped_ptr<base::ListValue> certKUs(new base::ListValue);
124 certKUs->AppendString(certKU); 124 certKUs->AppendString(certKU);
125 onc_object_->SetWithoutPathExpansion(openvpn::kRemoteCertKU, 125 onc_object_->SetWithoutPathExpansion(openvpn::kRemoteCertKU,
126 certKUs.release()); 126 certKUs.release());
127 } 127 }
128 128
129 for (const OncFieldSignature* field_signature = onc_signature_->fields; 129 for (const OncFieldSignature* field_signature = onc_signature_->fields;
130 field_signature->onc_field_name != NULL; ++field_signature) { 130 field_signature->onc_field_name != NULL; ++field_signature) {
131 const std::string& onc_field_name = field_signature->onc_field_name; 131 const std::string& onc_field_name = field_signature->onc_field_name;
132 if (onc_field_name == vpn::kSaveCredentials || 132 if (onc_field_name == vpn::kSaveCredentials ||
133 onc_field_name == openvpn::kRemoteCertKU) { 133 onc_field_name == openvpn::kRemoteCertKU ||
134 onc_field_name == openvpn::kServerCAPEMs) {
134 CopyProperty(field_signature); 135 CopyProperty(field_signature);
135 continue; 136 continue;
136 } 137 }
137 138
138 std::string shill_property_name; 139 std::string shill_property_name;
139 const base::Value* shill_value = NULL; 140 const base::Value* shill_value = NULL;
140 if (!field_translation_table_ || 141 if (!field_translation_table_ ||
141 !GetShillPropertyName(field_signature->onc_field_name, 142 !GetShillPropertyName(field_signature->onc_field_name,
142 field_translation_table_, 143 field_translation_table_,
143 &shill_property_name) || 144 &shill_property_name) ||
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 const base::DictionaryValue& shill_dictionary, 306 const base::DictionaryValue& shill_dictionary,
306 const OncValueSignature* onc_signature) { 307 const OncValueSignature* onc_signature) {
307 CHECK(onc_signature != NULL); 308 CHECK(onc_signature != NULL);
308 309
309 ShillToONCTranslator translator(shill_dictionary, *onc_signature); 310 ShillToONCTranslator translator(shill_dictionary, *onc_signature);
310 return translator.CreateTranslatedONCObject(); 311 return translator.CreateTranslatedONCObject();
311 } 312 }
312 313
313 } // namespace onc 314 } // namespace onc
314 } // namespace chromeos 315 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/network/onc/onc_translator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698