"Fossies" - the Fresh Open Source Software Archive

Member "src/Common/Password.h" (10 Oct 2018, 2419 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Password.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.20_Source_vs_1.21_Source.

    1 /*
    2  Legal Notice: Some portions of the source code contained in this file were
    3  derived from the source code of TrueCrypt 7.1a, which is 
    4  Copyright (c) 2003-2012 TrueCrypt Developers Association and which is 
    5  governed by the TrueCrypt License 3.0, also from the source code of
    6  Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
    7  and which is governed by the 'License Agreement for Encryption for the Masses' 
    8  Modifications and additions to the original source code (contained in this file) 
    9  and all other portions of this file are Copyright (c) 2013-2017 IDRIX
   10  and are governed by the Apache License 2.0 the full text of which is
   11  contained in the file License.txt included in VeraCrypt binary and source
   12  code distribution packages. */
   13 
   14 #ifndef PASSWORD_H
   15 #define PASSWORD_H
   16 
   17 // User text input limits
   18 #define MIN_PASSWORD            1       // Minimum possible password length
   19 #define MAX_PASSWORD            64      // Maximum possible password length
   20 #define MAX_PIM             7       // Maximum allowed digits in a PIM (enough for maximum value)
   21 #define MAX_PIM_VALUE       2147468 // Maximum value to have a positive 32-bit result for formula 15000 + (PIM x 1000)
   22 #define MAX_BOOT_PIM            5       // Maximum allowed digits in a PIM for boot (enough for 16-bit value)
   23 #define MAX_BOOT_PIM_VALUE  65535
   24 
   25 #define PASSWORD_LEN_WARNING    20      // Display a warning when a password is shorter than this
   26 
   27 #ifdef __cplusplus
   28 extern "C" {
   29 #endif
   30 
   31 typedef struct
   32 {
   33     // Modifying this structure can introduce incompatibility with previous versions
   34     unsigned __int32 Length;
   35     unsigned char Text[MAX_PASSWORD + 1];
   36     char Pad[3]; // keep 64-bit alignment
   37 } Password;
   38 
   39 #if defined(_WIN32) && !defined(TC_WINDOWS_DRIVER) && !defined(_UEFI)
   40 
   41 void VerifyPasswordAndUpdate ( HWND hwndDlg , HWND hButton , HWND hPassword , HWND hVerify , unsigned char *szPassword , char *szVerify, BOOL keyFilesEnabled );
   42 BOOL CheckPasswordLength (HWND hwndDlg, unsigned __int32 passwordLength, int pim, BOOL bForBoot, int bootPRF, BOOL bSkipPasswordWarning, BOOL bSkipPimWarning);     
   43 BOOL CheckPasswordCharEncoding (HWND hPassword, Password *ptrPw);           
   44 int ChangePwd (const wchar_t *lpszVolume, Password *oldPassword, int old_pkcs5, int old_pim, BOOL truecryptMode, Password *newPassword, int pkcs5, int pim, int wipePassCount, HWND hwndDlg);
   45 
   46 #endif  // defined(_WIN32) && !defined(TC_WINDOWS_DRIVER) && !defined(_UEFI)
   47 
   48 #ifdef __cplusplus
   49 }
   50 #endif
   51 
   52 #endif  // PASSWORD_H