1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-12 03:18:26 -06:00

Windows: Don't start EFI system encryption process if SecureBoot is enabled and VeraCrypt-DCS custom keys were not loaded in the machine firmware.

This commit is contained in:
Mounir IDRASSI
2018-04-23 12:56:02 +02:00
parent 42e7da2e8a
commit 4f0d1c02bd
12 changed files with 341 additions and 50 deletions

View File

@@ -13093,7 +13093,7 @@ BOOL GetFreeDriveLetter(WCHAR* pCh) {
return FALSE;
}
BOOL RaisePrivileges(void)
BOOL SetPrivilege(LPTSTR szPrivilegeName, BOOL bEnable)
{
HANDLE hToken;
TOKEN_PRIVILEGES tkp;
@@ -13104,15 +13104,13 @@ BOOL RaisePrivileges(void)
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
&hToken))
{
if (LookupPrivilegeValue(NULL, SE_SYSTEM_ENVIRONMENT_NAME,
if (LookupPrivilegeValue(NULL, szPrivilegeName,
&tkp.Privileges[0].Luid))
{
DWORD len;
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
tkp.Privileges[0].Attributes = bEnable? SE_PRIVILEGE_ENABLED : SE_PRIVILEGE_REMOVED;
bRet = AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, &len);
bRet = AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, NULL);
if (!bRet)
dwLastError = GetLastError ();
}