VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/CommandLineInterface.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-05-02 14:45:22 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-05-04 13:14:05 +0200
commitb261177b8f5bc3f8495406d13dc03c0328b930f9 (patch)
tree535b8a6345c63529b3bc72f42d02c27c6aed64e3 /src/Main/CommandLineInterface.cpp
parent0b914c8f5d690dfc1bdfbca1e1083372c5ed84d8 (diff)
downloadVeraCrypt-b261177b8f5bc3f8495406d13dc03c0328b930f9.tar.gz
VeraCrypt-b261177b8f5bc3f8495406d13dc03c0328b930f9.zip
Windows/Linux/MacOSX: Set maximum PIM value to 2147468 in order to avoid having negative values for iterations count using the formula 15000 + (PIM x 1000). Add specific error message to XML language files.
Diffstat (limited to 'src/Main/CommandLineInterface.cpp')
-rw-r--r--src/Main/CommandLineInterface.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Main/CommandLineInterface.cpp b/src/Main/CommandLineInterface.cpp
index 2222b54f..e48a495f 100644
--- a/src/Main/CommandLineInterface.cpp
+++ b/src/Main/CommandLineInterface.cpp
@@ -414,7 +414,7 @@ namespace VeraCrypt
throw_err (LangString["PARAMETER_INCORRECT"] + L": " + str);
}
- if (ArgNewPim < 0)
+ if (ArgNewPim < 0 || ArgNewPim > (ArgMountOptions.PartitionInSystemEncryptionScope? MAX_BOOT_PIM_VALUE: MAX_PIM_VALUE))
throw_err (LangString["PARAMETER_INCORRECT"] + L": " + str);
else if (ArgNewPim > 0 && ArgTrueCryptMode)
throw_err (LangString["PIM_NOT_SUPPORTED_FOR_TRUECRYPT_MODE"]);
@@ -454,7 +454,7 @@ namespace VeraCrypt
throw_err (LangString["PARAMETER_INCORRECT"] + L": " + str);
}
- if (ArgPim < 0)
+ if (ArgPim < 0 || ArgPim > (ArgMountOptions.PartitionInSystemEncryptionScope? MAX_BOOT_PIM_VALUE: MAX_PIM_VALUE))
throw_err (LangString["PARAMETER_INCORRECT"] + L": " + str);
else if (ArgPim > 0 && ArgTrueCryptMode)
throw_err (LangString["PIM_NOT_SUPPORTED_FOR_TRUECRYPT_MODE"]);
@@ -491,7 +491,7 @@ namespace VeraCrypt
try
{
pim = StringConverter::ToInt32 (wstring (str));
- if (pim < 0)
+ if (pim < 0 || pim > (ArgMountOptions.PartitionInSystemEncryptionScope? MAX_BOOT_PIM_VALUE: MAX_PIM_VALUE))
throw_err (LangString["PARAMETER_INCORRECT"] + L": " + str);
}
catch (...)