VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format/Tcformat.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-13 02:40:45 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-15 01:09:16 +0200
commitc4d4ade9d00e65112b93640bd3a0eeb50279a202 (patch)
tree908ad47df55c646fd4e6fe751891b4d7438a1140 /src/Format/Tcformat.c
parentd12739389796a1b903665983a7b5be845ab2bb89 (diff)
downloadVeraCrypt-c4d4ade9d00e65112b93640bd3a0eeb50279a202.tar.gz
VeraCrypt-c4d4ade9d00e65112b93640bd3a0eeb50279a202.zip
Windows: Show only supported encryption algorithm in the system encryption wizard for MBR
Diffstat (limited to 'src/Format/Tcformat.c')
-rw-r--r--src/Format/Tcformat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index 186c1199..248898c3 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -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);