OLD | NEW |
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS 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 <openssl/bio.h> | 5 #include <openssl/bio.h> |
6 #include <openssl/buffer.h> | 6 #include <openssl/buffer.h> |
7 #include <openssl/evp.h> | 7 #include <openssl/evp.h> |
8 #include "chromeos/obsolete_logging.h" | 8 #include "base/logging.h" |
9 #include "update_engine/omaha_hash_calculator.h" | 9 #include "update_engine/omaha_hash_calculator.h" |
10 | 10 |
11 namespace chromeos_update_engine { | 11 namespace chromeos_update_engine { |
12 | 12 |
13 OmahaHashCalculator::OmahaHashCalculator() { | 13 OmahaHashCalculator::OmahaHashCalculator() { |
14 CHECK_EQ(SHA1_Init(&ctx_), 1); | 14 CHECK_EQ(SHA1_Init(&ctx_), 1); |
15 } | 15 } |
16 | 16 |
17 // Update is called with all of the data that should be hashed in order. | 17 // Update is called with all of the data that should be hashed in order. |
18 // Mostly just passes the data through to OpenSSL's SHA1_Update() | 18 // Mostly just passes the data through to OpenSSL's SHA1_Update() |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 const std::string& str) { | 58 const std::string& str) { |
59 return OmahaHashOfBytes(str.data(), str.size()); | 59 return OmahaHashOfBytes(str.data(), str.size()); |
60 } | 60 } |
61 | 61 |
62 std::string OmahaHashCalculator::OmahaHashOfData( | 62 std::string OmahaHashCalculator::OmahaHashOfData( |
63 const std::vector<char>& data) { | 63 const std::vector<char>& data) { |
64 return OmahaHashOfBytes(&data[0], data.size()); | 64 return OmahaHashOfBytes(&data[0], data.size()); |
65 } | 65 } |
66 | 66 |
67 } // namespace chromeos_update_engine | 67 } // namespace chromeos_update_engine |
OLD | NEW |