fix: deprecated API and -Wunsafe-buffer-usage warnings in AsarFileValidator (#44068)

* refactor: const correctness

* refactor: extract-method AsarFileValidator::EnsureHashExists()

* refactor: replace use of deprecated crypto API

https://crbug.com/364687923

* refactor: use span API in AsarFileValidator::OnRead()

* refactor: replace use of deprecated crypto API

https://crbug.com/364687923

* fixup! refactor: use span API in AsarFileValidator::OnRead()

fix: electron-ia32-testing FTBFS
This commit is contained in:
Charles Kerr 2024-10-02 15:44:28 -05:00 committed by GitHub
parent 9df092e034
commit 684e345f68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 48 additions and 48 deletions

View file

@ -36,6 +36,8 @@ class AsarFileValidator : public mojo::FilteredDataSource::Filter {
bool FinishBlock();
private:
void EnsureBlockHashExists();
base::File file_;
IntegrityPayload integrity_;
@ -52,7 +54,7 @@ class AsarFileValidator : public mojo::FilteredDataSource::Filter {
bool done_reading_ = false;
int current_block_;
int max_block_;
uint64_t current_hash_byte_count_ = 0;
uint64_t current_hash_byte_count_ = 0U;
uint64_t total_hash_byte_count_ = 0;
std::unique_ptr<crypto::SecureHash> current_hash_;
};