VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2021-12-30 00:10:23 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2021-12-30 00:42:30 +0100
commitfac35ab08abc26d05e4b737d716f77ac794798d2 (patch)
tree75129baf6357d565c41e9cd3095287c43047e9cd
parent7e20f65e68f12b09eee31fa0c2c7b18285921ca9 (diff)
downloadVeraCrypt-fac35ab08abc26d05e4b737d716f77ac794798d2.tar.gz
VeraCrypt-fac35ab08abc26d05e4b737d716f77ac794798d2.zip
Windows Driver: Better code for EncryptionFragmentSize variable handling
-rw-r--r--src/Driver/Ntdriver.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c
index 50b66ab6..3c7b50dc 100644
--- a/src/Driver/Ntdriver.c
+++ b/src/Driver/Ntdriver.c
@@ -4833,12 +4833,13 @@ NTSTATUS ReadRegistryConfigFlags (BOOL driverEntry)
EncryptionItemCount = EncryptionIoRequestCount - 1;
/* EncryptionFragmentSize value in registry is expressed in KiB */
+ EncryptionFragmentSize *= 1024;
if (EncryptionFragmentSize == 0)
- EncryptionFragmentSize = TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE / 1024;
- else if (EncryptionFragmentSize > (8 * TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE / 1024))
- EncryptionFragmentSize = 8 * TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE / 1024;
+ EncryptionFragmentSize = TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE;
+ else if (EncryptionFragmentSize > (8 * TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE))
+ EncryptionFragmentSize = 8 * TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE;
+
- EncryptionFragmentSize = EncryptionFragmentSize * 1024;
}