mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
cefclient: win: Add code signing verification (see #3935)
Move code signing verification code to libcef_dll_wrapper and add example checks in cefclient. Load libcef.dll with code signing checks. Add a CefScopedLibraryLoader variant for Windows.
This commit is contained in:
@@ -11,6 +11,7 @@ namespace bootstrap_util {
|
||||
|
||||
namespace {
|
||||
|
||||
// Changes to these values require rebuilding libcef.dll.
|
||||
constexpr wchar_t kWindowsSelfName[] = TEXT("bootstrap");
|
||||
constexpr wchar_t kConsoleSelfName[] = TEXT("bootstrapc");
|
||||
|
||||
@@ -78,28 +79,4 @@ bool IsModulePathAllowed(const base::FilePath& module_path,
|
||||
return module_path.DirName() == exe_path.DirName();
|
||||
}
|
||||
|
||||
std::wstring GetLastErrorAsString() {
|
||||
std::wstring error_message;
|
||||
|
||||
DWORD error_message_id = ::GetLastError();
|
||||
if (error_message_id == 0) {
|
||||
return error_message;
|
||||
}
|
||||
|
||||
LPWSTR message_buffer = NULL;
|
||||
|
||||
DWORD size = FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL, error_message_id, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPWSTR)&message_buffer, 0, NULL);
|
||||
|
||||
if (message_buffer) {
|
||||
error_message = std::wstring(message_buffer, size);
|
||||
LocalFree(message_buffer);
|
||||
}
|
||||
|
||||
return error_message;
|
||||
}
|
||||
|
||||
} // namespace bootstrap_util
|
||||
|
Reference in New Issue
Block a user