VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Boot/Windows/BootConfig.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-04-20 00:30:28 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-04-20 00:48:20 +0200
commit1396269d573256248bece97e1e291ef0c08e513f (patch)
treee43c8e0a26d2d6ce0b84caa5200df585ab4d9a72 /src/Boot/Windows/BootConfig.cpp
parentbd9105794b1103e814e983e15e35ce139e6c2371 (diff)
downloadVeraCrypt-1396269d573256248bece97e1e291ef0c08e513f.tar.gz
VeraCrypt-1396269d573256248bece97e1e291ef0c08e513f.zip
Windows: Add option to avoid PIM prompt in pre-boot authentication by storing PIM value unencrypted in MBR.
Diffstat (limited to 'src/Boot/Windows/BootConfig.cpp')
-rw-r--r--src/Boot/Windows/BootConfig.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Boot/Windows/BootConfig.cpp b/src/Boot/Windows/BootConfig.cpp
index 222fcfc4..63ebaf5e 100644
--- a/src/Boot/Windows/BootConfig.cpp
+++ b/src/Boot/Windows/BootConfig.cpp
@@ -32,7 +32,7 @@ Partition EncryptedVirtualPartition;
Partition ActivePartition;
Partition PartitionFollowingActive;
bool ExtraBootPartitionPresent = false;
-uint64 HiddenVolumeStartUnitNo;
+uint64 PimValueOrHiddenVolumeStartUnitNo; // reuse this variable for stored PIM value to reduce memory usage
uint64 HiddenVolumeStartSector;
#ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE
@@ -68,6 +68,14 @@ void ReadBootSectorUserConfiguration ()
DisableScreenOutput();
}
+ if (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_PIM)
+ {
+ PimValueOrHiddenVolumeStartUnitNo.LowPart = 0;
+ memcpy (&PimValueOrHiddenVolumeStartUnitNo.LowPart, SectorBuffer + TC_BOOT_SECTOR_PIM_VALUE_OFFSET, TC_BOOT_SECTOR_PIM_VALUE_SIZE);
+ }
+ else
+ PimValueOrHiddenVolumeStartUnitNo.LowPart = -1;
+
OuterVolumeBackupHeaderCrc = *(uint32 *) (SectorBuffer + TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET);
ret: