| 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 return base::Base64Encode(result_bytes, result); | 118 base::Base64Encode(result_bytes, result); |
| 119 return true; |
| 119 } | 120 } |
| 120 | 121 |
| 121 } // namespace | 122 } // namespace |
| 122 | 123 |
| 123 namespace extensions { | 124 namespace extensions { |
| 124 | 125 |
| 125 InstallSignature::InstallSignature() { | 126 InstallSignature::InstallSignature() { |
| 126 } | 127 } |
| 127 InstallSignature::~InstallSignature() { | 128 InstallSignature::~InstallSignature() { |
| 128 } | 129 } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 result->expire_date = expire_date; | 284 result->expire_date = expire_date; |
| 284 DCHECK(VerifySignature(*result)); | 285 DCHECK(VerifySignature(*result)); |
| 285 } | 286 } |
| 286 | 287 |
| 287 if (!callback_.is_null()) | 288 if (!callback_.is_null()) |
| 288 callback_.Run(result.Pass()); | 289 callback_.Run(result.Pass()); |
| 289 } | 290 } |
| 290 | 291 |
| 291 | 292 |
| 292 } // namespace extensions | 293 } // namespace extensions |
| OLD | NEW |