bootstrap: Check code signing certificates (see #3824)

If either the bootstrap executable or the client dll is code signed
then both must be valid (all signatures) and signed with the same
primary certificate. This is a protection against mixing binaries
with different trust levels.
This commit is contained in:
Marshall Greenblatt
2025-05-19 16:56:36 -04:00
parent 4ceedd7f43
commit ce365d4987
8 changed files with 326 additions and 27 deletions

View File

@@ -43,8 +43,11 @@ std::wstring GetValidatedModuleValue(const base::CommandLine& command_line,
// Returns the default module name (executable name without extension).
std::wstring GetDefaultModuleValue(const base::FilePath& exe_path);
// Returns true if loading |module| is allowed.
bool IsModulePathAllowed(HMODULE module, const base::FilePath& exe_path);
// Returns true if loading |module_path| is allowed.
bool IsModulePathAllowed(const base::FilePath& module_path,
const base::FilePath& exe_path);
std::wstring GetLastErrorAsString();
} // namespace bootstrap_util