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

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

Issue 11962048: This adds Cellular to the Shill to ONC translation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some semantics Created 7 years, 11 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
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_utils.h" 5 #include "chromeos/network/onc/onc_utils.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 std::string ciphertext; 61 std::string ciphertext;
62 62
63 if (!root.GetString(encrypted::kCiphertext, &ciphertext) || 63 if (!root.GetString(encrypted::kCiphertext, &ciphertext) ||
64 !root.GetString(encrypted::kCipher, &cipher) || 64 !root.GetString(encrypted::kCipher, &cipher) ||
65 !root.GetString(encrypted::kHMAC, &hmac) || 65 !root.GetString(encrypted::kHMAC, &hmac) ||
66 !root.GetString(encrypted::kHMACMethod, &hmac_method) || 66 !root.GetString(encrypted::kHMACMethod, &hmac_method) ||
67 !root.GetString(encrypted::kIV, &initial_vector) || 67 !root.GetString(encrypted::kIV, &initial_vector) ||
68 !root.GetInteger(encrypted::kIterations, &iterations) || 68 !root.GetInteger(encrypted::kIterations, &iterations) ||
69 !root.GetString(encrypted::kSalt, &salt) || 69 !root.GetString(encrypted::kSalt, &salt) ||
70 !root.GetString(encrypted::kStretch, &stretch_method) || 70 !root.GetString(encrypted::kStretch, &stretch_method) ||
71 !root.GetString(kType, &onc_type) || 71 !root.GetString(network_config::kType, &onc_type) ||
pneubeck (no reviews) 2013/01/18 10:27:41 toplevel_config::kType
Greg Spencer (Chromium) 2013/01/18 22:27:44 Done.
72 onc_type != kEncryptedConfiguration) { 72 onc_type != kEncryptedConfiguration) {
73 73
74 ONC_LOG_ERROR("Encrypted ONC malformed."); 74 ONC_LOG_ERROR("Encrypted ONC malformed.");
75 return scoped_ptr<base::DictionaryValue>(); 75 return scoped_ptr<base::DictionaryValue>();
76 } 76 }
77 77
78 if (hmac_method != encrypted::kSHA1 || 78 if (hmac_method != encrypted::kSHA1 ||
79 cipher != encrypted::kAES256 || 79 cipher != encrypted::kAES256 ||
80 stretch_method != encrypted::kPBKDF2) { 80 stretch_method != encrypted::kPBKDF2) {
81 ONC_LOG_ERROR("Encrypted ONC unsupported encryption scheme."); 81 ONC_LOG_ERROR("Encrypted ONC unsupported encryption scheme.");
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 const OncFieldSignature* field_signature = 210 const OncFieldSignature* field_signature =
211 GetFieldSignature(signature, *it); 211 GetFieldSignature(signature, *it);
212 212
213 ExpandStringsInOncObject(*field_signature->value_signature, 213 ExpandStringsInOncObject(*field_signature->value_signature,
214 substitution, inner_object); 214 substitution, inner_object);
215 } 215 }
216 } 216 }
217 217
218 } // namespace onc 218 } // namespace onc
219 } // namespace chromeos 219 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698