1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Windows: remove 32-bit logic from the code since we support only 64-bit. remove 32-bit EFI bootloader files.

We also fix intermediary files folder for Portable and Setup projects
This commit is contained in:
Mounir IDRASSI
2024-11-16 01:05:15 +01:00
parent 489d3e3873
commit c86577fc0e
41 changed files with 131 additions and 525 deletions

View File

@@ -644,13 +644,11 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password,
Extension->Queue.MaxReadAheadOffset = BootDriveLength;
/* encrypt keys */
#ifdef _WIN64
if (IsRamEncryptionEnabled())
{
VcProtectKeys (Extension->HeaderCryptoInfo, VcGetEncryptionID (Extension->HeaderCryptoInfo));
VcProtectKeys (Extension->Queue.CryptoInfo, VcGetEncryptionID (Extension->Queue.CryptoInfo));
}
#endif
status = EncryptedIoQueueStart (&Extension->Queue);
if (!NT_SUCCESS (status))
@@ -722,7 +720,6 @@ static NTSTATUS SaveDriveVolumeHeader (DriveFilterExtension *Extension)
uint64 encryptedAreaLength = Extension->Queue.EncryptedAreaEnd + 1 - Extension->Queue.EncryptedAreaStart;
uint8 *fieldPos = header + TC_HEADER_OFFSET_ENCRYPTED_AREA_LENGTH;
PCRYPTO_INFO pCryptoInfo = Extension->HeaderCryptoInfo;
#ifdef _WIN64
CRYPTO_INFO tmpCI;
if (IsRamEncryptionEnabled())
{
@@ -730,7 +727,6 @@ static NTSTATUS SaveDriveVolumeHeader (DriveFilterExtension *Extension)
VcUnprotectKeys (&tmpCI, VcGetEncryptionID (pCryptoInfo));
pCryptoInfo = &tmpCI;
}
#endif
DecryptBuffer (header + HEADER_ENCRYPTED_DATA_OFFSET, HEADER_ENCRYPTED_DATA_SIZE, pCryptoInfo);
@@ -748,12 +744,10 @@ static NTSTATUS SaveDriveVolumeHeader (DriveFilterExtension *Extension)
mputLong (fieldPos, headerCrc32);
EncryptBuffer (header + HEADER_ENCRYPTED_DATA_OFFSET, HEADER_ENCRYPTED_DATA_SIZE, pCryptoInfo);
#ifdef _WIN64
if (IsRamEncryptionEnabled())
{
burn (&tmpCI, sizeof (CRYPTO_INFO));
}
#endif
}
status = TCWriteDevice (Extension->LowerDeviceObject, header, offset, TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE);
@@ -991,9 +985,7 @@ static NTSTATUS DispatchPower (PDEVICE_OBJECT DeviceObject, PIRP Irp, DriveFilte
&& irpSp->Parameters.Power.Type == DevicePowerState)
{
DismountDrive (Extension, TRUE);
#ifdef _WIN64
ClearSecurityParameters ();
#endif
}
PoStartNextPowerIrp (Irp);
@@ -1224,15 +1216,9 @@ typedef NTSTATUS (*HiberDriverWriteFunctionB) (PLARGE_INTEGER writeOffset, PMDL
typedef struct
{
#ifdef _WIN64
uint8 FieldPad1[64];
HiberDriverWriteFunctionB WriteFunctionB;
uint8 FieldPad2[56];
#else
uint8 FieldPad1[48];
HiberDriverWriteFunctionB WriteFunctionB;
uint8 FieldPad2[32];
#endif
HiberDriverWriteFunctionA WriteFunctionA;
uint8 FieldPad3[24];
LARGE_INTEGER PartitionStartOffset;
@@ -1243,18 +1229,10 @@ typedef NTSTATUS (*HiberDriverEntry) (PVOID arg0, HiberDriverContext *hiberDrive
typedef struct
{
LIST_ENTRY ModuleList;
#ifdef _WIN64
uint8 FieldPad1[32];
#else
uint8 FieldPad1[16];
#endif
PVOID ModuleBaseAddress;
HiberDriverEntry ModuleEntryAddress;
#ifdef _WIN64
uint8 FieldPad2[24];
#else
uint8 FieldPad2[12];
#endif
UNICODE_STRING ModuleName;
} ModuleTableItem;
@@ -2180,10 +2158,8 @@ static VOID DecoySystemWipeThreadProc (PVOID threadArg)
goto err;
}
#ifdef _WIN64
if (IsRamEncryptionEnabled ())
VcProtectKeys (wipeCryptoInfo, VcGetEncryptionID (wipeCryptoInfo));
#endif
EncryptDataUnits (wipeRandBuffer, &dataUnit, wipeBlockSize / ENCRYPTION_DATA_UNIT_SIZE, wipeCryptoInfo);
memcpy (wipeRandChars, wipeRandBuffer, sizeof (wipeRandChars));

View File

@@ -61,15 +61,6 @@ NTSTATUS DumpFilterEntry (PFILTER_EXTENSION filterExtension, PFILTER_INITIALIZAT
goto err;
}
// KeSaveFloatingPointState() may generate a bug check during crash dump
#if !defined (_WIN64)
if (filterExtension->DumpType == DumpTypeCrashdump)
{
dumpConfig.HwEncryptionEnabled = FALSE;
// disable also CPU extended features used in optimizations
DisableCPUExtendedFeatures ();
}
#endif
EnableHwEncryption (dumpConfig.HwEncryptionEnabled);
@@ -129,11 +120,7 @@ NTSTATUS DumpFilterEntry (PFILTER_EXTENSION filterExtension, PFILTER_INITIALIZAT
WriteFilterBufferSize = ((SIZE_T)filterInitData->MaxPagesPerWrite) * PAGE_SIZE;
#ifdef _WIN64
highestAcceptableWriteBufferAddr.QuadPart = 0x7FFffffFFFFLL;
#else
highestAcceptableWriteBufferAddr.QuadPart = 0xffffFFFFLL;
#endif
WriteFilterBuffer = MmAllocateContiguousMemory (WriteFilterBufferSize, highestAcceptableWriteBufferAddr);
if (!WriteFilterBuffer)

View File

@@ -217,13 +217,6 @@ void GetDriverRandomSeed (unsigned char* pbRandSeed, size_t cbRandSeed)
WHIRLPOOL_CTX tctx;
size_t count;
#ifndef _WIN64
KFLOATING_SAVE floatingPointState;
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
if (HasISSE())
saveStatus = KeSaveFloatingPointState (&floatingPointState);
#endif
while (cbRandSeed)
{
WHIRLPOOL_init (&tctx);
@@ -279,11 +272,6 @@ void GetDriverRandomSeed (unsigned char* pbRandSeed, size_t cbRandSeed)
pbRandSeed += count;
}
#if !defined (_WIN64)
if (NT_SUCCESS (saveStatus))
KeRestoreFloatingPointState (&floatingPointState);
#endif
FAST_ERASE64 (digest, sizeof (digest));
FAST_ERASE64 (&iSeed.QuadPart, 8);
FAST_ERASE64 (&iSeed2.QuadPart, 8);

View File

@@ -634,10 +634,8 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
goto error;
}
#ifdef _WIN64
if (IsRamEncryptionEnabled() && (volumeType == TC_VOLUME_TYPE_NORMAL || !mount->bProtectHiddenVolume))
VcProtectKeys (Extension->cryptoInfo, VcGetEncryptionID (Extension->cryptoInfo));
#endif
Dump ("Volume header decrypted\n");
Dump ("Required program version = %x\n", (int) Extension->cryptoInfo->RequiredProgramVersion);