"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Format/InPlace.c" between
VeraCrypt_1.21_Source.tar.bz2 and VeraCrypt_1.22_Source.tar.bz2

About: VeraCrypt is a free disk encryption software (based on TrueCrypt).

InPlace.c  (VeraCrypt_1.21_Source.tar.bz2):InPlace.c  (VeraCrypt_1.22_Source.tar.bz2)
skipping to change at line 736 skipping to change at line 736
DWORD dwError, dwResult; DWORD dwError, dwResult;
BOOL bPause = FALSE, bEncryptedAreaSizeChanged = FALSE; BOOL bPause = FALSE, bEncryptedAreaSizeChanged = FALSE;
LARGE_INTEGER offset; LARGE_INTEGER offset;
int sectorSize; int sectorSize;
int i; int i;
DWORD n; DWORD n;
WCHAR *devicePath = volParams->volumePath; WCHAR *devicePath = volParams->volumePath;
Password *password = volParams->password; Password *password = volParams->password;
int pkcs5_prf = volParams->pkcs5; int pkcs5_prf = volParams->pkcs5;
int pim = volParams->pim; int pim = volParams->pim;
DISK_GEOMETRY_EX driveGeometry; DISK_GEOMETRY driveGeometry;
HWND hwndDlg = volParams->hwndDlg; HWND hwndDlg = volParams->hwndDlg;
bInPlaceEncNonSysResumed = TRUE; bInPlaceEncNonSysResumed = TRUE;
buf = (char *) TCalloc (TC_MAX_NONSYS_INPLACE_ENC_WORK_CHUNK_SIZE); buf = (char *) TCalloc (TC_MAX_NONSYS_INPLACE_ENC_WORK_CHUNK_SIZE);
if (!buf) if (!buf)
{ {
nStatus = ERR_OUTOFMEMORY; nStatus = ERR_OUTOFMEMORY;
goto closing_seq; goto closing_seq;
} }
skipping to change at line 817 skipping to change at line 817
// This should never be needed, but is still performed for extra safety ( without checking the result) // This should never be needed, but is still performed for extra safety ( without checking the result)
DeviceIoControl (dev, DeviceIoControl (dev,
FSCTL_ALLOW_EXTENDED_DASD_IO, FSCTL_ALLOW_EXTENDED_DASD_IO,
NULL, NULL,
0, 0,
NULL, NULL,
0, 0,
&dwResult, &dwResult,
NULL); NULL);
if (!DeviceIoControl (dev, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, &dr iveGeometry, sizeof (driveGeometry), &dwResult, NULL)) if (!DeviceIoControl (dev, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, &drive Geometry, sizeof (driveGeometry), &dwResult, NULL))
{ {
nStatus = ERR_OS_ERROR; nStatus = ERR_OS_ERROR;
goto closing_seq; goto closing_seq;
} }
sectorSize = driveGeometry.Geometry.BytesPerSector; sectorSize = driveGeometry.BytesPerSector;
nStatus = OpenBackupHeader (dev, devicePath, password, pkcs5_prf, pim, &m asterCryptoInfo, headerCryptoInfo, deviceSize); nStatus = OpenBackupHeader (dev, devicePath, password, pkcs5_prf, pim, &m asterCryptoInfo, headerCryptoInfo, deviceSize);
if (nStatus != ERR_SUCCESS) if (nStatus != ERR_SUCCESS)
goto closing_seq; goto closing_seq;
remainingBytes = masterCryptoInfo->VolumeSize.Value - masterCryptoInfo->Encr yptedAreaLength.Value; remainingBytes = masterCryptoInfo->VolumeSize.Value - masterCryptoInfo->Encr yptedAreaLength.Value;
lastHeaderUpdateDistance = 0; lastHeaderUpdateDistance = 0;
skipping to change at line 1228 skipping to change at line 1228
BOOL bPause = FALSE, bEncryptedAreaSizeChanged = FALSE; BOOL bPause = FALSE, bEncryptedAreaSizeChanged = FALSE;
LARGE_INTEGER offset; LARGE_INTEGER offset;
int sectorSize; int sectorSize;
int i; int i;
DWORD n; DWORD n;
WCHAR *devicePath = volParams->volumePath; WCHAR *devicePath = volParams->volumePath;
Password *password = volParams->password; Password *password = volParams->password;
HWND hwndDlg = volParams->hwndDlg; HWND hwndDlg = volParams->hwndDlg;
int pkcs5_prf = volParams->pkcs5; int pkcs5_prf = volParams->pkcs5;
int pim = volParams->pim; int pim = volParams->pim;
DISK_GEOMETRY_EX driveGeometry; DISK_GEOMETRY driveGeometry;
buf = (char *) TCalloc (TC_MAX_NONSYS_INPLACE_ENC_WORK_CHUNK_SIZE); buf = (char *) TCalloc (TC_MAX_NONSYS_INPLACE_ENC_WORK_CHUNK_SIZE);
if (!buf) if (!buf)
{ {
nStatus = ERR_OUTOFMEMORY; nStatus = ERR_OUTOFMEMORY;
goto closing_seq; goto closing_seq;
} }
headerCryptoInfo = crypto_open(); headerCryptoInfo = crypto_open();
skipping to change at line 1297 skipping to change at line 1297
// This should never be needed, but is still performed for extra safety ( without checking the result) // This should never be needed, but is still performed for extra safety ( without checking the result)
DeviceIoControl (dev, DeviceIoControl (dev,
FSCTL_ALLOW_EXTENDED_DASD_IO, FSCTL_ALLOW_EXTENDED_DASD_IO,
NULL, NULL,
0, 0,
NULL, NULL,
0, 0,
&dwResult, &dwResult,
NULL); NULL);
if (!DeviceIoControl (dev, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, &dr iveGeometry, sizeof (driveGeometry), &dwResult, NULL)) if (!DeviceIoControl (dev, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, &drive Geometry, sizeof (driveGeometry), &dwResult, NULL))
{ {
nStatus = ERR_OS_ERROR; nStatus = ERR_OS_ERROR;
goto closing_seq; goto closing_seq;
} }
if ( (driveGeometry.Geometry.BytesPerSector == 0) if ( (driveGeometry.BytesPerSector == 0)
|| (driveGeometry.Geometry.BytesPerSector > TC_MAX_VOLUME_SE || (driveGeometry.BytesPerSector > TC_MAX_VOLUME_SECTOR_SIZE
CTOR_SIZE) )
|| (driveGeometry.Geometry.BytesPerSector % ENCRYPTION_DATA_UNIT_ || (driveGeometry.BytesPerSector % ENCRYPTION_DATA_UNIT_SIZE != 0
SIZE != 0) )
) )
{ {
Error ("SECTOR_SIZE_UNSUPPORTED", hwndDlg); Error ("SECTOR_SIZE_UNSUPPORTED", hwndDlg);
nStatus = ERR_DONT_REPORT; nStatus = ERR_DONT_REPORT;
goto closing_seq; goto closing_seq;
} }
sectorSize = driveGeometry.Geometry.BytesPerSector; sectorSize = driveGeometry.BytesPerSector;
tmpSectorBuf = (byte *) TCalloc (sectorSize); tmpSectorBuf = (byte *) TCalloc (sectorSize);
if (!tmpSectorBuf) if (!tmpSectorBuf)
{ {
nStatus = ERR_OUTOFMEMORY; nStatus = ERR_OUTOFMEMORY;
goto closing_seq; goto closing_seq;
} }
nStatus = OpenBackupHeader (dev, devicePath, password, pkcs5_prf, pim, &m asterCryptoInfo, headerCryptoInfo, deviceSize); nStatus = OpenBackupHeader (dev, devicePath, password, pkcs5_prf, pim, &m asterCryptoInfo, headerCryptoInfo, deviceSize);
 End of changes. 7 change blocks. 
11 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)