VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Password.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-01-28 14:58:41 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-01-28 17:16:33 +0100
commitcdd1179c63bb892696adfad1818d65e3026916ca (patch)
treee2d7265440b8cc51ca544d2c2412041b0d18439d /src/Common/Password.h
parent54e46c260cf04861c99d8b2590999c1eb33f0cb1 (diff)
downloadVeraCrypt-cdd1179c63bb892696adfad1818d65e3026916ca.tar.gz
VeraCrypt-cdd1179c63bb892696adfad1818d65e3026916ca.zip
Increase password maximum length to 128 bytes from 64 bytes
Diffstat (limited to 'src/Common/Password.h')
-rw-r--r--src/Common/Password.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/Common/Password.h b/src/Common/Password.h
index b2b0511d..550558db 100644
--- a/src/Common/Password.h
+++ b/src/Common/Password.h
@@ -16,7 +16,12 @@
// User text input limits
#define MIN_PASSWORD 1 // Minimum possible password length
-#define MAX_PASSWORD 64 // Maximum possible password length
+#if defined(TC_WINDOWS_BOOT) || defined(_UEFI)
+#define MAX_PASSWORD 64 // Maximum possible password length
+#else
+#define MAX_LEGACY_PASSWORD 64 // Maximum possible legacy password length
+#define MAX_PASSWORD 128 // Maximum possible password length
+#endif
#define MAX_PIM 7 // Maximum allowed digits in a PIM (enough for maximum value)
#define MAX_PIM_VALUE 2147468 // Maximum value to have a positive 32-bit result for formula 15000 + (PIM x 1000)
#define MAX_BOOT_PIM 5 // Maximum allowed digits in a PIM for boot (enough for 16-bit value)
@@ -36,6 +41,18 @@ typedef struct
char Pad[3]; // keep 64-bit alignment
} Password;
+#if defined(TC_WINDOWS_BOOT) || defined(_UEFI)
+#define PasswordLegacy Password
+#else
+typedef struct
+{
+ // Modifying this structure can introduce incompatibility with previous versions
+ unsigned __int32 Length;
+ unsigned char Text[MAX_LEGACY_PASSWORD + 1];
+ char Pad[3]; // keep 64-bit alignment
+} PasswordLegacy;
+#endif
+
#if defined(_WIN32) && !defined(TC_WINDOWS_DRIVER) && !defined(_UEFI)
void VerifyPasswordAndUpdate ( HWND hwndDlg , HWND hButton , HWND hPassword , HWND hVerify , unsigned char *szPassword , char *szVerify, BOOL keyFilesEnabled );