From 8d787dcd7128fce554f473da62e20162b0b6c9c4 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 28 Dec 2014 19:24:57 +0100 Subject: Windows: propose only hash algorithm that support system encryption when the user select the option to a partition as an encrypted system partition. --- src/Mount/Mount.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index f1864769..1d25473d 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -2163,6 +2163,25 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa SetCheckBox (hwndDlg, IDC_TRUECRYPT_MODE, FALSE); EnableWindow (GetDlgItem (hwndDlg, IDC_TRUECRYPT_MODE), FALSE); + /* Repopulate the PRF algorithms list with algorithms that support system encryption */ + HWND hComboBox = GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID); + SendMessage (hComboBox, CB_RESETCONTENT, 0, 0); + + int i, nIndex = SendMessageW (hComboBox, CB_ADDSTRING, 0, (LPARAM) GetString ("AUTODETECTION")); + SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) 0); + + for (i = FIRST_PRF_ID; i <= LAST_PRF_ID; i++) + { + if (HashForSystemEncryption(i)) + { + nIndex = SendMessage (hComboBox, CB_ADDSTRING, 0, (LPARAM) get_pkcs5_prf_name(i)); + SendMessage (hComboBox, CB_SETITEMDATA, nIndex, (LPARAM) i); + } + } + + /* make autodetection the default */ + SendMessage (hComboBox, CB_SETCURSEL, 0, 0); + ToBootPwdField (hwndDlg, IDC_PASSWORD); // Attempt to wipe the password stored in the input field buffer -- cgit v1.2.3