VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Driver/Ntvol.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-20 15:04:07 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-20 15:31:24 +0100
commit4b9f8b232b956149850fc1c8b47f826a09044efa (patch)
treec083d57ad145d28cfb58b98fedfce2ab68e82eed /src/Driver/Ntvol.c
parent02cbecff6450f37498c558c1352550d647bffdfa (diff)
downloadVeraCrypt-4b9f8b232b956149850fc1c8b47f826a09044efa.tar.gz
VeraCrypt-4b9f8b232b956149850fc1c8b47f826a09044efa.zip
Reduce time for reporting wrong password by removing support for legacy hidden format because it was never functional and it was superseded by current hidden format.
Diffstat (limited to 'src/Driver/Ntvol.c')
-rw-r--r--src/Driver/Ntvol.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/Driver/Ntvol.c b/src/Driver/Ntvol.c
index a8bcc14a..5690ac65 100644
--- a/src/Driver/Ntvol.c
+++ b/src/Driver/Ntvol.c
@@ -319,10 +319,6 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
{
Dump ("Trying to open volume type %d\n", volumeType);
- if (mount->bPartitionInInactiveSysEncScope
- && volumeType == TC_VOLUME_TYPE_HIDDEN_LEGACY)
- continue;
-
/* Read the volume header */
if (!mount->bPartitionInInactiveSysEncScope
@@ -348,16 +344,6 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
headerOffset.QuadPart = mount->UseBackupHeader ? lDiskLength.QuadPart - TC_HIDDEN_VOLUME_HEADER_OFFSET : TC_HIDDEN_VOLUME_HEADER_OFFSET;
break;
-
- case TC_VOLUME_TYPE_HIDDEN_LEGACY:
- if (mount->UseBackupHeader)
- continue;
-
- if (bRawDevice && Extension->HostBytesPerSector != TC_SECTOR_SIZE_LEGACY)
- continue;
-
- headerOffset.QuadPart = lDiskLength.QuadPart - TC_HIDDEN_VOLUME_HEADER_OFFSET_LEGACY;
- break;
}
Dump ("Reading volume header at %I64d\n", headerOffset.QuadPart);
@@ -455,7 +441,7 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
ReadVolumeHeaderRecoveryMode = mount->RecoveryMode;
- if ((volumeType == TC_VOLUME_TYPE_HIDDEN || volumeType == TC_VOLUME_TYPE_HIDDEN_LEGACY) && mount->bProtectHiddenVolume)
+ if ((volumeType == TC_VOLUME_TYPE_HIDDEN) && mount->bProtectHiddenVolume)
{
mount->nReturnCode = ReadVolumeHeaderWCache (
FALSE,
@@ -577,14 +563,10 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
break;
case TC_VOLUME_TYPE_HIDDEN:
- case TC_VOLUME_TYPE_HIDDEN_LEGACY:
cryptoInfoPtr = mount->bProtectHiddenVolume ? tmpCryptoInfo : Extension->cryptoInfo;
- if (volumeType == TC_VOLUME_TYPE_HIDDEN_LEGACY)
- Extension->cryptoInfo->hiddenVolumeOffset = lDiskLength.QuadPart - cryptoInfoPtr->hiddenVolumeSize - TC_HIDDEN_VOLUME_HEADER_OFFSET_LEGACY;
- else
- Extension->cryptoInfo->hiddenVolumeOffset = cryptoInfoPtr->EncryptedAreaStart.Value;
+ Extension->cryptoInfo->hiddenVolumeOffset = cryptoInfoPtr->EncryptedAreaStart.Value;
Dump ("Hidden volume offset = %I64d\n", Extension->cryptoInfo->hiddenVolumeOffset);
Dump ("Hidden volume size = %I64d\n", cryptoInfoPtr->hiddenVolumeSize);
@@ -613,9 +595,6 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
Extension->cryptoInfo->hiddenVolumeProtectedSize = tmpCryptoInfo->hiddenVolumeSize;
- if (volumeType == TC_VOLUME_TYPE_HIDDEN_LEGACY)
- Extension->cryptoInfo->hiddenVolumeProtectedSize += TC_VOLUME_HEADER_SIZE_LEGACY;
-
Dump ("Hidden volume protection active: %I64d-%I64d (%I64d)\n", Extension->cryptoInfo->hiddenVolumeOffset, Extension->cryptoInfo->hiddenVolumeProtectedSize + Extension->cryptoInfo->hiddenVolumeOffset - 1, Extension->cryptoInfo->hiddenVolumeProtectedSize);
}