diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-05-27 00:12:46 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-05-27 01:01:53 +0200 |
commit | 70215e3682345243301d410fc0072f294006403c (patch) | |
tree | a36ac199a658370a549a1fec7b1d413ff62f1ad7 /src/Mount | |
parent | 8ebf5ac605d57eab80b600a7827d2ba48668d887 (diff) | |
download | VeraCrypt-70215e3682345243301d410fc0072f294006403c.tar.gz VeraCrypt-70215e3682345243301d410fc0072f294006403c.zip |
Windows: GUI modifications around PIN field
Diffstat (limited to 'src/Mount')
-rw-r--r-- | src/Mount/Mount.c | 29 | ||||
-rw-r--r-- | src/Mount/Resource.h | 11 |
2 files changed, 17 insertions, 23 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 7f8cbca2..ef116199 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -2389,16 +2389,9 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa SendMessage (GetDlgItem (hwndDlg, IDC_PASSWORD), EM_LIMITTEXT, MAX_PASSWORD, 0);
SendMessage (GetDlgItem (hwndDlg, IDC_CACHE), BM_SETCHECK, bCacheInDriver ? BST_CHECKED:BST_UNCHECKED, 0);
SendMessage (GetDlgItem (hwndDlg, IDC_PIN), EM_LIMITTEXT, MAX_PIN, 0);
- if (*pin > 0)
- {
- /* display the given PIN */
- char szTmp[MAX_PIN + 1];
- StringCbPrintfA(szTmp, sizeof(szTmp), "%d", *pin);
-
- SetDlgItemText (hwndDlg, IDC_PIN, szTmp);
- }
+ SetPin (hwndDlg, IDC_PIN, *pin);
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
mountOptions.PartitionInInactiveSysEncScope = bPrebootPasswordDlgMode;
@@ -2498,16 +2491,9 @@ BOOL CALLBACK PasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES), FALSE);
- if (*pin >= 0)
- {
- /* display the given PIN */
- char szTmp[MAX_PIN + 1];
- StringCbPrintfA(szTmp, sizeof(szTmp), "%d", *pin);
-
- SetDlgItemText (hwndDlg, IDC_PIN, szTmp);
- }
+ SetPin (hwndDlg, IDC_PIN, *pin);
bPrebootPasswordDlgMode = TRUE;
}
return 1;
@@ -3025,15 +3011,21 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_HIDVOL_PROT), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE_HIDVOL_PROT), protect);
EnableWindow (GetDlgItem (hwndDlg, IDT_PKCS5_PRF), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDT_PIN), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN_HELP), protect);
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE_HIDVOL_PROT, hidVolProtKeyFilesParam.EnableKeyFiles);
SendDlgItemMessage (hwndDlg, IDC_PASSWORD_PROT_HIDVOL, EM_LIMITTEXT, MAX_PASSWORD, 0);
+ SendDlgItemMessage (hwndDlg, IDC_PIN, EM_LIMITTEXT, MAX_PIN, 0);
if (mountOptions->ProtectedHidVolPassword.Length > 0)
SetWindowText (GetDlgItem (hwndDlg, IDC_PASSWORD_PROT_HIDVOL), (LPSTR) mountOptions->ProtectedHidVolPassword.Text);
+
+ SetPin (hwndDlg, IDC_PIN, mountOptions->ProtectedHidVolPin);
ToHyperlink (hwndDlg, IDC_LINK_HIDVOL_PROTECTION_INFO);
}
@@ -3126,8 +3118,10 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM mountOptions->ProtectedHidVolPassword.Length = (unsigned __int32) strlen ((char *) mountOptions->ProtectedHidVolPassword.Text);
mountOptions->ProtectedHidVolPkcs5Prf = (int) SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETITEMDATA,
SendMessage (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), CB_GETCURSEL, 0, 0), 0);
+
+ mountOptions->ProtectedHidVolPin = GetPin (hwndDlg, IDC_PIN);
}
// Cleanup
memset (tmp, 'X', MAX_PASSWORD);
@@ -3164,8 +3158,11 @@ BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_HIDVOL_PROT), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE_HIDVOL_PROT), protect);
EnableWindow (GetDlgItem (hwndDlg, IDT_PKCS5_PRF), protect);
EnableWindow (GetDlgItem (hwndDlg, IDC_PKCS5_PRF_ID), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDT_PIN), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN), protect);
+ EnableWindow (GetDlgItem (hwndDlg, IDC_PIN_HELP), protect);
return 1;
}
diff --git a/src/Mount/Resource.h b/src/Mount/Resource.h index 857ef197..05109fcc 100644 --- a/src/Mount/Resource.h +++ b/src/Mount/Resource.h @@ -162,14 +162,11 @@ #define IDT_NEW_PKCS5_PRF 1138
#define IDC_PKCS5_OLD_PRF_ID 1139
#define IDC_TRUECRYPT_MODE 1140
#define IDC_PREF_TEMP_CACHE_ON_MULTIPLE_MOUNT 1141
-#define IDT_PIN 1142
-#define IDC_PIN 1143
-#define IDC_PIN_HELP 1144
-#define IDT_OLD_PIN 1145
-#define IDC_OLD_PIN 1146
-#define IDC_OLD_PIN_HELP 1147
+#define IDT_OLD_PIN 1142
+#define IDC_OLD_PIN 1143
+#define IDC_OLD_PIN_HELP 1144
#define IDM_HELP 40001
#define IDM_ABOUT 40002
#define IDM_UNMOUNT_VOLUME 40003
#define IDM_CLEAR_HISTORY 40004
@@ -243,8 +240,8 @@ #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 119
#define _APS_NEXT_COMMAND_VALUE 40068
-#define _APS_NEXT_CONTROL_VALUE 1148
+#define _APS_NEXT_CONTROL_VALUE 1145
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
|