| OLD | NEW |
| 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 Loading... |
| 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(toplevel_config::kType, &onc_type) || |
| 72 onc_type != kEncryptedConfiguration) { | 72 onc_type != toplevel_config::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."); |
| 82 return scoped_ptr<base::DictionaryValue>(); | 82 return scoped_ptr<base::DictionaryValue>(); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |