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

Windows: Show only supported encryption algorithm in the system encryption wizard for MBR

This commit is contained in:
Mounir IDRASSI
2016-08-13 02:40:45 +02:00
parent d127393897
commit c4d4ade9d0
3 changed files with 29 additions and 15 deletions

View File

@@ -4060,6 +4060,9 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
{
int ea, hid;
wchar_t buf[100];
BOOL bIsGPT = FALSE;
if (SysEncInEffect ())
bIsGPT = BootEncObj->GetSystemDriveConfiguration().SystemPartition.IsGPT;
// Encryption algorithms
@@ -4072,7 +4075,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
for (ea = EAGetFirst (); ea != 0; ea = EAGetNext (ea))
{
if (EAIsFormatEnabled (ea))
if (EAIsFormatEnabled (ea) && (!SysEncInEffect () || bIsGPT || EAIsMbrSysEncEnabled (ea)))
AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX), EAGetName (buf, ea, 1), ea);
}
@@ -4086,7 +4089,6 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (SysEncInEffect ())
{
BOOL bIsGPT = BootEncObj->GetSystemDriveConfiguration().SystemPartition.IsGPT;
hash_algo = bIsGPT? SHA512 : DEFAULT_HASH_ALGORITHM_BOOT;
RandSetHashFunction (hash_algo);