Windows: Use default hash in the options of hidden volume protection

This commit is contained in:
Mounir IDRASSI 2015-02-25 08:56:33 +01:00
parent b2020c9fb7
commit a916135f3c

View File

@ -2329,6 +2329,9 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
if (lw == IDC_MOUNT_OPTIONS) if (lw == IDC_MOUNT_OPTIONS)
{ {
/* Use default PRF specified by the user if any */
if (mountOptions.ProtectedHidVolPkcs5Prf == 0)
mountOptions.ProtectedHidVolPkcs5Prf = *pkcs5;
DialogBoxParamW (hInst, DialogBoxParamW (hInst,
MAKEINTRESOURCEW (IDD_MOUNT_OPTIONS), hwndDlg, MAKEINTRESOURCEW (IDD_MOUNT_OPTIONS), hwndDlg,
(DLGPROC) MountOptionsDlgProc, (LPARAM) &mountOptions); (DLGPROC) MountOptionsDlgProc, (LPARAM) &mountOptions);
@ -6013,6 +6016,14 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (GetAsyncKeyState (VK_CONTROL) < 0) if (GetAsyncKeyState (VK_CONTROL) < 0)
{ {
/* Priority is given to command line parameters
* Default values used only when nothing specified in command line
*/
if (CmdVolumePkcs5 == 0)
mountOptions.ProtectedHidVolPkcs5Prf = DefaultVolumePkcs5;
else
mountOptions.ProtectedHidVolPkcs5Prf = CmdVolumePkcs5;
if (IDCANCEL == DialogBoxParamW (hInst, if (IDCANCEL == DialogBoxParamW (hInst,
MAKEINTRESOURCEW (IDD_MOUNT_OPTIONS), hwndDlg, MAKEINTRESOURCEW (IDD_MOUNT_OPTIONS), hwndDlg,
(DLGPROC) MountOptionsDlgProc, (LPARAM) &mountOptions)) (DLGPROC) MountOptionsDlgProc, (LPARAM) &mountOptions))
@ -7765,6 +7776,13 @@ BOOL MountFavoriteVolumes (BOOL systemFavorites, BOOL logOnMount, BOOL hotKeyMou
&& !favoriteVolumeToMount.Path.empty() && !favoriteVolumeToMount.Path.empty()
&& GetAsyncKeyState (VK_CONTROL) < 0) && GetAsyncKeyState (VK_CONTROL) < 0)
{ {
/* Priority is given to command line parameters
* Default values used only when nothing specified in command line
*/
if (CmdVolumePkcs5 == 0)
mountOptions.ProtectedHidVolPkcs5Prf = DefaultVolumePkcs5;
else
mountOptions.ProtectedHidVolPkcs5Prf = CmdVolumePkcs5;
if (DialogBoxParamW (hInst, MAKEINTRESOURCEW (IDD_MOUNT_OPTIONS), MainDlg, MountOptionsDlgProc, (LPARAM) &mountOptions) == IDCANCEL) if (DialogBoxParamW (hInst, MAKEINTRESOURCEW (IDD_MOUNT_OPTIONS), MainDlg, MountOptionsDlgProc, (LPARAM) &mountOptions) == IDCANCEL)
{ {
status = FALSE; status = FALSE;
@ -9214,6 +9232,13 @@ void MountSelectedVolume (HWND hwndDlg, BOOL mountWithOptions)
if (mountWithOptions || GetAsyncKeyState (VK_CONTROL) < 0) if (mountWithOptions || GetAsyncKeyState (VK_CONTROL) < 0)
{ {
/* Priority is given to command line parameters
* Default values used only when nothing specified in command line
*/
if (CmdVolumePkcs5 == 0)
mountOptions.ProtectedHidVolPkcs5Prf = DefaultVolumePkcs5;
else
mountOptions.ProtectedHidVolPkcs5Prf = CmdVolumePkcs5;
if (IDCANCEL == DialogBoxParamW (hInst, if (IDCANCEL == DialogBoxParamW (hInst,
MAKEINTRESOURCEW (IDD_MOUNT_OPTIONS), hwndDlg, MAKEINTRESOURCEW (IDD_MOUNT_OPTIONS), hwndDlg,
(DLGPROC) MountOptionsDlgProc, (LPARAM) &mountOptions)) (DLGPROC) MountOptionsDlgProc, (LPARAM) &mountOptions))