diff options
Diffstat (limited to 'src/Common/Password.h')
-rw-r--r-- | src/Common/Password.h | 19 |
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 ); |