From c27461572ca09705c16f26a1e9128ff3a4ebdda0 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 16 Dec 2014 00:14:42 +0100 Subject: Windows: Enhance performance by implementing the possibility to choose the correct hash algorithm of volumes during various operations (mount, change password...). In case of system encryption, slightly speedup Windows startup time by making the driver pickup the correct hash algorithm used for the encryption. --- src/Format/InPlace.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Format/InPlace.c') diff --git a/src/Format/InPlace.c b/src/Format/InPlace.c index 5c8cb3b4..8c07fd8e 100644 --- a/src/Format/InPlace.c +++ b/src/Format/InPlace.c @@ -548,7 +548,7 @@ int EncryptPartitionInPlaceBegin (volatile FORMAT_VOL_PARAMETERS *volParams, vol /* Now we will try to decrypt the backup header to verify it has been correctly written. */ - nStatus = OpenBackupHeader (dev, volParams->volumePath, volParams->password, &cryptoInfo2, NULL, deviceSize); + nStatus = OpenBackupHeader (dev, volParams->volumePath, volParams->password, volParams->pkcs5,&cryptoInfo2, NULL, deviceSize); if (nStatus != ERR_SUCCESS || cryptoInfo->EncryptedAreaStart.Value != cryptoInfo2->EncryptedAreaStart.Value @@ -663,6 +663,7 @@ int EncryptPartitionInPlaceResume (HANDLE dev, DWORD n; char *devicePath = volParams->volumePath; Password *password = volParams->password; + int pkcs5_prf = volParams->pkcs5; DISK_GEOMETRY driveGeometry; @@ -755,7 +756,7 @@ int EncryptPartitionInPlaceResume (HANDLE dev, sectorSize = driveGeometry.BytesPerSector; - nStatus = OpenBackupHeader (dev, devicePath, password, &masterCryptoInfo, headerCryptoInfo, deviceSize); + nStatus = OpenBackupHeader (dev, devicePath, password, pkcs5_prf, &masterCryptoInfo, headerCryptoInfo, deviceSize); if (nStatus != ERR_SUCCESS) goto closing_seq; @@ -1504,7 +1505,7 @@ closing_seq: } -static int OpenBackupHeader (HANDLE dev, const char *devicePath, Password *password, PCRYPTO_INFO *retMasterCryptoInfo, CRYPTO_INFO *headerCryptoInfo, __int64 deviceSize) +static int OpenBackupHeader (HANDLE dev, const char *devicePath, Password *password, int pkcs5, PCRYPTO_INFO *retMasterCryptoInfo, CRYPTO_INFO *headerCryptoInfo, __int64 deviceSize) { LARGE_INTEGER offset; DWORD n; @@ -1530,7 +1531,7 @@ static int OpenBackupHeader (HANDLE dev, const char *devicePath, Password *passw } - nStatus = ReadVolumeHeader (FALSE, header, password, retMasterCryptoInfo, headerCryptoInfo); + nStatus = ReadVolumeHeader (FALSE, header, password, pkcs5, retMasterCryptoInfo, headerCryptoInfo); if (nStatus != ERR_SUCCESS) goto closing_seq; -- cgit v1.2.3