VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2020-06-20 15:10:28 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2020-06-21 00:27:15 +0200
commit0121dc0b81722ac07abac27d8215c524260bb3f2 (patch)
treef24b4f2b1fe5eac91bcbf684a1520c570baa5ebb /src/Common
parentd031addc2cfe93c40b4b7a7a20be31a86c39033f (diff)
downloadVeraCrypt-0121dc0b81722ac07abac27d8215c524260bb3f2.tar.gz
VeraCrypt-0121dc0b81722ac07abac27d8215c524260bb3f2.zip
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/Common')
-rw-r--r--src/Common/Fat.c5
-rw-r--r--src/Common/Format.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/Common/Fat.c b/src/Common/Fat.c
index 8d4cc7d8..cd2c124f 100644
--- a/src/Common/Fat.c
+++ b/src/Common/Fat.c
@@ -442,6 +442,11 @@ FormatFat (void* hwndDlgPtr, unsigned __int64 startSector, fatparams * ft, void
return ERR_MODE_INIT_FAILED;
}
+#ifdef _WIN64
+ if (IsRamEncryptionEnabled ())
+ VcProtectKeys (cryptoInfo, VcGetEncryptionID (cryptoInfo));
+#endif
+
x = ft->num_sectors - ft->reserved - ft->size_root_dir / ft->sector_size - ft->fat_length * 2;
while (x--)
{
diff --git a/src/Common/Format.c b/src/Common/Format.c
index 1edbdf96..b6ef3199 100644
--- a/src/Common/Format.c
+++ b/src/Common/Format.c
@@ -898,6 +898,11 @@ int FormatNoFs (HWND hwndDlg, unsigned __int64 startSector, __int64 num_sectors,
goto fail;
}
+#ifdef _WIN64
+ if (IsRamEncryptionEnabled ())
+ VcProtectKeys (cryptoInfo, VcGetEncryptionID (cryptoInfo));
+#endif
+
while (num_sectors--)
{
if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,