Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/policy/cloud_policy_cache.h" | 5 #include "chrome/browser/policy/cloud_policy_cache.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 304 } | 304 } |
| 305 | 305 |
| 306 // static | 306 // static |
| 307 bool CloudPolicyCache::DecodePolicyResponse( | 307 bool CloudPolicyCache::DecodePolicyResponse( |
| 308 const em::PolicyFetchResponse& policy_response, | 308 const em::PolicyFetchResponse& policy_response, |
| 309 PolicyMap* mandatory, | 309 PolicyMap* mandatory, |
| 310 PolicyMap* recommended, | 310 PolicyMap* recommended, |
| 311 base::Time* timestamp) { | 311 base::Time* timestamp) { |
| 312 std::string data = policy_response.policy_data(); | 312 std::string data = policy_response.policy_data(); |
| 313 | 313 |
| 314 if (!VerifySignature(policy_response.policy_data_signature(), data, | 314 // Will do proper cleanup in my next CL. I promise. --jkummerow |
|
Jakob Kummerow
2011/03/23 18:13:58
See http://codereview.chromium.org/6705031
gfeher
2011/03/24 12:16:56
Please replace this whole block with a TODO. I thi
Jakob Kummerow
2011/03/24 16:09:52
If you insist -- done.
| |
| 315 policy_response.certificate_chain())) { | 315 //if (!VerifySignature(policy_response.policy_data_signature(), data, |
| 316 LOG(WARNING) << "Failed to verify signature."; | 316 // policy_response.certificate_chain())) { |
| 317 return false; | 317 // LOG(WARNING) << "Failed to verify signature."; |
| 318 } | 318 // return false; |
| 319 //} | |
| 319 | 320 |
| 320 em::PolicyData policy_data; | 321 em::PolicyData policy_data; |
| 321 if (!policy_data.ParseFromString(data)) { | 322 if (!policy_data.ParseFromString(data)) { |
| 322 LOG(WARNING) << "Failed to parse PolicyData protobuf."; | 323 LOG(WARNING) << "Failed to parse PolicyData protobuf."; |
| 323 return false; | 324 return false; |
| 324 } | 325 } |
| 325 | 326 |
| 326 // TODO(jkummerow): Verify policy_data.device_token(). Needs final | 327 // TODO(jkummerow): Verify policy_data.device_token(). Needs final |
| 327 // specification which token we're actually sending / expecting to get back. | 328 // specification which token we're actually sending / expecting to get back. |
| 328 | 329 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 459 CloudPolicyCache::DecodeValue(named_value->value()); | 460 CloudPolicyCache::DecodeValue(named_value->value()); |
| 460 if (decoded_value) | 461 if (decoded_value) |
| 461 result->Set(named_value->name(), decoded_value); | 462 result->Set(named_value->name(), decoded_value); |
| 462 } | 463 } |
| 463 } | 464 } |
| 464 } | 465 } |
| 465 return result; | 466 return result; |
| 466 } | 467 } |
| 467 | 468 |
| 468 } // namespace policy | 469 } // namespace policy |
| OLD | NEW |