VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Driver/DriveFilter.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2020-06-20 13:10:28 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2020-06-20 22:27:15 (GMT)
commit0121dc0b81722ac07abac27d8215c524260bb3f2 (patch)
treef24b4f2b1fe5eac91bcbf684a1520c570baa5ebb /src/Driver/DriveFilter.c
parentd031addc2cfe93c40b4b7a7a20be31a86c39033f (diff)
downloadVeraCrypt-0121dc0b81722ac07abac27d8215c524260bb3f2.zip
VeraCrypt-0121dc0b81722ac07abac27d8215c524260bb3f2.tar.gz
Windows: Fix issue when RAM encryption used, AES selected and AES-NI not supported by CPU that caused the free space of newly created volumes not filled with random data even if "quick format" is not selected by user.
Diffstat (limited to 'src/Driver/DriveFilter.c')
-rw-r--r--src/Driver/DriveFilter.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Driver/DriveFilter.c b/src/Driver/DriveFilter.c
index 3813992..f89e6e9 100644
--- a/src/Driver/DriveFilter.c
+++ b/src/Driver/DriveFilter.c
@@ -2234,6 +2234,11 @@ 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));