refactor: migrate hashing code to new upstream crypto::hash
API (#46237)
* refactor: migrate AsarFileValidator to crypto::hash This change migrates AsarFileValidator's uses of crypto::secure_hash to the new crypto::hash API, which has more memory safety and less heap allocations. Xref:6287609
* refactor: migrate ValidateIntegrityOrDie to crypto::hash This change migrates ValidateIntegrityOrDie's use of crypto::SHA256Hash to the new crypto::hash API, which has more memory safety and less heap allocations. Xref:6287609
This commit is contained in:
parent
bb0ddcad27
commit
c8d3184a95
3 changed files with 8 additions and 10 deletions
|
@ -5,9 +5,9 @@
|
|||
#ifndef ELECTRON_SHELL_BROWSER_NET_ASAR_ASAR_FILE_VALIDATOR_H_
|
||||
#define ELECTRON_SHELL_BROWSER_NET_ASAR_ASAR_FILE_VALIDATOR_H_
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
#include "crypto/secure_hash.h"
|
||||
#include "crypto/hash.h"
|
||||
#include "mojo/public/cpp/system/file_data_source.h"
|
||||
#include "mojo/public/cpp/system/filtered_data_source.h"
|
||||
#include "shell/common/asar/archive.h"
|
||||
|
@ -56,7 +56,7 @@ class AsarFileValidator : public mojo::FilteredDataSource::Filter {
|
|||
int max_block_;
|
||||
uint64_t current_hash_byte_count_ = 0U;
|
||||
uint64_t total_hash_byte_count_ = 0;
|
||||
std::unique_ptr<crypto::SecureHash> current_hash_;
|
||||
std::optional<crypto::hash::Hasher> current_hash_;
|
||||
};
|
||||
|
||||
} // namespace asar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue