feat: Windows integrity check (#40504)

* Add Windows integrity check feature into Electron

Co-authored-by: Weiyun Dai <weiyun.chn@gmail.com>

* Add integrity checker header file to sources

Co-authored-by: Weiyun Dai <weiyun.chn@gmail.com>

* Moved integrity checker after checking command line args

Co-authored-by: Weiyun Dai <weiyun.chn@gmail.com>

* Revert previous Windows integrity check commits (2379a60, 331cf3c, a3c47ec)

Co-authored-by: guohaolay <guohaolay@gmail.com>

* Implement asar header integrity for Windows platform.

Co-authored-by: guohaolay <guohaolay@gmail.com>

* Fix Archive::RelativePath() on Windows platform.

Co-authored-by: guohaolay <guohaolay@gmail.com>

* Address comments.

* Address Windows integrity check PR comments.

* Update absl::optional to std::optional.

* Fix spelling.

---------

Co-authored-by: Weiyun Dai <weiyun.chn@gmail.com>
Co-authored-by: Weiyun Dai <weiyund@amazon.com>
Co-authored-by: Weiyun Dai <35878488+WeiyunD@users.noreply.github.com>
This commit is contained in:
Guo Hao (Andrew) Lay 2024-01-18 12:00:49 -08:00 committed by GitHub
parent 3dafb318a8
commit 135c542555
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 169 additions and 2 deletions

View file

@ -239,7 +239,7 @@ bool Archive::Init() {
return false;
}
#if BUILDFLAG(IS_MAC)
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
// Validate header signature if required and possible
if (electron::fuses::IsEmbeddedAsarIntegrityValidationEnabled() &&
RelativePath().has_value()) {
@ -276,7 +276,7 @@ bool Archive::Init() {
return true;
}
#if !BUILDFLAG(IS_MAC)
#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN)
std::optional<IntegrityPayload> Archive::HeaderIntegrity() const {
return std::nullopt;
}