| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/install_signer.h" | 5 #include "chrome/browser/extensions/install_signer.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 scoped_ptr<crypto::SecureHash> hash( | 109 scoped_ptr<crypto::SecureHash> hash( |
| 110 crypto::SecureHash::Create(crypto::SecureHash::SHA256)); | 110 crypto::SecureHash::Create(crypto::SecureHash::SHA256)); |
| 111 | 111 |
| 112 hash->Update(machine_id.data(), machine_id.size()); | 112 hash->Update(machine_id.data(), machine_id.size()); |
| 113 hash->Update(salt.data(), salt.size()); | 113 hash->Update(salt.data(), salt.size()); |
| 114 | 114 |
| 115 std::string result_bytes(crypto::kSHA256Length, 0); | 115 std::string result_bytes(crypto::kSHA256Length, 0); |
| 116 hash->Finish(string_as_array(&result_bytes), result_bytes.size()); | 116 hash->Finish(string_as_array(&result_bytes), result_bytes.size()); |
| 117 | 117 |
| 118 base::Base64Encode(result_bytes, result); | 118 return base::Base64Encode(result_bytes, result); |
| 119 return true; | |
| 120 } | 119 } |
| 121 | 120 |
| 122 } // namespace | 121 } // namespace |
| 123 | 122 |
| 124 namespace extensions { | 123 namespace extensions { |
| 125 | 124 |
| 126 InstallSignature::InstallSignature() { | 125 InstallSignature::InstallSignature() { |
| 127 } | 126 } |
| 128 InstallSignature::~InstallSignature() { | 127 InstallSignature::~InstallSignature() { |
| 129 } | 128 } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 result->expire_date = expire_date; | 283 result->expire_date = expire_date; |
| 285 DCHECK(VerifySignature(*result)); | 284 DCHECK(VerifySignature(*result)); |
| 286 } | 285 } |
| 287 | 286 |
| 288 if (!callback_.is_null()) | 287 if (!callback_.is_null()) |
| 289 callback_.Run(result.Pass()); | 288 callback_.Run(result.Pass()); |
| 290 } | 289 } |
| 291 | 290 |
| 292 | 291 |
| 293 } // namespace extensions | 292 } // namespace extensions |
| OLD | NEW |