VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/ExpandVolume
diff options
context:
space:
mode:
Diffstat (limited to 'src/ExpandVolume')
-rw-r--r--src/ExpandVolume/DlgExpandVolume.cpp16
-rw-r--r--src/ExpandVolume/ExpandVolume.c18
-rw-r--r--src/ExpandVolume/ExpandVolume.h4
-rw-r--r--src/ExpandVolume/WinMain.cpp20
4 files changed, 29 insertions, 29 deletions
diff --git a/src/ExpandVolume/DlgExpandVolume.cpp b/src/ExpandVolume/DlgExpandVolume.cpp
index 15888f50..47b45966 100644
--- a/src/ExpandVolume/DlgExpandVolume.cpp
+++ b/src/ExpandVolume/DlgExpandVolume.cpp
@@ -71,9 +71,9 @@ BOOL CALLBACK ExpandVolProgressDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, L
namespace VeraCryptExpander
{
/* defined in WinMain.c, referenced by ExpandVolumeWizard() */
-int ExtcvAskVolumePassword (HWND hwndDlg, Password *password, int *pkcs5, int *pin, BOOL* truecryptMode, char *titleStringId, BOOL enableMountOptions);
+int ExtcvAskVolumePassword (HWND hwndDlg, Password *password, int *pkcs5, int *pim, BOOL* truecryptMode, char *titleStringId, BOOL enableMountOptions);
}
int GetSpaceString(char *dest, size_t maxlen, uint64 size, BOOL bDevice)
@@ -405,9 +405,9 @@ typedef struct
OpenVolumeContext *context;
const char *volumePath;
Password *password;
int pkcs5_prf;
- int pin;
+ int pim;
BOOL truecryptMode;
BOOL write;
BOOL preserveTimestamps;
BOOL useBackupHeader;
@@ -418,9 +418,9 @@ void CALLBACK OpenVolumeWaitThreadProc(void* pArg, HWND hwndDlg)
{
OpenVolumeThreadParam* pThreadParam = (OpenVolumeThreadParam*) pArg;
*(pThreadParam)->nStatus = OpenVolume(pThreadParam->context, pThreadParam->volumePath, pThreadParam->password, pThreadParam->pkcs5_prf,
- pThreadParam->pin, pThreadParam->truecryptMode, pThreadParam->write, pThreadParam->preserveTimestamps, pThreadParam->useBackupHeader);
+ pThreadParam->pim, pThreadParam->truecryptMode, pThreadParam->write, pThreadParam->preserveTimestamps, pThreadParam->useBackupHeader);
}
/*
ExpandVolumeWizard
@@ -444,9 +444,9 @@ void ExpandVolumeWizard (HWND hwndDlg, char *lpszVolume)
{
int nStatus = ERR_OS_ERROR;
wchar_t szTmp[4096];
Password VolumePassword;
- int VolumePkcs5 = 0, VolumePin = -1;
+ int VolumePkcs5 = 0, VolumePim = -1;
uint64 hostSize, volSize, hostSizeFree, maxSizeFS;
BOOL bIsDevice, bIsLegacy;
DWORD dwError;
int driveNo;
@@ -512,9 +512,9 @@ void ExpandVolumeWizard (HWND hwndDlg, char *lpszVolume)
{
OpenVolumeContext expandVol;
BOOL truecryptMode = FALSE;
- if (!VeraCryptExpander::ExtcvAskVolumePassword (hwndDlg, &VolumePassword, &VolumePkcs5, &VolumePin, &truecryptMode, "ENTER_NORMAL_VOL_PASSWORD", FALSE))
+ if (!VeraCryptExpander::ExtcvAskVolumePassword (hwndDlg, &VolumePassword, &VolumePkcs5, &VolumePim, &truecryptMode, "ENTER_NORMAL_VOL_PASSWORD", FALSE))
{
goto ret;
}
@@ -530,9 +530,9 @@ void ExpandVolumeWizard (HWND hwndDlg, char *lpszVolume)
threadParam.context = &expandVol;
threadParam.volumePath = lpszVolume;
threadParam.password = &VolumePassword;
threadParam.pkcs5_prf = VolumePkcs5;
- threadParam.pin = VolumePin;
+ threadParam.pim = VolumePim;
threadParam.truecryptMode = FALSE;
threadParam.write = FALSE;
threadParam.preserveTimestamps = bPreserveTimestamp;
threadParam.useBackupHeader = FALSE;
@@ -577,9 +577,9 @@ void ExpandVolumeWizard (HWND hwndDlg, char *lpszVolume)
WaitCursor();
// auto mount the volume to check the file system type
- nStatus=MountVolTemp(hwndDlg, lpszVolume, &driveNo, &VolumePassword, VolumePkcs5, VolumePin);
+ nStatus=MountVolTemp(hwndDlg, lpszVolume, &driveNo, &VolumePassword, VolumePkcs5, VolumePim);
if (nStatus != ERR_SUCCESS)
goto error;
@@ -652,9 +652,9 @@ void ExpandVolumeWizard (HWND hwndDlg, char *lpszVolume)
VolExpandParam.szVolumeName = lpszVolume;
VolExpandParam.FileSystem = volFSType;
VolExpandParam.pVolumePassword = &VolumePassword;
VolExpandParam.VolumePkcs5 = VolumePkcs5;
- VolExpandParam.VolumePin = VolumePin;
+ VolExpandParam.VolumePim = VolumePim;
VolExpandParam.bIsDevice = bIsDevice;
VolExpandParam.bIsLegacy = bIsLegacy;
VolExpandParam.oldSize = bIsDevice ? volSize : hostSize;
VolExpandParam.newSize = hostSize;
diff --git a/src/ExpandVolume/ExpandVolume.c b/src/ExpandVolume/ExpandVolume.c
index 9233340c..a4fe5310 100644
--- a/src/ExpandVolume/ExpandVolume.c
+++ b/src/ExpandVolume/ExpandVolume.c
@@ -101,9 +101,9 @@ static int FsctlExtendVolume(char * szVolume, LONGLONG nTotalSectors );
int with Truecrypt error code (ERR_SUCCESS on success)
*/
-int MountVolTemp (HWND hwndDlg, char *volumePath, int *driveNo, Password *password, int pkcs5, int pin)
+int MountVolTemp (HWND hwndDlg, char *volumePath, int *driveNo, Password *password, int pkcs5, int pim)
{
MountOptions mountOptions;
ZeroMemory (&mountOptions, sizeof (mountOptions));
@@ -121,9 +121,9 @@ int MountVolTemp (HWND hwndDlg, char *volumePath, int *driveNo, Password *passwo
mountOptions.PreserveTimestamp = bPreserveTimestamp;
mountOptions.PartitionInInactiveSysEncScope = FALSE;
mountOptions.UseBackupHeader = FALSE;
- if (MountVolume (hwndDlg, *driveNo, volumePath, password, pkcs5, pin, FALSE, FALSE, TRUE, &mountOptions, FALSE, FALSE) < 1)
+ if (MountVolume (hwndDlg, *driveNo, volumePath, password, pkcs5, pim, FALSE, FALSE, TRUE, &mountOptions, FALSE, FALSE) < 1)
{
*driveNo = -3;
return ERR_VOL_MOUNT_FAILED;
}
@@ -388,9 +388,9 @@ uint64 GetVolumeSizeByDataAreaSize (uint64 dataAreaSize, BOOL legacyVolume)
return dataAreaSize + reservedSize;
}
-int ExtendFileSystem (HWND hwndDlg , char *lpszVolume, Password *pVolumePassword, int VolumePkcs5, int VolumePin, uint64 newDataAreaSize)
+int ExtendFileSystem (HWND hwndDlg , char *lpszVolume, Password *pVolumePassword, int VolumePkcs5, int VolumePim, uint64 newDataAreaSize)
{
char szVolumeGUID[128];
int driveNo = -1;
char rootPath[] = "A:\\";
@@ -402,9 +402,9 @@ int ExtendFileSystem (HWND hwndDlg , char *lpszVolume, Password *pVolumePassword
// mount and resize file system
DebugAddProgressDlgStatus (hwndDlg, "Mounting volume ...\r\n");
- nStatus=MountVolTemp(hwndDlg, lpszVolume, &driveNo, pVolumePassword, VolumePkcs5, VolumePin);
+ nStatus=MountVolTemp(hwndDlg, lpszVolume, &driveNo, pVolumePassword, VolumePkcs5, VolumePim);
if (nStatus!=ERR_SUCCESS)
{
driveNo = -1;
goto error;
@@ -503,9 +503,9 @@ error:
Remarks: a lot of code is from TrueCrypt 'Common\Password.c' :: ChangePwd()
*/
-static int ExpandVolume (HWND hwndDlg, char *lpszVolume, Password *pVolumePassword, int VolumePkcs5, int VolumePin, uint64 newHostSize, BOOL initFreeSpace)
+static int ExpandVolume (HWND hwndDlg, char *lpszVolume, Password *pVolumePassword, int VolumePkcs5, int VolumePim, uint64 newHostSize, BOOL initFreeSpace)
{
int nDosLinkCreated = 1, nStatus = ERR_OS_ERROR;
char szDiskFile[TC_MAX_PATH], szCFDevice[TC_MAX_PATH];
char szDosDevice[TC_MAX_PATH];
@@ -647,9 +647,9 @@ static int ExpandVolume (HWND hwndDlg, char *lpszVolume, Password *pVolumePasswo
}
/* Try to decrypt the header */
- nStatus = ReadVolumeHeader (FALSE, buffer, pVolumePassword, VolumePkcs5, VolumePin, FALSE, &cryptoInfo, NULL);
+ nStatus = ReadVolumeHeader (FALSE, buffer, pVolumePassword, VolumePkcs5, VolumePim, FALSE, &cryptoInfo, NULL);
if (nStatus == ERR_CIPHER_INIT_WEAK_KEY)
nStatus = 0; // We can ignore this error here
if (nStatus != 0)
@@ -805,9 +805,9 @@ static int ExpandVolume (HWND hwndDlg, char *lpszVolume, Password *pVolumePasswo
cryptoInfo->ea,
cryptoInfo->mode,
pVolumePassword,
cryptoInfo->pkcs5,
- VolumePin,
+ VolumePim,
(char*)(cryptoInfo->master_keydata),
&ci,
newDataAreaSize,
0, // hiddenVolumeSize
@@ -972,9 +972,9 @@ error:
SetLastError (dwError);
if (nStatus == ERR_SUCCESS)
{
- nStatus = ExtendFileSystem (hwndDlg, lpszVolume, pVolumePassword, VolumePkcs5, VolumePin, newDataAreaSize);
+ nStatus = ExtendFileSystem (hwndDlg, lpszVolume, pVolumePassword, VolumePkcs5, VolumePim, newDataAreaSize);
}
return nStatus;
}
@@ -987,9 +987,9 @@ void __cdecl volTransformThreadFunction (void *pExpandDlgParam)
EXPAND_VOL_THREAD_PARAMS *pParam=(EXPAND_VOL_THREAD_PARAMS *)pExpandDlgParam;
HWND hwndDlg = (HWND) pParam->hwndDlg;
nStatus = ExpandVolume (hwndDlg, (char*)pParam->szVolumeName, pParam->pVolumePassword,
- pParam->VolumePkcs5, pParam->VolumePin, pParam->newSize, pParam->bInitFreeSpace );
+ pParam->VolumePkcs5, pParam->VolumePim, pParam->newSize, pParam->bInitFreeSpace );
if (nStatus!=ERR_SUCCESS && nStatus!=ERR_USER_ABORT)
handleError (hwndDlg, nStatus, SRC_POS);
diff --git a/src/ExpandVolume/ExpandVolume.h b/src/ExpandVolume/ExpandVolume.h
index 8fc7c9b7..e5634eb7 100644
--- a/src/ExpandVolume/ExpandVolume.h
+++ b/src/ExpandVolume/ExpandVolume.h
@@ -58,9 +58,9 @@ typedef struct
BOOL bIsLegacy;
BOOL bInitFreeSpace;
Password *pVolumePassword;
int VolumePkcs5;
- int VolumePin;
+ int VolumePim;
HWND hwndDlg;
} EXPAND_VOL_THREAD_PARAMS;
#ifdef __cplusplus
@@ -74,9 +74,9 @@ extern volatile BOOL bVolTransformThreadCancel; /* TRUE if the user cancels/paus
/* defined in ExpandVolume.c */
uint64 GetVolumeDataAreaSize (uint64 volumeSize, BOOL legacyVolume);
uint64 GetVolumeSizeByDataAreaSize (uint64 dataSize, BOOL legacyVolume);
int QueryVolumeInfo (HWND hwndDlg, const char *lpszVolume, uint64 * pHostSizeFree, uint64 * pSizeLimitFS );
-int MountVolTemp (HWND hwndDlg, char *volumePath, int *driveNo, Password *password, int pkcs5, int pin);
+int MountVolTemp (HWND hwndDlg, char *volumePath, int *driveNo, Password *password, int pkcs5, int pim);
BOOL GetFileSystemType(const char *szFileName, enum EV_FileSystem *pFS);
BOOL GetNtfsNumberOfSectors(char *rootPath, uint64 *pNumberOfSectors, DWORD *pBytesPerSector);
void __cdecl volTransformThreadFunction (void *hwndDlgArg);
diff --git a/src/ExpandVolume/WinMain.cpp b/src/ExpandVolume/WinMain.cpp
index 020a6b22..18df1b4d 100644
--- a/src/ExpandVolume/WinMain.cpp
+++ b/src/ExpandVolume/WinMain.cpp
@@ -391,9 +391,9 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
WORD lw = LOWORD (wParam);
static Password *szXPwd;
static int *pkcs5;
- static int *pin;
+ static int *pim;
static BOOL* truecryptMode;
switch (msg)
{
@@ -401,9 +401,9 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
int i, nIndex;
szXPwd = ((PasswordDlgParam *) lParam) -> password;
pkcs5 = ((PasswordDlgParam *) lParam) -> pkcs5;
- pin = ((PasswordDlgParam *) lParam) -> pin;
+ pim = ((PasswordDlgParam *) lParam) -> pim;
truecryptMode = ((PasswordDlgParam *) lParam) -> truecryptMode;
LocalizeDialog (hwndDlg, "IDD_PASSWORD_DLG");
DragAcceptFiles (hwndDlg, TRUE);
@@ -446,9 +446,9 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
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_PIM), EM_LIMITTEXT, MAX_PIM, 0);
- SetPin (hwndDlg, IDC_PIM, *pin);
+ SetPim (hwndDlg, IDC_PIM, *pim);
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, KeyFilesEnable);
mountOptions.PartitionInInactiveSysEncScope = bPrebootPasswordDlgMode;
@@ -546,9 +546,9 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
SetCheckBox (hwndDlg, IDC_KEYFILES_ENABLE, FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEYFILES_ENABLE), FALSE);
EnableWindow (GetDlgItem (hwndDlg, IDC_KEY_FILES), FALSE);
- SetPin (hwndDlg, IDC_PIM, *pin);
+ SetPim (hwndDlg, IDC_PIM, *pim);
bPrebootPasswordDlgMode = TRUE;
}
return 1;
@@ -660,11 +660,11 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
*truecryptMode = GetCheckBox (hwndDlg, IDC_TRUECRYPT_MODE);
GetWindowText (GetDlgItem (hwndDlg, IDC_PIM), tmp, MAX_PIM + 1);
if (strlen(tmp))
- *pin = (int) strtol(tmp, NULL, 10); /* IDC_PIM is configured to accept only numbers */
+ *pim = (int) strtol(tmp, NULL, 10); /* IDC_PIM is configured to accept only numbers */
else
- *pin = 0;
+ *pim = 0;
/* SHA-256 is not supported by TrueCrypt */
if ( (*truecryptMode)
&& ((*pkcs5 == SHA256) || (mountOptions.ProtectHiddenVolume && mountOptions.ProtectedHidVolPkcs5Prf == SHA256))
@@ -674,9 +674,9 @@ BOOL CALLBACK ExtcvPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
return 1;
}
if ( (*truecryptMode)
- && (*pin != 0)
+ && (*pim != 0)
)
{
Error ("PIM_NOT_SUPPORTED_FOR_TRUECRYPT_MODE", hwndDlg);
return 1;
@@ -778,9 +778,9 @@ int RestoreVolumeHeader (HWND hwndDlg, char *lpszVolume)
// dummy
return 0;
}
-int ExtcvAskVolumePassword (HWND hwndDlg, Password *password, int *pkcs5, int *pin, BOOL* truecryptMode, char *titleStringId, BOOL enableMountOptions)
+int ExtcvAskVolumePassword (HWND hwndDlg, Password *password, int *pkcs5, int *pim, BOOL* truecryptMode, char *titleStringId, BOOL enableMountOptions)
{
int result;
PasswordDlgParam dlgParam;
@@ -788,9 +788,9 @@ int ExtcvAskVolumePassword (HWND hwndDlg, Password *password, int *pkcs5, int *p
PasswordDialogDisableMountOptions = !enableMountOptions;
dlgParam.password = password;
dlgParam.pkcs5 = pkcs5;
- dlgParam.pin = pin;
+ dlgParam.pim = pim;
dlgParam.truecryptMode = truecryptMode;
result = DialogBoxParamW (hInst,
MAKEINTRESOURCEW (IDD_PASSWORD_DLG), hwndDlg,
@@ -799,9 +799,9 @@ int ExtcvAskVolumePassword (HWND hwndDlg, Password *password, int *pkcs5, int *p
if (result != IDOK)
{
password->Length = 0;
*pkcs5 = 0;
- *pin = 0;
+ *pim = 0;
*truecryptMode = FALSE;
burn (&mountOptions.ProtectedHidVolPassword, sizeof (mountOptions.ProtectedHidVolPassword));
burn (&mountOptions.ProtectedHidVolPkcs5Prf, sizeof (mountOptions.ProtectedHidVolPkcs5Prf));
}