diff options
Diffstat (limited to 'src/Mount')
-rw-r--r-- | src/Mount/Favorites.cpp | 23 | ||||
-rw-r--r-- | src/Mount/Favorites.h | 2 | ||||
-rw-r--r-- | src/Mount/Mount.c | 111 | ||||
-rw-r--r-- | src/Mount/Mount.rc | 33 |
4 files changed, 133 insertions, 36 deletions
diff --git a/src/Mount/Favorites.cpp b/src/Mount/Favorites.cpp index a1a469bc..6fe871a0 100644 --- a/src/Mount/Favorites.cpp +++ b/src/Mount/Favorites.cpp @@ -12,8 +12,9 @@ #include "BootEncryption.h"
#include "Dlgcode.h"
#include "Language.h"
#include "Mount.h"
+#include "Common/Resource.h"
#include "Resource.h"
#include "Xml.h"
#include "Favorites.h"
@@ -85,8 +86,9 @@ namespace VeraCrypt favorite.ReadOnly = prop.readOnly ? true : false;
favorite.Removable = prop.removable ? true : false;
favorite.SystemEncryption = prop.partitionInInactiveSysEncScope ? true : false;
favorite.OpenExplorerWindow = (bExplore == TRUE);
+ favorite.Pin = prop.volumePin;
if (favorite.VolumePathId.empty()
&& IsVolumeDeviceHosted (favorite.Path.c_str())
&& favorite.Path.find ("\\\\?\\Volume{") != 0)
@@ -546,8 +548,13 @@ namespace VeraCrypt char label[1024];
XmlGetAttributeText (xml, "label", label, sizeof (label));
favorite.Label = Utf8StringToWide (label);
+ XmlGetAttributeText (xml, "pin", label, sizeof (label));
+ favorite.Pin = strtol (label, NULL, 10);
+ if (favorite.Pin < 0)
+ favorite.Pin = 0;
+
char boolVal[2];
XmlGetAttributeText (xml, "readonly", boolVal, sizeof (boolVal));
if (boolVal[0])
favorite.ReadOnly = (boolVal[0] == '1');
@@ -675,8 +682,11 @@ namespace VeraCrypt if (!favorite.Label.empty())
s += L" label=\"" + favorite.Label + L"\"";
+ if (favorite.Pin > 0)
+ s += L" pin=\"" + IntToWideString(favorite.Pin) + L"\"";
+
if (favorite.ReadOnly)
s += L" readonly=\"1\"";
if (favorite.Removable)
@@ -762,8 +772,16 @@ namespace VeraCrypt static void SetControls (HWND hwndDlg, const FavoriteVolume &favorite, bool systemFavoritesMode, bool enable)
{
+ if (favorite.Pin > 0)
+ {
+ char szTmp[MAX_PIN + 1];
+ StringCbPrintfA (szTmp, sizeof(szTmp), "%d", favorite.Pin);
+ SetDlgItemText (hwndDlg, IDC_PIN, szTmp);
+ }
+ else
+ SetDlgItemText (hwndDlg, IDC_PIN, "");
SetDlgItemTextW (hwndDlg, IDC_FAVORITE_LABEL, favorite.Label.c_str());
SetCheckBox (hwndDlg, IDC_FAVORITE_MOUNT_ON_LOGON, favorite.MountOnLogOn);
SetCheckBox (hwndDlg, IDC_FAVORITE_MOUNT_ON_ARRIVAL, favorite.MountOnArrival);
SetCheckBox (hwndDlg, IDC_FAVORITE_MOUNT_READONLY, favorite.ReadOnly);
@@ -787,8 +805,11 @@ namespace VeraCrypt EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_MOVE_UP), enable);
EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_MOVE_DOWN), enable);
EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_REMOVE), enable);
+ EnableWindow (GetDlgItem (hwndDlg, IDT_PIN), enable);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN), enable);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN_HELP), enable);
EnableWindow (GetDlgItem (hwndDlg, IDT_FAVORITE_LABEL), enable);
EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_LABEL), enable);
EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_MOUNT_ON_LOGON), enable && !systemFavoritesMode);
EnableWindow (GetDlgItem (hwndDlg, IDC_FAVORITE_MOUNT_ON_ARRIVAL), enable && !systemFavoritesMode);
@@ -814,8 +835,10 @@ namespace VeraCrypt }
else
favorite.Label.clear();
+ favorite.Pin = GetPin (hwndDlg, IDC_PIN);
+
favorite.ReadOnly = (IsDlgButtonChecked (hwndDlg, IDC_FAVORITE_MOUNT_READONLY) != 0);
favorite.Removable = (IsDlgButtonChecked (hwndDlg, IDC_FAVORITE_MOUNT_REMOVABLE) != 0);
if (!systemFavoritesMode)
diff --git a/src/Mount/Favorites.h b/src/Mount/Favorites.h index f91905d8..3a0a771b 100644 --- a/src/Mount/Favorites.h +++ b/src/Mount/Favorites.h @@ -16,8 +16,9 @@ namespace VeraCrypt struct FavoriteVolume
{
FavoriteVolume()
:
+ Pin (0),
DisableHotkeyMount (false),
DisconnectedDevice (false),
MountOnLogOn (false),
MountOnArrival (false),
@@ -31,8 +32,9 @@ namespace VeraCrypt string Path;
string MountPoint;
string VolumePathId;
wstring Label;
+ int Pin;
bool DisableHotkeyMount;
bool DisconnectedDevice;
bool MountOnLogOn;
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index df9ecb58..ba3ee861 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -1784,8 +1784,9 @@ void CALLBACK RestoreHeaderWaitThreadProc(void* pArg, HWND hwndDlg) not. - see DialogProc */
BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
static KeyFilesDlgParam newKeyFilesParam;
+ static BOOL PinValueChangedWarning = FALSE;
WORD lw = LOWORD (wParam);
WORD hw = HIWORD (wParam);
@@ -1797,16 +1798,20 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR HWND hComboBox = GetDlgItem (hwndDlg, IDC_PKCS5_OLD_PRF_ID);
int i;
WipeAlgorithmId headerWipeMode = TC_WIPE_3_DOD_5220;
+ PinValueChangedWarning = FALSE;
+
ZeroMemory (&newKeyFilesParam, sizeof (newKeyFilesParam));
SetWindowTextW (hwndDlg, GetString ("IDD_PASSWORDCHANGE_DLG"));
LocalizeDialog (hwndDlg, "IDD_PASSWORDCHANGE_DLG");
SendMessage (GetDlgItem (hwndDlg, IDC_OLD_PASSWORD), EM_LIMITTEXT, MAX_PASSWORD, 0);
SendMessage (GetDlgItem (hwndDlg, IDC_PASSWORD), EM_LIMITTEXT, MAX_PASSWORD, 0);
SendMessage (GetDlgItem (hwndDlg, IDC_VERIFY), EM_LIMITTEXT, MAX_PASSWORD, 0);
+ SendMessage (GetDlgItem (hwndDlg, IDC_OLD_PIN), EM_LIMITTEXT, MAX_PIN, 0);
+ SendMessage (GetDlgItem (hwndDlg, IDC_PIN), EM_LIMITTEXT, MAX_PIN, 0);
EnableWindow (GetDlgItem (hwndDlg, IDOK), FALSE);
SetCheckBox (hwndDlg, IDC_ENABLE_KEYFILES, KeyFilesEnable);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES), TRUE);
@@ -1853,9 +1858,11 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SetWindowTextW (hwndDlg, GetString ("IDD_PCDM_CHANGE_PKCS5_PRF"));
LocalizeDialog (hwndDlg, "IDD_PCDM_CHANGE_PKCS5_PRF");
EnableWindow (GetDlgItem (hwndDlg, IDC_PASSWORD), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_VERIFY), FALSE);
+ EnableWindow (GetDlgItem (hwndDlg, IDT_PIN), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIN), FALSE);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN_HELP), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_ENABLE_NEW_KEYFILES), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_NEW), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_NEW_KEYFILES), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PASSWORD), FALSE);
@@ -1867,9 +1874,11 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR LocalizeDialog (hwndDlg, "IDD_PCDM_ADD_REMOVE_VOL_KEYFILES");
newKeyFilesParam.EnableKeyFiles = TRUE;
EnableWindow (GetDlgItem (hwndDlg, IDC_PASSWORD), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_VERIFY), FALSE);
+ EnableWindow (GetDlgItem (hwndDlg, IDT_PIN), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIN), FALSE);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN_HELP), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_NEW), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PASSWORD), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_CONFIRM_PASSWORD), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_PKCS5_PRF), FALSE);
@@ -1885,9 +1894,11 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES), TRUE);
EnableWindow (GetDlgItem (hwndDlg, IDC_ENABLE_KEYFILES), TRUE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PASSWORD), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_VERIFY), FALSE);
+ EnableWindow (GetDlgItem (hwndDlg, IDT_PIN), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_PIN), FALSE);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN_HELP), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_ENABLE_NEW_KEYFILES), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_SHOW_PASSWORD_CHPWD_NEW), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_NEW_KEYFILES), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDT_NEW_PASSWORD), FALSE);
@@ -2017,8 +2028,22 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return 1;
}
return 0;
+ case WM_CTLCOLORSTATIC:
+ {
+ if (PinValueChangedWarning && ((HWND)lParam == GetDlgItem(hwndDlg, IDC_PIN_HELP)) )
+ {
+ // we're about to draw the static
+ // set the text colour in (HDC)lParam
+ SetBkMode((HDC)wParam,TRANSPARENT);
+ SetTextColor((HDC)wParam, RGB(255,0,0));
+ // NOTE: per documentation as pointed out by selbie, GetSolidBrush would leak a GDI handle.
+ return (BOOL)GetSysColorBrush(COLOR_MENU);
+ }
+ }
+ return 0;
+
case WM_COMMAND:
if (lw == IDCANCEL)
{
// Attempt to wipe passwords stored in the input field buffers
@@ -2039,9 +2064,30 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR PasswordChangeEnable (hwndDlg, IDOK,
IDC_OLD_PASSWORD,
KeyFilesEnable && FirstKeyFile != NULL,
IDC_PASSWORD, IDC_VERIFY,
- newKeyFilesParam.EnableKeyFiles && newKeyFilesParam.FirstKeyFile != NULL);
+ newKeyFilesParam.EnableKeyFiles && newKeyFilesParam.FirstKeyFile != NULL);
+
+ if ((lw == IDC_OLD_PIN) && IsWindowEnabled (GetDlgItem (hwndDlg, IDC_PIN)))
+ {
+ char tmp[MAX_PIN+1] = {0};
+ GetDlgItemText (hwndDlg, IDC_OLD_PIN, tmp, MAX_PIN + 1);
+ SetDlgItemText (hwndDlg, IDC_PIN, tmp);
+ }
+
+ if (lw == IDC_PIN)
+ {
+ if(GetPin (hwndDlg, IDC_OLD_PIN) != GetPin (hwndDlg, IDC_PIN))
+ {
+ PinValueChangedWarning = TRUE;
+ SetDlgItemTextW (hwndDlg, IDC_PIN_HELP, GetString (bSysEncPwdChangeDlgMode? "PIN_SYSENC_CHANGE_WARNING" : "PIN_CHANGE_WARNING"));
+ }
+ else
+ {
+ PinValueChangedWarning = FALSE;
+ SetDlgItemTextW (hwndDlg, IDC_PIN_HELP, (wchar_t *) GetDictionaryValueByInt (IDC_PIN_HELP));
+ }
+ }
return 1;
}
@@ -2153,8 +2199,16 @@ BOOL CALLBACK PasswordChangeDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return 1;
}
+ if (lw == IDC_TRUECRYPT_MODE)
+ {
+ BOOL bEnablePin = GetCheckBox (hwndDlg, IDC_TRUECRYPT_MODE) ? FALSE: TRUE;
+ EnableWindow (GetDlgItem (hwndDlg, IDT_OLD_PIN), bEnablePin);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_OLD_PIN), bEnablePin);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_OLD_PIN_HELP), bEnablePin);
+ }
+
if (lw == IDC_SHOW_PASSWORD_CHPWD_ORI)
{
SendMessage (GetDlgItem (hwndDlg, IDC_OLD_PASSWORD),
EM_SETPASSWORDCHAR,
@@ -2566,8 +2620,16 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa InvalidateRect (GetDlgItem (hwndDlg, IDC_PASSWORD), NULL, TRUE);
return 1;
}
+ if (lw == IDC_TRUECRYPT_MODE)
+ {
+ BOOL bEnablePin = GetCheckBox (hwndDlg, IDC_TRUECRYPT_MODE) ? FALSE: TRUE;
+ EnableWindow (GetDlgItem (hwndDlg, IDT_PIN), bEnablePin);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN), bEnablePin);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN_HELP), bEnablePin);
+ }
+
if (lw == IDC_KEY_FILES)
{
KeyFilesDlgParam param;
param.EnableKeyFiles = KeyFilesEnable;
@@ -2608,13 +2670,9 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa bCacheInDriver = IsButtonChecked (GetDlgItem (hwndDlg, IDC_CACHE));
*pkcs5 = (int) SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETITEMDATA, SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETCURSEL, 0, 0), 0);
*truecryptMode = GetCheckBox (hwndDlg, IDC_TRUECRYPT_MODE);
- GetWindowText (GetDlgItem (hwndDlg, IDC_PIN), tmp, MAX_PIN + 1);
- if (strlen(tmp))
- *pin = (int) strtol(tmp, NULL, 10); /* IDC_PIN is configured to accept only numbers */
- else
- *pin = 0;
+ *pin = GetPin (hwndDlg, IDC_PIN);
/* SHA-256 is not supported by TrueCrypt */
if ( (*truecryptMode)
&& ((*pkcs5 == SHA256) || (mountOptions.ProtectHiddenVolume && mountOptions.ProtectedHidVolPkcs5Prf == SHA256))
@@ -3442,9 +3500,15 @@ BOOL CALLBACK VolumePropertiesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP ListSubItemSet (list, i++, 1, EAGetModeName (prop.ea, prop.mode, TRUE));
// PKCS 5 PRF
ListItemAddW (list, i, GetString ("PKCS5_PRF"));
- ListSubItemSet (list, i++, 1, get_pkcs5_prf_name (prop.pkcs5));
+ if (prop.volumePin == 0)
+ ListSubItemSet (list, i++, 1, get_pkcs5_prf_name (prop.pkcs5));
+ else
+ {
+ StringCbPrintfA (szTmp, sizeof(szTmp), "%s (Dynamic)", get_pkcs5_prf_name (prop.pkcs5));
+ ListSubItemSet (list, i++, 1, szTmp);
+ }
#if 0
// PCKS 5 iterations
ListItemAddW (list, i, GetString ("PKCS5_ITERATIONS"));
@@ -3965,14 +4029,15 @@ static int AskVolumePassword (HWND hwndDlg, Password *password, int *pkcs5, int }
// GUI actions
-static BOOL Mount (HWND hwndDlg, int nDosDriveNo, char *szFileName)
+static BOOL Mount (HWND hwndDlg, int nDosDriveNo, char *szFileName, int pin)
{
BOOL status = FALSE;
char fileName[MAX_PATH];
int mounted = 0, EffectiveVolumePkcs5 = CmdVolumePkcs5;
BOOL EffectiveVolumeTrueCryptMode = CmdVolumeTrueCryptMode;
+ int EffectiveVolumePin = (pin < 0)? CmdVolumePin : pin;
/* Priority is given to command line parameters
* Default values used only when nothing specified in command line
*/
@@ -4026,35 +4091,38 @@ static BOOL Mount (HWND hwndDlg, int nDosDriveNo, char *szFileName) // First try cached passwords and if they fail ask user for a new one
WaitCursor ();
- // try TrueCrypt mode first since it is quick
- mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, NULL, 0, 0, TRUE, bCacheInDriver, bForceMount, &mountOptions, Silent, FALSE);
+ // try TrueCrypt mode first since it is quick, only if pin = 0
+ if (EffectiveVolumePin == 0)
+ mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, NULL, 0, 0, TRUE, bCacheInDriver, bForceMount, &mountOptions, Silent, FALSE);
if (!mounted)
- mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, NULL, 0, 0, FALSE, bCacheInDriver, bForceMount, &mountOptions, Silent, FALSE);
+ mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, NULL, 0, EffectiveVolumePin, FALSE, bCacheInDriver, bForceMount, &mountOptions, Silent, FALSE);
// If keyfiles are enabled, test empty password first
if (!mounted && KeyFilesEnable && FirstKeyFile)
{
Password emptyPassword;
emptyPassword.Length = 0;
KeyFilesApply (hwndDlg, &emptyPassword, FirstKeyFile);
- // try TrueCrypt mode first since it is quick
- mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, &emptyPassword, 0, 0, TRUE, bCacheInDriver, bForceMount, &mountOptions, Silent, FALSE);
+ // try TrueCrypt mode first since it is quick, only if pin = 0
+ if (EffectiveVolumePin == 0)
+ mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, &emptyPassword, 0, 0, TRUE, bCacheInDriver, bForceMount, &mountOptions, Silent, FALSE);
if (!mounted)
- mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, &emptyPassword, 0, 0, FALSE, bCacheInDriver, bForceMount, &mountOptions, Silent, FALSE);
+ mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, &emptyPassword, 0, EffectiveVolumePin, FALSE, bCacheInDriver, bForceMount, &mountOptions, Silent, FALSE);
burn (&emptyPassword, sizeof (emptyPassword));
}
// Test password and/or keyfiles used for the previous volume
if (!mounted && bCacheDuringMultipleMount && MultipleMountOperationInProgress && VolumePassword.Length != 0)
{
- // try TrueCrypt mode first as it is quick
- mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, &VolumePassword, 0, 0, TRUE, bCacheInDriver, bForceMount, &mountOptions, Silent, FALSE);
+ // try TrueCrypt mode first as it is quick, only if pin = 0
+ if (EffectiveVolumePin == 0)
+ mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, &VolumePassword, 0, 0, TRUE, bCacheInDriver, bForceMount, &mountOptions, Silent, FALSE);
if (!mounted)
- mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, &VolumePassword, 0, 0, FALSE, bCacheInDriver, bForceMount, &mountOptions, Silent, FALSE);
+ mounted = MountVolume (hwndDlg, nDosDriveNo, szFileName, &VolumePassword, 0, EffectiveVolumePin, FALSE, bCacheInDriver, bForceMount, &mountOptions, Silent, FALSE);
}
NormalCursor ();
@@ -4072,15 +4140,15 @@ static BOOL Mount (HWND hwndDlg, int nDosDriveNo, char *szFileName) {
VolumePassword = CmdVolumePassword;
VolumePkcs5 = EffectiveVolumePkcs5;
VolumeTrueCryptMode = EffectiveVolumeTrueCryptMode;
- VolumePin = CmdVolumePin;
+ VolumePin = EffectiveVolumePin;
}
else if (!Silent)
{
int GuiPkcs5 = EffectiveVolumePkcs5;
BOOL GuiTrueCryptMode = EffectiveVolumeTrueCryptMode;
- int GuiPin = CmdVolumePin;
+ int GuiPin = EffectiveVolumePin;
StringCbCopyA (PasswordDlgVolume, sizeof(PasswordDlgVolume), szFileName);
if (!AskVolumePassword (hwndDlg, &VolumePassword, &GuiPkcs5, &GuiPin, &GuiTrueCryptMode, NULL, TRUE))
goto ret;
@@ -4205,9 +4273,9 @@ void __cdecl mountThreadFunction (void *hwndDlgArg) // Disable parent dialog during processing to avoid user interaction
EnableWindow(hwndDlg, FALSE);
finally_do_arg (HWND, hwndDlg, { EnableWindow(finally_arg, TRUE); });
- Mount (hwndDlg, 0, 0);
+ Mount (hwndDlg, 0, 0, -1);
}
static BOOL DismountAll (HWND hwndDlg, BOOL forceUnmount, BOOL interact, int dismountMaxRetries, int dismountAutoRetryDelay)
{
@@ -8096,8 +8164,9 @@ void DismountIdleVolumes () && prop.mode >= FIRST_MODE_OF_OPERATION_ID && prop.mode <= LAST_MODE_OF_OPERATION
&& prop.pkcs5 >= FIRST_PRF_ID && prop.pkcs5 <= LAST_PRF_ID
&& prop.pkcs5Iterations > 0
&& prop.hiddenVolProtection >= 0 && prop.volFormatVersion >= 0
+ && prop.volumePin >= 0
)
)
{
if (LastRead[i] == prop.totalBytesRead
@@ -8236,9 +8305,9 @@ BOOL MountFavoriteVolumes (BOOL systemFavorites, BOOL logOnMount, BOOL hotKeyMou }
BOOL prevReadOnly = mountOptions.ReadOnly;
- if (!Mount (MainDlg, drive, (char *) favorite.Path.c_str()))
+ if (!Mount (MainDlg, drive, (char *) favorite.Path.c_str(), favorite.Pin))
status = FALSE;
if (status && mountOptions.ReadOnly != prevReadOnly)
userForcedReadOnly = mountOptions.ReadOnly;
diff --git a/src/Mount/Mount.rc b/src/Mount/Mount.rc index d40eb805..135cdd77 100644 --- a/src/Mount/Mount.rc +++ b/src/Mount/Mount.rc @@ -311,36 +311,39 @@ BEGIN GROUPBOX "Thread-Based Parallelization",IDT_PARALLELIZATION_OPTIONS,7,84,355,93
LTEXT "",IDT_LIMIT_ENC_THREAD_POOL_NOTE,18,126,334,33
END
-IDD_FAVORITE_VOLUMES DIALOGEX 0, 0, 380, 276
+IDD_FAVORITE_VOLUMES DIALOGEX 0, 0, 380, 315
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "VeraCrypt - Favorite Volumes"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "",IDC_FAVORITE_VOLUMES_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,7,366,92
PUSHBUTTON "Move &Up",IDC_FAVORITE_MOVE_UP,7,104,63,14
PUSHBUTTON "Move &Down",IDC_FAVORITE_MOVE_DOWN,74,104,63,14
PUSHBUTTON "&Remove",IDC_FAVORITE_REMOVE,310,104,63,14
- EDITTEXT IDC_FAVORITE_LABEL,16,142,204,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_FAVORITE_LABEL,16,173,204,13,ES_AUTOHSCROLL
CONTROL "Mount selected volume as read-o&nly",IDC_FAVORITE_MOUNT_READONLY,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,162,349,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,193,349,10
CONTROL "Mount selected volume as remo&vable medium",IDC_FAVORITE_MOUNT_REMOVABLE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,176,349,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,207,349,10
CONTROL "Mount selected volume upon log&on",IDC_FAVORITE_MOUNT_ON_LOGON,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,190,349,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,221,349,10
CONTROL "Mount selected volume when its host device gets &connected",IDC_FAVORITE_MOUNT_ON_ARRIVAL,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,204,349,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,235,349,10
CONTROL "Open &Explorer window for selected volume when successfully mounted",IDC_FAVORITE_OPEN_EXPLORER_WIN_ON_MOUNT,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,218,349,11
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,249,349,11
CONTROL "Do not mount selected volume when 'Mount Favorite Volumes' &hot key is pressed",IDC_FAVORITE_DISABLE_HOTKEY,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,232,349,11
- LTEXT "Help on favorite volumes",IDC_FAVORITES_HELP_LINK,17,259,237,10,SS_NOTIFY
- DEFPUSHBUTTON "OK",IDOK,269,257,50,14
- PUSHBUTTON "Cancel",IDCANCEL,323,257,50,14
- GROUPBOX "",IDC_FAV_VOL_OPTIONS_GROUP_BOX,7,121,366,130
- LTEXT "Label of selected favorite volume:",IDT_FAVORITE_LABEL,18,132,202,8
- GROUPBOX "Global Settings",IDC_FAV_VOL_OPTIONS_GLOBAL_SETTINGS_BOX,7,202,366,49
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,264,349,11
+ LTEXT "Help on favorite volumes",IDC_FAVORITES_HELP_LINK,17,298,237,10,SS_NOTIFY
+ DEFPUSHBUTTON "OK",IDOK,269,296,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,323,296,50,14
+ GROUPBOX "",IDC_FAV_VOL_OPTIONS_GROUP_BOX,7,122,366,159
+ LTEXT "Label of selected favorite volume:",IDT_FAVORITE_LABEL,18,163,202,8
+ GROUPBOX "Global Settings",IDC_FAV_VOL_OPTIONS_GLOBAL_SETTINGS_BOX,7,230,366,57
+ EDITTEXT IDC_PIN,16,143,42,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ LTEXT "(Empty or 0 for default iterations)",IDC_PIN_HELP,64,145,189,8
+ LTEXT "Volume PIN:",IDT_PIN,18,133,65,8
END
IDD_DEFAULT_MOUNT_PARAMETERS DIALOGEX 0, 0, 167, 65
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
@@ -442,9 +445,9 @@ BEGIN BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 373
TOPMARGIN, 7
- BOTTOMMARGIN, 269
+ BOTTOMMARGIN, 308
END
IDD_DEFAULT_MOUNT_PARAMETERS, DIALOG
BEGIN
|